Skip to content

Commit

Permalink
Merge pull request #1 from Bel-Shazzar/kanji_kuru
Browse files Browse the repository at this point in the history
Accept kuru as kanji
  • Loading branch information
Bel-Shazzar authored May 19, 2022
2 parents 07f1de7 + c6f01c7 commit b74d1ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def handle_irregular_verb(verb, append_stem_particle=False, suru_ending=None, ku
on verb conjugation
'''
particle_ending = splice_verb(verb, VerbClass.IRREGULAR, False)
if particle_ending not in [SURU_ENDING, KURU_ENDING]:
if particle_ending not in [SURU_ENDING, KURU_ENDING, KURU_KANJI_ENDING]:
return None

verb_stem = splice_verb(verb, VerbClass.IRREGULAR)
Expand All @@ -58,11 +58,16 @@ def handle_irregular_verb(verb, append_stem_particle=False, suru_ending=None, ku
ending = SHI_PARTICLE
if suru_ending is not None:
ending = "{}{}".format(ending, suru_ending)
else:
elif particle_ending == KURU_ENDING:
if append_stem_particle:
ending = KI_PARTICLE
if kuru_ending is not None:
ending = "{}{}".format(ending, kuru_ending)
else:
if append_stem_particle:
ending = KURU_KANJI
if kuru_ending is not None:
ending = "{}{}".format(ending, kuru_ending)
return "{}{}".format(verb_stem, ending)

def generate_nai_form(verb, verb_class, is_regular_nai):
Expand Down
2 changes: 2 additions & 0 deletions src/constants/VerbEndingConstants.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from .EnumeratedTypes import Formality, Polarity, Tense, VerbClass

KUDASAI = "ください"
KURU_KANJI = "来"

# IRREGULAR VERB ENDINGS
SURU_ENDING = "する"
KURU_ENDING = "くる"
KURU_KANJI_ENDING = "来る"

# (POLITE) MASU FORM ENDINGS
MASU_POSITIVE_NONPAST = "ます"
Expand Down

0 comments on commit b74d1ca

Please sign in to comment.