把dict/{extra_dict,gbk_dict} 挪进 test/testdata

This commit is contained in:
yanyiwu 2015-06-05 16:31:43 +08:00
parent a3d9b40c2a
commit e5d1ac7bc8
6 changed files with 10 additions and 10 deletions

View File

@ -4,7 +4,7 @@
using namespace CppJieba; using namespace CppJieba;
TEST(KeywordExtractorTest, Test1) { 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走上人生巅峰。"); string s("我是拖拉机学院手扶拖拉机专业的。不用多久我就会升职加薪当上CEO走上人生巅峰。");
@ -28,7 +28,7 @@ TEST(KeywordExtractorTest, Test1) {
} }
TEST(KeywordExtractorTest, Test2) { 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("蓝翔优秀毕业生"); string s("蓝翔优秀毕业生");

View File

@ -23,7 +23,7 @@ TEST(MixSegmentTest, Test1) {
} }
TEST(MixSegmentTest, NoUserDict) { 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 = "令狐冲是云计算方面的专家"; const char* str = "令狐冲是云计算方面的专家";
vector<string> words; vector<string> words;
ASSERT_TRUE(segment.cut(str, words)); ASSERT_TRUE(segment.cut(str, words));
@ -32,7 +32,7 @@ TEST(MixSegmentTest, NoUserDict) {
} }
TEST(MixSegmentTest, UserDict) { 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 = "令狐冲是云计算方面的专家"; const char* str = "令狐冲是云计算方面的专家";
vector<string> words; vector<string> words;
@ -58,7 +58,7 @@ TEST(MixSegmentTest, UserDict) {
} }
} }
TEST(MixSegmentTest, UserDict2) { 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 = "令狐冲是云计算方面的专家"; const char* str = "令狐冲是云计算方面的专家";
vector<string> words; vector<string> words;
@ -102,7 +102,7 @@ TEST(MPSegmentTest, Test1) {
} }
TEST(MPSegmentTest, Test2) { TEST(MPSegmentTest, Test2) {
MPSegment segment("../dict/extra_dict/jieba.dict.small.utf8"); MPSegment segment("../test/testdata/extra_dict/jieba.dict.small.utf8");
string line; string line;
ifstream ifs("../test/testdata/review.100"); ifstream ifs("../test/testdata/review.100");
vector<string> words; vector<string> words;
@ -150,7 +150,7 @@ TEST(HMMSegmentTest, Test1) {
} }
TEST(FullSegment, 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 = "我来自北京邮电大学"; const char* str = "我来自北京邮电大学";
vector<string> words; vector<string> words;
@ -162,7 +162,7 @@ TEST(FullSegment, Test1) {
} }
TEST(QuerySegment, 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 = "小明硕士毕业于中国科学院计算所,后在日本京都大学深造"; const char* str = "小明硕士毕业于中国科学院计算所,后在日本京都大学深造";
vector<string> words; vector<string> words;
@ -176,7 +176,7 @@ TEST(QuerySegment, Test1) {
} }
TEST(QuerySegment, Test2) { 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 = "小明硕士毕业于中国科学院计算所,后在日本京都大学深造"; const char* str = "小明硕士毕业于中国科学院计算所,后在日本京都大学深造";

View File

@ -4,7 +4,7 @@
using namespace CppJieba; 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) { TEST(DictTrieTest, NewAndDelete) {
DictTrie * trie; DictTrie * trie;