public class AhoCorasickDoubleArrayTrieSegment extends DictionaryBasedSegment
config, customDictionary| Constructor and Description |
|---|
AhoCorasickDoubleArrayTrieSegment() |
AhoCorasickDoubleArrayTrieSegment(AhoCorasickDoubleArrayTrie<CoreDictionary.Attribute> trie) |
AhoCorasickDoubleArrayTrieSegment(String... dictionaryPaths)
加载自己的词典,构造分词器
|
AhoCorasickDoubleArrayTrieSegment(TreeMap<String,CoreDictionary.Attribute> dictionary) |
| Modifier and Type | Method and Description |
|---|---|
Segment |
enableCustomDictionary(boolean enable)
是否启用用户词典
|
AhoCorasickDoubleArrayTrie<CoreDictionary.Attribute> |
getTrie() |
AhoCorasickDoubleArrayTrieSegment |
loadDictionary(String... pathArray) |
protected List<Term> |
segSentence(char[] sentence)
给一个句子分词
|
void |
setTrie(AhoCorasickDoubleArrayTrie<CoreDictionary.Attribute> trie) |
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 AhoCorasickDoubleArrayTrieSegment()
throws IOException
IOExceptionpublic AhoCorasickDoubleArrayTrieSegment(TreeMap<String,CoreDictionary.Attribute> dictionary)
public AhoCorasickDoubleArrayTrieSegment(AhoCorasickDoubleArrayTrie<CoreDictionary.Attribute> trie)
public AhoCorasickDoubleArrayTrieSegment(String... dictionaryPaths) throws IOException
dictionaryPaths - 任意数量个词典IOException - 加载过程中的IO异常protected List<Term> segSentence(char[] sentence)
SegmentsegSentence in class Segmentsentence - 待分词句子public Segment enableCustomDictionary(boolean enable)
SegmentenableCustomDictionary in class DictionaryBasedSegmentpublic AhoCorasickDoubleArrayTrie<CoreDictionary.Attribute> getTrie()
public void setTrie(AhoCorasickDoubleArrayTrie<CoreDictionary.Attribute> trie)
public AhoCorasickDoubleArrayTrieSegment loadDictionary(String... pathArray)
Copyright © 2014–2021 码农场. All rights reserved.