Skip to content

Commit

Permalink
Add test cases for splitting errors on continual typos
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed Oct 15, 2024
1 parent f854d81 commit e4d6f86
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,18 @@ TEST(KiwiCpp, SingleConsonantMorpheme)
EXPECT_EQ(res[0].str, u"서툴");
}

TEST(KiwiCpp, SpecialTokenErrorOnContinualTypo)
{
KiwiBuilder builder{ MODEL_PATH, 0, BuildOption::default_, };
Kiwi typoKiwi = builder.build(DefaultTypoSet::continualTypoSet);

auto res = typoKiwi.analyze(u"감사합니다 -친구들과", Match::allWithNormalizing).first;
EXPECT_EQ(res[0].str, u"감사");
EXPECT_EQ(res[1].str, u"");
EXPECT_EQ(res[3].str, u"-");
EXPECT_EQ(res[3].tag, POSTag::so);
}

TEST(KiwiCpp, SplitComplex)
{
Kiwi& kiwi = reuseKiwiInstance();
Expand Down

0 comments on commit e4d6f86

Please sign in to comment.