vibe.linguistics.transforms¶
Public transformation functions that use the language registry.
These functions are the primary API for linguistic transformations. They dispatch to the appropriate language-specific rules based on locale.
pluralize ¶
pluralize(obj: Linguistic, if_count: int | None = None, overrides: str | None = None) -> Linguistic
Pluralize items when count dictates; respects locale rules.
| Parameters: |
|
|---|
| Returns: |
|
|---|
make_definite ¶
make_definite(obj: Linguistic, overrides: str | None = None) -> Linguistic
Mark items as definite (the ...), using locale-specific rules.
| Parameters: |
|
|---|
| Returns: |
|
|---|
make_possessive ¶
make_possessive(obj: Linguistic, overrides: str | None = None, subject: str | None = None) -> Linguistic
Produce a possessive form; can add a subject (e.g., "the end of ...").
| Parameters: |
|
|---|
| Returns: |
|
|---|
itemize ¶
itemize(obj: Linguistic, conjunction: str) -> Linguistic
Set the conjunction used when rendering the final list.
| Parameters: |
|
|---|
| Returns: |
|
|---|
cardinal_filter ¶
cardinal_filter(value: int | float | str, cutoff: int | None = None, locale: str | None = None) -> str
Convert numbers to words with optional cutoff threshold.
| Parameters: |
|
|---|
| Returns: |
|
|---|
ordinal_filter ¶
ordinal_filter(value: int | float | str, locale: str | None = None) -> str
Convert numbers to ordinal words.
| Parameters: |
|
|---|
| Returns: |
|
|---|
doublet_filter ¶
doublet_filter(value: int | float | str, unit: str | None = None, locale: str | None = None) -> str
Create doublet format: 10 -> "ten (10)" with optional unit.
| Parameters: |
|
|---|
| Returns: |
|
|---|
roman_filter ¶
roman_filter(value: int | float | str, case: str = 'upper') -> str
Convert number to Roman numeral.
| Parameters: |
|
|---|
| Returns: |
|
|---|
alpha_filter ¶
alpha_filter(value: int | float | str, case: str = 'upper') -> str
Convert number to alphabetical label (1=A, 2=B, ..., 26=Z).
| Parameters: |
|
|---|
| Returns: |
|
|---|
indefinite_filter ¶
indefinite_filter(value: str, locale: str | None = None, overrides: str | None = None) -> str
Add indefinite article to a word using locale-specific rules.
| Parameters: |
|
|---|
| Returns: |
|
|---|