nlp(`springfield, springfield, it's a hell of a town.`).match('springfield').tag('City').out('tags')
nlp("telegram for Heywood U. Cuddleme").people().unTag('#Person').json(0)
nlp("Moe Sizlak.").terms().canBe('#Verb').found
{
letdoc=nlp("Moe Sizlak.").terms()
doc.tagSafe('#Verb')//has no effect
returndoc.out('tags')[0].moe
}
// give it an ambiguous word
word=nlp('april')
// you can see, it's tagged as a '#Month':
word.json(0)
{//ok, decide it's a Person's name, instead
word.tag('FemaleName');
returnword.json(0)
}
{//add an unknown tag
word.tag('FooBar');
//change it back to a #Month
word.tag('Month');
returnword.json(0).terms[0]
}
{
nlp.verbose(true);// open the dev console, to see the output
nlp('it is supercalifragilisticexpialidocious')
// 'it' -> Pronoun (lexicon-match)
// 'is' -> Copula (lexicon-match)
// 'supercal...' -> Adjective suffix -ous
}
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.