Files
SUST/sustApp/salutation_helpers.py
T
2026-06-25 11:19:08 +02:00

52 lines
1.6 KiB
Python

"""Salutation and pronoun helpers for German language text generation."""
def get_gender_salutation(gender: str, capitalize: bool = False) -> str:
"""Return appropriate salutation based on gender.
Args:
gender: 'female' or any other value defaults to male
capitalize: Whether to capitalize the first letter
Returns:
'liebe' (if female) or 'lieber' (if male), optionally capitalized
"""
if gender == "female":
salutation = "liebe"
else:
salutation = "lieber"
return salutation.capitalize() if capitalize else salutation
def get_pronouns(is_plural: bool = False) -> dict:
"""Return gender-neutral pronoun set for singular or plural forms.
Args:
is_plural: If True, returns plural pronouns (euer, euch, etc.),
otherwise returns singular pronouns (Dein, Dich, etc.)
Returns:
Dictionary with pronoun variations:
- 'possessive': possessive form (Deine/eure)
- 'neutral': neutral form (Dein/euer)
- 'accusative': accusative form (Dich/euch)
- 'conditional': conditional form (Solltest Du/Solltet ihr)
- 'verb': verb form (sende/sendet)
"""
if is_plural:
return {
'possessive': 'eure',
'neutral': 'euer',
'accusative': 'euch',
'conditional': 'Solltet ihr',
'verb': 'sendet'
}
else:
return {
'possessive': 'Deine',
'neutral': 'Dein',
'accusative': 'Dich',
'conditional': 'Solltest Du',
'verb': 'sende'
}