Skip to content

Commit

Permalink
enable to get fkt from last
Browse files Browse the repository at this point in the history
  • Loading branch information
sadahry committed Nov 19, 2022
1 parent 30c1e0c commit 2794d19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions katsuyo_text/spacy_sentence_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ def convert(self, sent: spacy.tokens.Span) -> str:
continue

if prev_kt is not None:
if isinstance(prev_kt, KatsuyoText):
prev_kt = self._bridge_by_form(prev_kt, prev_token)
result += str(prev_kt)
else:
assert prev_token is not None
Expand Down
8 changes: 8 additions & 0 deletions tests/test_spacy_sentence_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ def test_convert_dantei_teinei(nlp_ja, msg, sentence, convertions_dict, expected
},
"怒った",
),
(
"Contexual Suffix",
"怒られろ",
{
Ukemi(): None,
},
"怒れ",
),
],
)
def test_convert_contextual(nlp_ja, msg, sentence, convertions_dict, expected):
Expand Down

0 comments on commit 2794d19

Please # to comment.