add SetQuerySegmentThreshold in Jieba

This commit is contained in:
yanyiwu 2015-10-29 15:28:10 +08:00
parent c3fd357a6d
commit 8fe4de404e
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,8 @@
## next version ## next version
1. QuerySegment切词时加一层判断当长词满足IsAllAscii(比如英文单词)时,不进行细粒度分词。 1. QuerySegment切词时加一层判断当长词满足IsAllAscii(比如英文单词)时,不进行细粒度分词。
2. QuerySegment新增SetMaxWordLen和GetMaxWordLen接口。 2. QuerySegment新增SetMaxWordLen和GetMaxWordLen接口用来设置二次分词条件被触发的词长阈值。
3. Jieba新增SetQuerySegmentThreshold设置CutForSearch函数的词长阈值。
## v4.0.0 ## v4.0.0

View File

@ -53,7 +53,10 @@ class Jieba {
const HMMModel* GetHMMModel() const { const HMMModel* GetHMMModel() const {
return &model_; return &model_;
} }
void SetQuerySegmentThreshold(size_t len) {
query_seg_.SetMaxWordLen(len);
}
private: private:
DictTrie dict_trie_; DictTrie dict_trie_;
HMMModel model_; HMMModel model_;