Skip to content

Commit

Permalink
Add test case for #175
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed Sep 8, 2024
1 parent afad6b6 commit 4b31b54
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/test_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,27 @@ TEST(KiwiCpp, JoinAffix)
EXPECT_EQ(res5.first[5].str, u"배송되");
}

TEST(KiwiCpp, CompatibleJamo)
{
Kiwi& kiwi = reuseKiwiInstance();
auto res1 = kiwi.analyze(u"이긴다. 이김. 이길것.", Match::none).first;
EXPECT_EQ(res1.size(), 10);
EXPECT_EQ(res1[1].str, u"ᆫ다");
EXPECT_EQ(res1[4].str, u"");
EXPECT_EQ(res1[7].str, u"");

auto res2 = kiwi.analyze(u"이긴다. 이김. 이길것.", Match::compatibleJamo).first;
EXPECT_EQ(res2.size(), 10);
EXPECT_EQ(res2[1].str, u"ㄴ다");
EXPECT_EQ(res2[4].str, u"");
EXPECT_EQ(res2[7].str, u"");

auto res3 = kiwi.analyze(u"ᄀᄁᄂᄃᄄᄅᄆᄇᄈᄉᄊᄋᄌᄍᄎᄏᄐᄑᄒ ᆨᆩᆪᆫᆬᆭᆮᆯᆰᆱᆲᆳᆴᆵᆶᆷᆸᆹᆺᆻᆼᆽᆾᆿᇀᇁᇂ", Match::compatibleJamo).first;
EXPECT_EQ(res3.size(), 2);
EXPECT_EQ(res3[0].str, u"ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ");
EXPECT_EQ(res3[1].str, u"ㄱㄲㄳㄴㄵㄶㄷㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅄㅅㅆㅇㅈㅊㅋㅌㅍㅎ");
}

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

0 comments on commit 4b31b54

Please sign in to comment.