letdoc=nlp('i saw Bob Dylan and Jimi Hendrix at Woodstock.')
// grab all the person-names
letpeople=doc.people()
// split by this list of matches
returndoc.splitOn(people).out('array')
}
{
letdoc=nlp(`i have two questions for Homer - 'Why lie?' and 'Lies, why?'`)
// grab all the quotations
letm=doc.quotations()
// split by this list of matches
returndoc.splitOn(m).out('array')
}
{
letdoc=nlp("one foo two foo")
// split-up by all terms
letm=doc.terms()
//join last two terms together
m=m.joinIf('two','foo')
returnm.out('array')
}
{
letdoc=nlp("one foo two foo")
// split-up by all terms
letm=doc.terms()
//join all terms back together
m=m.join()
returnm.out('array')
}
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.