public class DoubleArrayTrieSegment extends DictionaryBasedSegment
| Modifier and Type | Field and Description |
|---|---|
DoubleArrayTrie<CoreDictionary.Attribute> |
trie
分词用到的trie树,可以直接赋值为自己的trie树(赋值操作不保证线程安全)
|
config, customDictionary| Constructor and Description |
|---|
DoubleArrayTrieSegment()
使用核心词库的trie树构造分词器
|
DoubleArrayTrieSegment(DoubleArrayTrie<CoreDictionary.Attribute> trie)
根据自己的trie树构造分词器
|
DoubleArrayTrieSegment(String... dictionaryPaths)
加载自己的词典,构造分词器
|
| Modifier and Type | Method and Description |
|---|---|
protected List<Term> |
segSentence(char[] sentence)
给一个句子分词
|
enableCustomDictionary, enablePartOfSpeechTagging, posTagatomSegment, combineByCustomDictionary, combineByCustomDictionary, combineByCustomDictionary, combineByCustomDictionary, convert, enableAllNamedEntityRecognize, enableCustomDictionary, enableCustomDictionaryForcing, enableIndexMode, enableIndexMode, enableJapaneseNameRecognize, enableMultithreading, enableMultithreading, enableNameRecognize, enableNumberQuantifierRecognize, enableOffset, enableOrganizationRecognize, enablePlaceRecognize, enableTranslatedNameRecognize, mergeNumberQuantifier, quickAtomSegment, seg, seg, seg2sentence, seg2sentence, simpleAtomSegmentpublic DoubleArrayTrie<CoreDictionary.Attribute> trie
public DoubleArrayTrieSegment()
public DoubleArrayTrieSegment(DoubleArrayTrie<CoreDictionary.Attribute> trie)
trie - public DoubleArrayTrieSegment(String... dictionaryPaths) throws IOException
dictionaryPaths - 任意数量个词典IOException - 加载过程中的IO异常protected List<Term> segSentence(char[] sentence)
SegmentsegSentence in class Segmentsentence - 待分词句子Copyright © 2014–2021 码农场. All rights reserved.