vibe.linguistics.languages.en

English language rules for linguistic transformations.

EnglishRules

English grammar rules implementation.

pluralize

pluralize(word: str, context: Linguistic | None = None, overrides: str | None = None) -> str

Convert a word to its plural form.

Parameters:
  • word (str) –

    The word to pluralize

  • context (Linguistic | None, default: None ) –

    Optional Linguistic context

  • overrides (str | None, default: None ) –

    Optional override string for ad-hoc irregular forms. Format: "singular->plural,singular2->plural2" Example: "goose->geese,moose->moose"

make_definite

make_definite(word: str, number: str = 'singular', gender: GrammaticalGender | None = None, context: Linguistic | None = None, overrides: str | None = None) -> str

Add 'the' prefix for definite form.

make_possessive

make_possessive(word: str, subject: str | None = None, context: Linguistic | None = None, overrides: str | None = None) -> str

Convert to possessive form.

English has special handling for subject: instead of "contract's end", we rephrase to "the end of the contract".

make_indefinite

make_indefinite(word: str, gender: GrammaticalGender | None = None, context: Linguistic | None = None, overrides: str | None = None) -> str

Add indefinite article (a/an) to a word.

English uses "an" before vowel sounds, "a" before consonant sounds.

number_to_cardinal

number_to_cardinal(num: int) -> str

Convert number to English words.

number_to_ordinal

number_to_ordinal(num: int) -> str

Convert number to English ordinal words.

format_conjunction

format_conjunction(conjunction_type: str) -> str

Return English conjunction word.

uses_oxford_comma

uses_oxford_comma() -> bool

English uses the Oxford comma.