Package com.yahoo.language.opennlp
Class OpenNlpLinguistics
- java.lang.Object
-
- com.yahoo.language.simple.SimpleLinguistics
-
- com.yahoo.language.opennlp.OpenNlpLinguistics
-
- All Implemented Interfaces:
Linguistics
public class OpenNlpLinguistics extends SimpleLinguistics
Returns a linguistics implementation based on OpenNlp, and (optionally, default on) Optimaize for language detection.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.yahoo.language.Linguistics
Linguistics.Component
-
-
Constructor Summary
Constructors Constructor Description OpenNlpLinguistics()
OpenNlpLinguistics(boolean enableOptimaize)
OpenNlpLinguistics(OpennlpLinguisticsConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Detector
getDetector()
Returns a thread-unsafe detector.Tokenizer
getTokenizer()
Returns a thread-unsafe tokenizer.-
Methods inherited from class com.yahoo.language.simple.SimpleLinguistics
getCharacterClasses, getGramSplitter, getNormalizer, getSegmenter, getStemmer, getTransformer
-
-
-
-
Constructor Detail
-
OpenNlpLinguistics
public OpenNlpLinguistics()
-
OpenNlpLinguistics
@Inject public OpenNlpLinguistics(OpennlpLinguisticsConfig config)
-
OpenNlpLinguistics
public OpenNlpLinguistics(boolean enableOptimaize)
-
-
Method Detail
-
getTokenizer
public Tokenizer getTokenizer()
Description copied from interface:Linguistics
Returns a thread-unsafe tokenizer. This is used at indexing time to produce a optionally stemmed and transformed (accent normalized) stream of indexable tokens.- Specified by:
getTokenizer
in interfaceLinguistics
- Overrides:
getTokenizer
in classSimpleLinguistics
-
getDetector
public Detector getDetector()
Description copied from interface:Linguistics
Returns a thread-unsafe detector. The language of the text is a parameter to other linguistic operations. This is used to determine the language of a query or document field when not specified explicitly.- Specified by:
getDetector
in interfaceLinguistics
- Overrides:
getDetector
in classSimpleLinguistics
-
-