Skip to content

mahangu/nlp_compromise

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Natural Language Processing in the browser

CodacyBadge npm version downloads

Yup,

  • smaller than jQuery (100k)
  • 86% on the Penn treebank
  • keypress speed, constant-time
  • caniuse, yup. IE9+
  • no dependencies, training, or configuration

It's a rule-based, user-focused, and satisfactory javascript library for understanding and changing written english

                - Check it out -

   :boom: Welcome to v2.0!   Please file an issue if you find something 💥

Off you go:

npm install nlp_compromise

<script src="./builds/nlp_compromise.es5.min.js"> </script>

let nlp = require("nlp_compromise");

nlp.text("She sells seashells").negate()
// She didn't sell seashells

nlp.text('She sells seashells').to_past()
// She sold seashells

nlp.verb("speak").conjugate();
// { past: 'spoke',
//   infinitive: 'speak',
//   gerund: 'speaking',
//   actor: 'speaker',
//   present: 'speaks',
//   future: 'will speak',
//   perfect: 'have spoken',
//   pluperfect: 'had spoken',
//   future_perfect: 'will have spoken'
// }

nlp.term("hamburger").syllables();
// [ 'ham', 'bur', 'ger' ]

nlp.noun("dinosaur").pluralize();
// "dinosaurs"

nlp.text("Tony Danza did a kickflip").people();
// "Tony Danza"

nlp.person("Tony Hawk").article();
// "he"

nlp.value("five hundred and sixty").number;
// 560

nlp.term("favourite").americanize()
// favorite

we've also got a modest, though very ambitious plugin ecosystem:

nlp_compromise.mixin(valley_girl);
t = nlp_compromise.text('it is a cool library.');
t.valley_girl();
// "So basically, it is like, a cool library."

                try it out

Development

Issue Stats Issue Stats

nlp_compromise aims to be the best way to work with language in js. This is only done with many hands. Contributions in all forms are appreciated and respected.

Join our slack group slack or our infrequent announcement email-list

MIT license

About

natural language processing in the browser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.9%
  • HTML 0.1%