Module rpu.grammar

Functions

def ordinal(number: int) ‑> str

Returns the ordinal version of a number

Parameters

number : int
the number to be turned ordinal

Returns

str
the ordinal version

Examples

>>> ordinal(5)
... 5th
>>> ordinal(2)
... 2nd
def possessive(text: str) ‑> str

Returns the possessive version of the given text

Parameters

text : str
The text you want the possessive version of

Returns

str
The possessive version of the text

Classes

class Plural (num: Union[int, float])

Returns the plural version of the given text

Parameters

num : Union[int, float]
the number you want to use for getting the plural of text

Useage

Example: Plural(5):the_text -> 5 the_texts