com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment Java Examples
The following examples show how to use
com.hankcs.hanlp.seg.Dijkstra.DijkstraSegment.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HanLPTokenizerFactory.java From elasticsearch-analysis-hanlp with Apache License 2.0 | 5 votes |
public static HanLPTokenizerFactory createShortest(IndexSettings indexSettings, Environment environment, String name, Settings settings) { return new HanLPTokenizerFactory(indexSettings, environment, name, settings) { @Override public Tokenizer create() { Segment seg = new DijkstraSegment().enableCustomDictionary(false) .enablePlaceRecognize(true) .enableOrganizationRecognize(true); return new HanLPTokenizer(seg, defaultStopWordDictionary, enablePorterStemming); } }; }
Example #2
Source File: HanLPDijkstraAnalyzer.java From elasticsearch-analysis-hanlp with Apache License 2.0 | 4 votes |
@Override protected Analyzer.TokenStreamComponents createComponents(String fieldName) { return new Analyzer.TokenStreamComponents(TokenizerBuilder.tokenizer( AccessController.doPrivileged((PrivilegedAction<Segment>)() -> new DijkstraSegment().enableCustomDictionary( false).enablePlaceRecognize(true).enableOrganizationRecognize(true)), configuration)); }