From c6f01c7e12d2987ff30967379cf98e522d3fcbc8 Mon Sep 17 00:00:00 2001 From: bel_shazzar Date: Thu, 19 May 2022 19:45:54 +0200 Subject: [PATCH] Accept kuru as kanji --- src/Utils.py | 9 +++++++-- src/constants/VerbEndingConstants.py | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Utils.py b/src/Utils.py index 8507418..dd370c2 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -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) @@ -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): diff --git a/src/constants/VerbEndingConstants.py b/src/constants/VerbEndingConstants.py index 5eb2334..b0dd5c3 100644 --- a/src/constants/VerbEndingConstants.py +++ b/src/constants/VerbEndingConstants.py @@ -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 = "ます"