Published
Edited
Mar 24, 2022
Insert cell
Insert cell
nlp("i'm good.").json()[0].terms
Insert cell
Insert cell
Insert cell
Insert cell
{
let doc = nlp(text)
doc.contractions().expand()
return doc.text()
}
Insert cell
Insert cell
{
// possessive, and not a contraction
let doc = nlp(`spencer's house`)
doc.contractions().expand()
return doc.text()
}
Insert cell
{
// lots of tricks happening
let doc = nlp(`They'd seen. They'd go`)
doc.contractions().expand()
return doc.text()
}
Insert cell
Insert cell
{
let doc = nlp(`he isn't`)
return doc.match(`isn't`).json()[0]
}
Insert cell
{
let doc = nlp(`he isn't`)
return doc.match(`is not`).json()[0]
}
Insert cell
Insert cell
{
let doc = nlp(`he didn't go`)
doc.verbs().toFutureTense()
return doc.text()
}
Insert cell
Insert cell
{
let doc = nlp('he had not seen.')
doc.contract()
return doc.text()
}
Insert cell
Insert cell
nlp(`john's cool`).has('@hasContraction')
Insert cell
nlp(`john's house`).has('@hasContraction')
Insert cell
Insert cell
nlp(`why can't i have no kids and three money?`).contractions().text()
Insert cell
Insert cell
nlp(`I can't believe it's a law firm!`).contractions().expand().all().text()
Insert cell
nlp(`and we'll keep on fighting till the end...`).splitBefore('@hasContraction').json()
Insert cell
Insert cell
Insert cell
Insert cell

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.
Learn more