Compromise

compromise

modest natural-language processing.

compromise is not the cleverest, but it is small, quick, and good-enough for a bunch of nlp stuff!

Don't miss to checkout their site compromise.cool!

GET IT: npm install compromise

Sample usages:

1
2
3
4
5
const nlp = require('compromise')

const doc = nlp('JS is calling')
doc.sentences().toNegative()
// 'JS is not calling'
1
2
doc = nlp("the guest-singer's björk   at seven thirty.").normalize().out('text')
// 'The guest singer is Bjork at 7:30.'
1
2
3
4
5
doc = nlp("we're not gonna take it, no we ain't gonna take it.")
doc.has('going') // true
doc.match('are not').length // == 2
doc.contractions().expand().out()
//'we are not going to take it, no we are not going to take it'

GIT FTW!

compromise.gif

Suggest a module

Comments