question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

multiple-noun inflection

See original GitHub issue

v7 is still in the process of being built, so this is just a general query about how the API will work, rather than a bug report.

I know how to pluralize a single noun: nlp("animal").nouns().toPlural().out("text"), but am not sure about the best approach for noun-phrases.

nlp("brazil nut").nouns().toPlural().out("text"); // "brazil nuts"   <-- correct! :D
nlp("coconut cream").nouns().toPlural().out("text"); // "coconuts creams"
nlp("brown rice").nouns().toPlural().out("text"); // " rice"
nlp("human right").nouns().toPlural().out("text"); // "humans"
nlp('kiwi fruit').nouns().toPlural().out("text"); // "kiwis fruit"
nlp('crab apple').nouns().toPlural().out("text") // "crabs apples"

http://jsbin.com/fiducotuha/4/edit?html,console

Would .nouns().last() be the best approach for this sort of thing (when last() is added)? Or is there (/will there be) a better approach? Cheers 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
spencermountaincommented, May 26, 2022

took 5 years, but hey!

console.log(nlp('coconut cream').nouns().toPlural().text())
// coconut creams
console.log(nlp('brazil nut').nouns().toPlural().text())
// brazil nuts
console.log(nlp('crab apple').nouns().toPlural().text())
// crab apples
console.log(nlp('mayor of Chicago').nouns().toPlural().text())
// mayors of Chicago
1reaction
spencermountaincommented, Mar 14, 2017

hey, just getting back to this. situation’s a little better, but still not very good https://runkit.com/583f2a3dc534df0014136221/58c8282b5763290014d7b461

Read more comments on GitHub >

github_iconTop Results From Across the Web

Noun Inflections - My English Language
So, the English noun has only two inflected forms: inflection due to number (plural) and inflection due to possession (the genitive case). Noun...
Read more >
Word structure: Inflection | Englicious.org
Inflection is the process by which a single word takes different forms. For example, if we have the noun cat, we can add...
Read more >
Inflection - Wikipedia
The inflection of verbs is called conjugation, and one can refer to the inflection of nouns, adjectives, adverbs, pronouns, determiners, participles, ...
Read more >
Definition and Examples of Inflections in English Grammar
Inflections in English grammar include the genitive 's; the plural -s; the third-person singular -s; the past tense -d, -ed, or -t; ...
Read more >
inflection | linguistics - Britannica
English inflection indicates noun plural (cat, cats), noun case (girl, girl's, girls'), third person singular present tense (I, you, we, they buy; he...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found