Example Usage ============= Quick Reference +++++++++++++++ Inflex provides three objects, which contain the following most important methods: :`Noun`_: Let's introduce a running example: >>> noun = Noun("brother") * `singular `_: Return the singular form of this noun. >>> noun.singular() "brother" * `plural `_: Return the plural form of this noun. >>> noun.plural() "brothers" * `lemma `_: Return the lemma for this noun, identical to `singular `_. * `is_singular `_: Return whether this noun is singular. >>> noun.is_singular() True * `is_plural `_: Return whether this noun is plural. >>> noun.is_plural() False * `classical `_ / `unassimilated `_: Return a `ClassicalNoun `_ instance, which is a subclass of `Noun`_, but with classical conversions instead. >>> noun.classical().plural() "brethren" * `as_regex `_: Return a re.Pattern which matches any inflected form of the word. >>> noun.as_regex() re.compile('brothers|brother|brethren', re.IGNORECASE) * `indef_article `_: Return the correct indefinite article ('a' or 'an') for word. >>> noun.indef_article() "a" * `indefinite `_: Prepend 'a' or 'an' or the number to the correct form of this Noun. >>> noun.indefinite(count = 1) "a brother" >>> noun.indefinite(count = 3) '3 brothers' :`Verb`_: Let's introduce a running example: >>> verb = Verb("fly") * `singular `_: Return the singular form of this verb. >>> verb.singular() "flies" * `plural `_: Return the plural form of this verb. >>> verb.plural() "fly" * `past `_: Return the past form of this verb. >>> verb.past() "flew" * `pres_part `_: Return the present participle form of this verb. >>> verb.pres_part() "flying" * `past_part `_: Return the past participle form of this verb. >>> verb.past_part() "flown" * `lemma `_: Return the lemma for this noun, identical to `plural `_. * `is_singular `_: Return whether this verb is in singular form. >>> verb.is_singular() False * `is_plural `_: Return whether this verb is in plural form. >>> verb.is_plural() True * `is_past `_: Return whether this verb is in past form. >>> verb.is_past() False * `is_pres_part `_: Return whether this verb is in present participle form. >>> verb.is_pres_part() False * `is_past_part `_: Return whether this verb is in past participle form. >>> verb.is_past_part() False * `as_regex `_: Return a re.Pattern which matches any inflected form of the word. >>> verb.as_regex() re.compile('flying|fly|flown|flies|flew', re.IGNORECASE) :`Adjective`_: Let's introduce a running example: >>> adj = Adjective("pretty") * `singular `_: Return the singular form of this adjective. >>> adj.singular() "pretty" * `plural `_: Return the plural form of this adjective. >>> adj.plural() "pretty" * `comparative `_: Return the comparative form of this adjective. >>> adj.singular() "prettier" * `superlative `_: Return the superlative form of this adjective. >>> adj.singular() "prettiest" * `is_singular `_: Return whether this adjective is in singular form. >>> adj.is_singular() True * `is_plural `_: Return whether this adjective is in plural form. >>> adj.is_singular() True * `as_regex `_: Return a re.Pattern which matches any inflected form of the word. (Only plural and singular) >>> adj.as_regex() re.compile('pretty', re.IGNORECASE) This quick reference is not exhaustive, but does cover the most important functionality supported by Inflex. Feel free to look at the full `API Reference`_ for more detailed information. .. _Noun: /api/inflex.noun.html#inflex.noun.Noun .. _Verb: /api/inflex.verb.html#inflex.verb.Verb .. _Adjective: /api/inflex.adjective.html#inflex.adjective.Adjective .. _API Reference: /api/inflex.html