Public
Edited
Mar 25, 2022
2 forks
3 stars
Insert cell
Insert cell
{
let doc = nlp('Hi everybody! Hi Dr. Nick!')
return doc.document
}
Insert cell
Insert cell
nlp(`"i don't care. Nothing's gonna stop me in the middle of this speech. You're gonna - lemon tree?!"`).length
Insert cell
Insert cell
nlp.model().one.abbreviations
Insert cell
Insert cell
{
let doc = nlp('juvinile diabetes? Hysterical pregnency?')
return doc.has('diabetes hysterical') //nope
}
Insert cell
Insert cell
nlp("that's it. Back to Winnipeg!").sentences().length
Insert cell
Insert cell
nlp("that's it. Back to Winnipeg!").sentences().json()
Insert cell
Insert cell
nlp('we get it, you vape.').sentences().toPastTense().text()
Insert cell
Insert cell
nlp(`hey pal, did you get a load of the nerd?`).sentences().toPresentTense().text()
Insert cell
Insert cell
nlp('we like roy!').sentences().toFutureTense().text()
Insert cell
Insert cell
nlp(`I was saying boo-urns.`).sentences().toNegative().text()
Insert cell
Insert cell
nlp("okay, don't use reverse psychology.").sentences().toPositive().text()
Insert cell
Insert cell
nlp('are you saying boo, or boo-urns? I was saying boo-urns.').sentences().isQuestion().out('array')
Insert cell
Insert cell
nlp('we like Roy! we like Roy!').sentences().isExclamation().out('array')
Insert cell
Insert cell
nlp('are you saying boo, or boo-urns? I was saying boo-urns.').sentences().isStatement().out('array')
Insert cell
Insert cell
nlp("I’m lookin’ for Amanda Hugginkiss.").sentences().prepend('Hey everybody,').text()
Insert cell
Insert cell
nlp("hey guys, do I have a Bee Oproblem?").sentences().append('here').text()
Insert cell
Insert cell
nlp = await require('compromise')
Insert cell
nlp.version
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