mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
把dict/{extra_dict,gbk_dict} 挪进 test/testdata
This commit is contained in:
parent
a3d9b40c2a
commit
e5d1ac7bc8
@ -4,7 +4,7 @@
|
||||
using namespace CppJieba;
|
||||
|
||||
TEST(KeywordExtractorTest, Test1) {
|
||||
KeywordExtractor extractor("../dict/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../dict/idf.utf8", "../dict/stop_words.utf8");
|
||||
KeywordExtractor extractor("../test/testdata/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../dict/idf.utf8", "../dict/stop_words.utf8");
|
||||
|
||||
{
|
||||
string s("我是拖拉机学院手扶拖拉机专业的。不用多久,我就会升职加薪,当上CEO,走上人生巅峰。");
|
||||
@ -28,7 +28,7 @@ TEST(KeywordExtractorTest, Test1) {
|
||||
}
|
||||
|
||||
TEST(KeywordExtractorTest, Test2) {
|
||||
KeywordExtractor extractor("../dict/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../dict/idf.utf8", "../dict/stop_words.utf8", "../test/testdata/userdict.utf8");
|
||||
KeywordExtractor extractor("../test/testdata/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../dict/idf.utf8", "../dict/stop_words.utf8", "../test/testdata/userdict.utf8");
|
||||
|
||||
{
|
||||
string s("蓝翔优秀毕业生");
|
||||
|
@ -23,7 +23,7 @@ TEST(MixSegmentTest, Test1) {
|
||||
}
|
||||
|
||||
TEST(MixSegmentTest, NoUserDict) {
|
||||
MixSegment segment("../dict/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8");
|
||||
MixSegment segment("../test/testdata/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8");
|
||||
const char* str = "令狐冲是云计算方面的专家";
|
||||
vector<string> words;
|
||||
ASSERT_TRUE(segment.cut(str, words));
|
||||
@ -32,7 +32,7 @@ TEST(MixSegmentTest, NoUserDict) {
|
||||
|
||||
}
|
||||
TEST(MixSegmentTest, UserDict) {
|
||||
MixSegment segment("../dict/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../dict/user.dict.utf8");
|
||||
MixSegment segment("../test/testdata/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../dict/user.dict.utf8");
|
||||
{
|
||||
const char* str = "令狐冲是云计算方面的专家";
|
||||
vector<string> words;
|
||||
@ -58,7 +58,7 @@ TEST(MixSegmentTest, UserDict) {
|
||||
}
|
||||
}
|
||||
TEST(MixSegmentTest, UserDict2) {
|
||||
MixSegment segment("../dict/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../test/testdata/userdict.utf8");
|
||||
MixSegment segment("../test/testdata/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../test/testdata/userdict.utf8");
|
||||
{
|
||||
const char* str = "令狐冲是云计算方面的专家";
|
||||
vector<string> words;
|
||||
@ -102,7 +102,7 @@ TEST(MPSegmentTest, Test1) {
|
||||
}
|
||||
|
||||
TEST(MPSegmentTest, Test2) {
|
||||
MPSegment segment("../dict/extra_dict/jieba.dict.small.utf8");
|
||||
MPSegment segment("../test/testdata/extra_dict/jieba.dict.small.utf8");
|
||||
string line;
|
||||
ifstream ifs("../test/testdata/review.100");
|
||||
vector<string> words;
|
||||
@ -150,7 +150,7 @@ TEST(HMMSegmentTest, Test1) {
|
||||
}
|
||||
|
||||
TEST(FullSegment, Test1) {
|
||||
FullSegment segment("../dict/extra_dict/jieba.dict.small.utf8");
|
||||
FullSegment segment("../test/testdata/extra_dict/jieba.dict.small.utf8");
|
||||
const char* str = "我来自北京邮电大学";
|
||||
vector<string> words;
|
||||
|
||||
@ -162,7 +162,7 @@ TEST(FullSegment, Test1) {
|
||||
}
|
||||
|
||||
TEST(QuerySegment, Test1) {
|
||||
QuerySegment segment("../dict/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "", 3);
|
||||
QuerySegment segment("../test/testdata/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "", 3);
|
||||
const char* str = "小明硕士毕业于中国科学院计算所,后在日本京都大学深造";
|
||||
vector<string> words;
|
||||
|
||||
@ -176,7 +176,7 @@ TEST(QuerySegment, Test1) {
|
||||
}
|
||||
|
||||
TEST(QuerySegment, Test2) {
|
||||
QuerySegment segment("../dict/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../test/testdata/userdict.utf8", 3);
|
||||
QuerySegment segment("../test/testdata/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../test/testdata/userdict.utf8", 3);
|
||||
|
||||
{
|
||||
const char* str = "小明硕士毕业于中国科学院计算所,后在日本京都大学深造";
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
using namespace CppJieba;
|
||||
|
||||
static const char* const DICT_FILE = "../dict/extra_dict/jieba.dict.small.utf8";
|
||||
static const char* const DICT_FILE = "../test/testdata/extra_dict/jieba.dict.small.utf8";
|
||||
|
||||
TEST(DictTrieTest, NewAndDelete) {
|
||||
DictTrie * trie;
|
||||
|
Loading…
x
Reference in New Issue
Block a user