Skip to content

Commit

Permalink
added test cases for bab2min/kiwipiepy#131
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed Aug 20, 2023
1 parent 88157c9 commit 2cddd46
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/test_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,30 @@ TEST(KiwiCpp, IssueP111_SentenceSplitError)
EXPECT_EQ(res.size(), res2.size());
}

TEST(KiwiCpp, IssueP131_SentenceSplitError)
{
const char16_t* text[] = {
u"특파원입니다. --지난",
u"특파원입니다.\n--지난",
u"특파원입니다.-- 지난",
};
Kiwi& kiwi = reuseKiwiInstance();
auto res = kiwi.splitIntoSents(text[0]);
EXPECT_EQ(res.size(), 2);
EXPECT_EQ(res[0], std::make_pair(0, 7));
EXPECT_EQ(res[1], std::make_pair(8, 12));

res = kiwi.splitIntoSents(text[1]);
EXPECT_EQ(res.size(), 2);
EXPECT_EQ(res[0], std::make_pair(0, 7));
EXPECT_EQ(res[1], std::make_pair(8, 12));

res = kiwi.splitIntoSents(text[2]);
EXPECT_EQ(res.size(), 2);
EXPECT_EQ(res[0], std::make_pair(0, 9));
EXPECT_EQ(res[1], std::make_pair(10, 12));
}

TEST(KiwiCpp, AddRule)
{
Kiwi& okiwi = reuseKiwiInstance();
Expand Down

0 comments on commit 2cddd46

Please sign in to comment.