<p><pre><code> nlp.statement('She sells seashells').negate().text()
// She doesn't sell seashells
nlp.sentence('I fed the dog').replace('the [Noun]', 'the cat').text()
// I fed the cat
nlp.text("Tony Hawk did a kickflip").people();
// [ Person { text: 'Tony Hawk' ..} ]</code></pre>
Perhaps I am misunderstanding the example but isn't the date parsing result from the API documentation incorrect.<p><pre><code> nlp.value("I married April for the 2nd time on June 5th 1998 ").date()
// [Date object] d.toLocaleString() -> "04/2/1998"
</code></pre>
<a href="https://github.com/nlp-compromise/nlp_compromise/blob/master/docs/api.md#date-parsing" rel="nofollow">https://github.com/nlp-compromise/nlp_compromise/blob/master...</a>
Hmm this example is interesting:<p><pre><code> nlp.person("Tony Hawk").pronoun();
// 'he'
</code></pre>
I was curious how it handled gender neutral names, since being able to identify gender from a name would be an awesome UX win. I tried a variety of different names, and for gender neutral names (ie "Alex" or "Taylor"), it always picked "he". If it doesn't recognize the name (ie "Alexa"), it returns "they". Unfortunately, it only recognizes very standard American names. Anything remotely ethnic (ie "Anjali") or slightly uncommon (ie "Nate") results in a "they".<p>Not picking on the library, since this would be an impossible task even for a human, but it seems odd to have used pronoun identification as one of the headline examples.<p>Anyway, awesome library overall. This could pair well with a dedicated date parsing library like Sherlock[1] to create some pretty cool conversational UI elements.<p>1: <a href="https://github.com/neilgupta/sherlock" rel="nofollow">https://github.com/neilgupta/sherlock</a>
How would I proceed to turn<p>"this library is great." into "all other libraries aren't great." ?<p><a href="https://tonicdev.com/5716bedc1dd0391100f67570/57372d9625c9be1100f23823" rel="nofollow">https://tonicdev.com/5716bedc1dd0391100f67570/57372d9625c9be...</a>
This library is fantastic. I've used in some side projects and while it's far from perfect it hits that "good enough" space pretty well.
This could be great for foreign language learners!<p>Imagine integrating this into Anki: "Please negate this sentence", "Please turn this sentence into past tense", "What's the direct object", and so on.<p>Perhaps "this sentence" could refer to some interesting sentence from an article that you read in Pocket last week, for example!
Instead of trying to train computers to parse our langueges, why don't we improve our languages so that they are unambigious and each word has one meaning and each meaning only has one word. If only there was one universal language that had no exceptions.