Product
Introducing Socket Optimize
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.
compromise
Advanced tools
npm install compromise@next
nlp('I look just like buddy holly').sentences().toPastTense().out('text')
// "I looked just like buddy holly."
###Grammar, for the win:
r = nlp('john is really nice. sara quickly walks.')
//pluck-out some parts
r.remove('#Adverb')
//reach-in and transform parts
r.match('#Person').toTitleCase()
r.plaintext()
// 'John is nice. Sara walks.'
###Conjugation:
r = nlp('she sells seashells by the seashore.').sentences().toFuture().text()
//'she will sell seashells...'
r.verbs().conjugate()
// [{ PastTense: 'sold',
// Infinitive: 'sell',
// Gerund: 'selling', ...
// }]
###Plural/singular:
r = nlp('a bottle of beer on the wall.')
r.nouns().first().toPlural()
r.text()
//'The bottles of beer on the wall.'
###Negation:
r = nlp('london is calling')
r.sentences().toNegative()
// 'london is not calling'
###Number interpretation:
r = nlp('fifth of december')
r.values().toCardinal().text()
// 'five of december'
r.values().toNumber().text()
// '5 of december'
###Clever normalization:
r = nlp("the guest-singer's björk at seven thirty.").normalize().text()
// 'The guest singer is Bjork at 7:30.'
###Named-entity recognition:
r = nlp('the opera about richard nixon visiting china')
r.match('(#Person|#Place|#Organization)').data()
// [
// { text: 'richard nixon', tags: ['Person'] },
// { text: 'china', tags: ['Place', 'Country'] }
// ]
###Fancy outputs:
r = nlp('Tony Hawk won').asHtml()
/*
<span>
<span class="Person Noun MalePerson">Tony Hawk</span>
<span> </span>
<span class="Verb PastTense">won</span>
</span>
*/
###Join-in:
#See also For the former promise-library, see jnewman/compromise (Thanks to the awesome jnewman for the npm package!)
(don't forget NLTK, GATE, Stanford, and Illinois toolkit )
FAQs
modest natural language processing
The npm package compromise receives a total of 41,136 weekly downloads. As such, compromise popularity was classified as popular.
We found that compromise demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.