mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
修改QuerySegment的构造函数参数顺序
This commit is contained in:
parent
45588b75cc
commit
a3d9b40c2a
@ -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) {
|
||||
|
@ -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 = "小明硕士毕业于中国科学院计算所,后在日本京都大学深造";
|
||||
|
Loading…
x
Reference in New Issue
Block a user