Skip to content

Commit

Permalink
Update test case for emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed May 19, 2024
1 parent bb63bb3 commit 84406ed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/test_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,17 @@ TEST(KiwiCpp, OldHangul)
TEST(KiwiCpp, ChineseVsEmoji)
{
Kiwi& kiwi = reuseKiwiInstance();
auto res = kiwi.analyze(u"韓𠀀𠀁𠀂𠀃🔥🤔🐶", Match::allWithNormalizing).first;
auto res = kiwi.analyze(u"韓𠀀𠀁𠀂𠀃🔥🤔🐶", Match::allWithNormalizing & ~Match::emoji).first;
EXPECT_EQ(res.size(), 2);
EXPECT_EQ(res[0].tag, POSTag::sh);
EXPECT_EQ(res[1].tag, POSTag::sw);

res = kiwi.analyze(u"韓𠀀𠀁𠀂𠀃🔥🤔🐶", Match::allWithNormalizing).first;
EXPECT_EQ(res.size(), 4);
EXPECT_EQ(res[0].tag, POSTag::sh);
EXPECT_EQ(res[1].tag, POSTag::w_emoji);
EXPECT_EQ(res[2].tag, POSTag::w_emoji);
EXPECT_EQ(res[3].tag, POSTag::w_emoji);
}

TEST(KiwiCpp, Script)
Expand Down

0 comments on commit 84406ed

Please sign in to comment.