nlp('Hey, teacher! leave those kids alone').match('those #Plural').text()
nlp('Somebody once told me the world was gonna roll me.').match('the .').text()
{
letdoc=nlp('i went and saw Boston')//interprets this as a #Place
//grab the one word..
letword=doc.match('boston')
//give it a new tag,
word.tag('RockBand')
//now this word can be found this way:
returndoc.match('#RockBand').text()
}
{
//declare new tags in a plugin,
constmyPlugin=(doc,world)=>{
world.addTags({
RockBand:{
isA:'Organization'
}
})
}
nlp.extend(myPlugin)
//parse the document again
letdoc=nlp('boston was loud')
//grab the word, and tag it
doc.match('boston').tag('RockBand')
//see if it's still a #Place now
returndoc.match('#Place').length
}
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.