Giter Site home page Giter Site logo

nlp_compromise's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.