Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# verbecc Changelog

- 1.11.7 [TBR]
- Cont. refactoring

- 1.11.6 [26 October 2025]
- Fixed Voseo conjugation for irregular verb `ser` for the subjuntivo (no vowel accents)
- Misc. cleanup
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "verbecc"
version = "1.11.6"
version = "1.11.7"
dependencies = [
"cython>=3.1.4",
"importlib_resources==6.4.5 ; python_version < '3.13'",
Expand Down
131 changes: 59 additions & 72 deletions verbecc/src/conjugator/conjugator.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _conjugate_mood_tense(
tense,
aux_mood,
aux_tense,
self._inflector.auxilary_verb_uses_alternate_conjugation(tense),
self._inflector.auxiliary_verb_uses_alternate_conjugation(tense),
alternates_behavior,
gender=gender,
conjugate_pronouns=conjugate_pronouns,
Expand Down Expand Up @@ -342,7 +342,7 @@ def _conjugate_compound(
.tense_templates[aux_tense]
.person_endings
]
aux_verb = self._inflector.get_auxilary_verb(co, mood, tense)
aux_verb = self._inflector.get_auxiliary_verb(co, mood, tense)
aux_co = self._get_conj_obs(aux_verb)
aux_tense_template = copy.deepcopy(
aux_co.template.mood_templates[aux_mood].tense_templates[aux_tense]
Expand Down Expand Up @@ -428,7 +428,7 @@ def _conjugate_compound_primary_verb(
ret: List[str] = []

p_conj = []
# the Romanian indicativ viitor-1 uses the inifitive form instead of the participle
# the Romanian indicativ viitor-1 uses the infinitive form instead of the participle
if self._inflector.compound_primary_verb_conjugation_uses_infinitive(
mood, tense
):
Expand All @@ -448,7 +448,7 @@ def _conjugate_compound_primary_verb(
# cast is safe since we're not using AlternatesBehavior.All
p_conj = cast(List[str], p_conj)

if not self._inflector.is_auxilary_verb_inflected(aux_verb):
if not self._inflector.is_auxiliary_verb_inflected(aux_verb):
# participle is not inflected, e.g. French passé composé with avoir
# where aux_verb = "avoir"
# e.g. j'ai parlé, tu as parlé, il a parlé, nous avons parlé, vous avez parlé, ils ont parlé
Expand Down Expand Up @@ -573,30 +573,55 @@ def _conjugate_simple_mood_tense(
"""
if modify_stem_strip_accents and mood != self._inflector.get_infinitive_mood():
verb_stem = strip_accents(verb_stem)
ret = []
ret: TenseConjugation = []
tense = tense_template.name
compound = True
if (
tense in self._inflector.get_tenses_conjugated_without_pronouns()
or not conjugate_pronouns
):
for person_ending in tense_template.person_endings:
person_ending = self._inflector.modify_person_ending_if_applicable(
person_ending,
mood,
tense,
tense_template,
lang_specific_options,
)
person_conjugation: PersonConjugation = []
endings: List[str] = []
if alternates_behavior == AlternatesBehavior.FirstOnly:
endings.append(person_ending.get_ending())
elif alternates_behavior == AlternatesBehavior.SecondOnly:
endings.append(person_ending.get_alternate_ending_if_available())
else: # default: AlernatesBehavior.All
endings.extend(person_ending.get_endings())
# there may be one or more alternate endings
for ending in endings:
compound = False

for person_ending in tense_template.person_endings:
person_ending = self._inflector.modify_person_ending_if_applicable(
person_ending,
mood,
tense,
tense_template,
lang_specific_options,
)
# There will be at least one conjugation per person-ending and
# potentially one or more alternate conjugations
person_conjugation: PersonConjugation = []
endings: List[str] = []
if alternates_behavior == AlternatesBehavior.FirstOnly:
endings.append(person_ending.get_ending())
elif alternates_behavior == AlternatesBehavior.SecondOnly:
endings.append(person_ending.get_alternate_ending_if_available())
else: # default: AlternatesBehavior.All
endings.extend(person_ending.get_endings())
# there may be one or more alternate endings
for ending in endings:
if compound:
# compound conjugation
pronoun = self._inflector.get_default_pronoun(
person=person_ending.get_person(),
gender=gender,
is_reflexive=is_reflexive,
lang_specific_options=lang_specific_options,
)
s = "-"
if ending != "-":
conj = self._inflector.combine_verb_stem_and_ending(
verb_stem, ending
)
s = self._inflector.combine_pronoun_and_conj(pronoun, conj)
if mood == self._inflector.get_subjunctive_mood():
s = self._inflector.add_subjunctive_relative_pronoun(
s, tense
)
else:
# simple conjugation
s = self._inflector.add_present_participle_if_applicable(
"", is_reflexive, tense
)
Expand All @@ -616,53 +641,15 @@ def _conjugate_simple_mood_tense(
)
if ending != "-":
s = self._inflector.add_adverb_if_applicable(s, mood, tense)
person_conjugation.append(s)
if alternates_behavior == AlternatesBehavior.All:
ret.append(list(person_conjugation))
elif (
alternates_behavior == AlternatesBehavior.SecondOnly
and len(person_conjugation) > 1
):
ret.append(person_conjugation[1])
else:
ret.append(person_conjugation[0])
else:
for person_ending in tense_template.person_endings:
person_ending = self._inflector.modify_person_ending_if_applicable(
person_ending,
mood,
tense,
tense_template,
lang_specific_options,
)
# There will be at least one conjugation per person-ending and
# potentially one or more alternate conjugations
person_conjugation: PersonConjugation = []
for ending in person_ending.get_endings():
pronoun = self._inflector.get_default_pronoun(
person=person_ending.get_person(),
gender=gender,
is_reflexive=is_reflexive,
lang_specific_options=lang_specific_options,
)
s = "-"
if ending != "-":
conj = self._inflector.combine_verb_stem_and_ending(
verb_stem, ending
)
s = self._inflector.combine_pronoun_and_conj(pronoun, conj)
if mood == self._inflector.get_subjunctive_mood():
s = self._inflector.add_subjunctive_relative_pronoun(
s, tense
)
person_conjugation.append(s)
if alternates_behavior == AlternatesBehavior.All:
ret.append(list(person_conjugation))
elif (
alternates_behavior == AlternatesBehavior.SecondOnly
and len(person_conjugation) > 1
):
ret.append(person_conjugation[1])
else:
ret.append(person_conjugation[0])
person_conjugation.append(s)
if alternates_behavior == AlternatesBehavior.All:
ret.append(list(person_conjugation))
elif (
alternates_behavior == AlternatesBehavior.SecondOnly
and len(person_conjugation) > 1
):
ret.append(person_conjugation[1])
else:
ret.append(person_conjugation[0])

return ret
6 changes: 3 additions & 3 deletions verbecc/src/inflectors/inflector.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@ def add_reflexive_pronoun(self, s: str) -> str:
def add_subjunctive_relative_pronoun(self, s: str, tense: Tense) -> str:
return s

def auxilary_verb_uses_alternate_conjugation(self, tense: Tense) -> bool:
def auxiliary_verb_uses_alternate_conjugation(self, tense: Tense) -> bool:
return False

def get_tenses_conjugated_without_pronouns(self) -> List[str]:
return []

def get_auxilary_verb(
def get_auxiliary_verb(
self, co: ConjugationObjects, mood: Mood, tense: Tense
) -> str:
return ""

def is_auxilary_verb_inflected(self, auxilary_verb: str) -> bool:
def is_auxiliary_verb_inflected(self, auxiliary_verb: str) -> bool:
return False

def get_infinitive_mood(self) -> Mood:
Expand Down
2 changes: 1 addition & 1 deletion verbecc/src/inflectors/lang/inflector_ca.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_tenses_conjugated_without_pronouns(self) -> List[Tense]:
Tense.ImperatiuPresent,
]

def get_auxilary_verb(
def get_auxiliary_verb(
self,
co: ConjugationObjects,
mood: Mood,
Expand Down
2 changes: 1 addition & 1 deletion verbecc/src/inflectors/lang/inflector_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_tenses_conjugated_without_pronouns(self) -> List[Tense]:
Tense.Negativo,
]

def get_auxilary_verb(
def get_auxiliary_verb(
self,
co: ConjugationObjects,
mood: Mood,
Expand Down
6 changes: 3 additions & 3 deletions verbecc/src/inflectors/lang/inflector_fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def get_tenses_conjugated_without_pronouns(self) -> List[Tense]:
Tense.ParticipePassé,
]

def get_auxilary_verb(
def get_auxiliary_verb(
self,
co: ConjugationObjects,
mood: Mood,
Expand All @@ -160,8 +160,8 @@ def get_auxilary_verb(
ret = "être"
return ret

def is_auxilary_verb_inflected(self, auxilary_verb: str) -> bool:
return auxilary_verb == "être"
def is_auxiliary_verb_inflected(self, auxiliary_verb: str) -> bool:
return auxiliary_verb == "être"

def get_infinitive_mood(self) -> Mood:
return Mood.Infinitif
Expand Down
6 changes: 3 additions & 3 deletions verbecc/src/inflectors/lang/inflector_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def __init__(self) -> None:
def lang(self) -> LangCodeISO639_1:
return LangCodeISO639_1.it

def is_auxilary_verb_inflected(self, auxilary_verb: str) -> bool:
return auxilary_verb == "essere"
def is_auxiliary_verb_inflected(self, auxiliary_verb: str) -> bool:
return auxiliary_verb == "essere"

def split_reflexive(self, infinitive: str) -> Tuple[bool, str]:
"""
Expand Down Expand Up @@ -120,7 +120,7 @@ def get_tenses_conjugated_without_pronouns(self) -> List[Tense]:
Tense.ParticipioPassato,
]

def get_auxilary_verb(
def get_auxiliary_verb(
self, co: ConjugationObjects, mood: Mood, tense: Tense
) -> str:
ret = "avere"
Expand Down
2 changes: 1 addition & 1 deletion verbecc/src/inflectors/lang/inflector_pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get_tenses_conjugated_without_pronouns(self) -> List[Tense]:
Tense.Gerúndio,
]

def get_auxilary_verb(
def get_auxiliary_verb(
self,
co: ConjugationObjects,
mood: Mood,
Expand Down
4 changes: 2 additions & 2 deletions verbecc/src/inflectors/lang/inflector_ro.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_tenses_conjugated_without_pronouns(self) -> List[Tense]:
Tense.Gerunziu,
]

def get_auxilary_verb(
def get_auxiliary_verb(
self, co: ConjugationObjects, mood: Mood, tense: Tense
) -> str:
if tense in (Tense.Viitor1, Tense.Viitor2):
Expand Down Expand Up @@ -130,7 +130,7 @@ def get_compound_conjugations_aux_verb_map(
},
}

def auxilary_verb_uses_alternate_conjugation(self, tense: Tense) -> bool:
def auxiliary_verb_uses_alternate_conjugation(self, tense: Tense) -> bool:
return tense.startswith("viitor")

def compound_primary_verb_conjugation_uses_infinitive(
Expand Down