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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more