mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
ci TKeywordExtractor.cpp to fix bug which test in x64 and x86 not the same
This commit is contained in:
parent
c74ca2b458
commit
a7f4e18027
@ -8,11 +8,11 @@ using namespace CppJieba;
|
|||||||
TEST(KeywordExtractorTest, Test1)
|
TEST(KeywordExtractorTest, Test1)
|
||||||
{
|
{
|
||||||
KeywordExtractor extractor("../dict/jieba.dict.utf8", "../dict/hmm_model.utf8", "../dict/idf.utf8");
|
KeywordExtractor extractor("../dict/jieba.dict.utf8", "../dict/hmm_model.utf8", "../dict/idf.utf8");
|
||||||
string s("我是蓝翔技工拖拉机学院手扶拖拉机专业的。不用多久,我就会升职加薪,当上总经理,出任CEO,迎娶白富美,走上人生巅峰。");
|
string s("我是拖拉机学院手扶拖拉机专业的。不用多久,我就会升职加薪,当上总经理,迎娶白富美,走上人生巅峰。");
|
||||||
string res;
|
string res;
|
||||||
vector<pair<string, double> > wordweights;
|
vector<pair<string, double> > wordweights;
|
||||||
size_t topN = 5;
|
size_t topN = 5;
|
||||||
extractor.extract(s, wordweights, topN);
|
extractor.extract(s, wordweights, topN);
|
||||||
res << wordweights;
|
res << wordweights;
|
||||||
ASSERT_EQ(res, "[\"CEO:11.7392\", \"蓝翔:11.7392\", \"白富美:11.7392\", \"升职:10.8562\", \"加薪:10.6426\"]");
|
ASSERT_EQ(res, "[\"白富美:11.7392\", \"升职:10.8562\", \"加薪:10.6426\", \"迎娶:10.0505\", \"手扶拖拉机:10.0089\"]");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user