Compromise: Noun.conjugate() error with the example from the API documentation

Created on 1 Jun 2016  路  3Comments  路  Source: spencermountain/compromise

From the API documentation:

nlp.noun('mayors of toronto').conjugate()
//{ plural: 'mayors of toronto', singular: 'mayor of toronto' }

My results:

// NodeJS v5.7.1 REPL
// Babel v6.5.2 w/presets: "es2015", "stage-0"
// nlp_compromise v4.10.5

const nlp = require('nlp_compromise');
nlp.noun('mayors of toronto').conjugate();

TypeError: nlp.noun(...).conjugate is not a function

Most helpful comment

hey thanks Shawn, yeah just some old documentation.
that was an attempt to wrap noun.singularize() and noun.pluralize() into one method, but I agree it's not the right label for it. Right now you can just call each one individually.
@ilyankou how would you feel about a more generic term.forms() method? (or something similar)
That way, no matter what the class, you could blast-out all the different transformations we can think of.

All 3 comments

Conjugation is a term applicable exclusively to verbs. From Wikipedia:

_In linguistics, conjugation is the creation of derived forms of a verb from its principal parts by inflection (alteration of form according to rules of grammar). Conjugation may be affected by person, number, gender, tense, aspect, mood, voice, or other grammatical categories.
...
The term conjugation is applied only to the inflection of verbs, and not of other parts of speech (inflection of nouns and adjectives is known as declension)._

We should add declension() to Nouns doing the same thing as conjugate() in the API documentation (singular + plural).

hey thanks Shawn, yeah just some old documentation.
that was an attempt to wrap noun.singularize() and noun.pluralize() into one method, but I agree it's not the right label for it. Right now you can just call each one individually.
@ilyankou how would you feel about a more generic term.forms() method? (or something similar)
That way, no matter what the class, you could blast-out all the different transformations we can think of.

Remove noun.conjugate from typings?

Was this page helpful?
0 / 5 - 0 ratings