vibe.linguistics.languages.fr

French language rules for linguistic transformations.

FrenchRules

French grammar rules implementation.

get_gender_hint

get_gender_hint(word: str) -> GrammaticalGender | None

Attempt to determine grammatical gender from word form.

pluralize

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

Convert a French 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: "oeil->yeux,travail->travaux"

make_definite

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

Add French definite article.

French definite articles: - Masculine singular: le (l' before vowel) - Feminine singular: la (l' before vowel) - Plural: les

make_possessive

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

Convert to French possessive/genitive form.

French uses "de" + article: - du + masc sing noun - de la + fem sing noun - de l' + vowel-starting noun - des + plural noun

Note: The subject parameter is handled by the transforms layer.

make_indefinite

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

Add French indefinite article (un/une) to a word.

French indefinite articles depend on grammatical gender: - MASCULINE: "un" - FEMININE: "une"

number_to_cardinal

number_to_cardinal(num: int) -> str

Convert number to French words.

number_to_ordinal

number_to_ordinal(num: int) -> str

Convert number to French ordinal words.

format_conjunction

format_conjunction(conjunction_type: str) -> str

Return French conjunction word.

uses_oxford_comma

uses_oxford_comma() -> bool

French does not use the Oxford comma.