修改QuerySegment的构造函数参数顺序

This commit is contained in:
yanyiwu 2015-06-05 16:23:51 +08:00
parent 45588b75cc
commit a3d9b40c2a
2 changed files with 3 additions and 4 deletions

View File

@ -16,8 +16,7 @@
namespace CppJieba {
class QuerySegment: public SegmentBase {
public:
QuerySegment(const string& dict, const string& model, size_t maxWordLen = 4,
const string& userDict = "")
QuerySegment(const string& dict, const string& model, const string& userDict = "", size_t maxWordLen = 4)
: mixSeg_(dict, model, userDict),
fullSeg_(mixSeg_.getDictTrie()),
maxWordLen_(maxWordLen) {

View File

@ -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("../dict/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", 3, "../test/testdata/userdict.utf8");
QuerySegment segment("../dict/extra_dict/jieba.dict.small.utf8", "../dict/hmm_model.utf8", "../test/testdata/userdict.utf8", 3);
{
const char* str = "小明硕士毕业于中国科学院计算所,后在日本京都大学深造";