Interface Disambiguator
- All Known Implementing Classes:
AbstractDisambiguator,ArabicHybridDisambiguator,CatalanHybridDisambiguator,DemoDisambiguator,DutchHybridDisambiguator,EnglishHybridDisambiguator,FrenchHybridDisambiguator,GalicianHybridDisambiguator,GermanRuleDisambiguator,IrishHybridDisambiguator,ItalianRuleDisambiguator,MultiWordChunker,MultiWordChunker2,NoopDisambiguator,PolishHybridDisambiguator,PortugueseHybridDisambiguator,RussianHybridDisambiguator,SpanishHybridDisambiguator,SwedishHybridDisambiguator,UkrainianHybridDisambiguator,UkrainianMultiwordChunker,XmlRuleDisambiguator
public interface Disambiguator
Disambiguator interface. Particular implementations are language-dependent.
The POS tagger might assign multiple tags to the token. The goal is to filter out the incorrect tags and leave ideally only one per token.
-
Method Summary
Modifier and TypeMethodDescriptiondisambiguate(AnalyzedSentence input) If possible, filters out the wrong POS tags.default AnalyzedSentencedisambiguate(AnalyzedSentence input, JLanguageTool.CheckCancelledCallback checkCanceled) The same asdisambiguate(AnalyzedSentence), but may callcheckCanceled(if it's non-null) to allow for better interruptibility.preDisambiguate(AnalyzedSentence input) If possible, filters out the wrong POS tags.
-
Method Details
-
preDisambiguate
If possible, filters out the wrong POS tags. This code will run before disambiguation rules from xml are called. This allows to have some initial disambiguation logic in Java.- Parameters:
input- The sentence with already tagged words. The words are expected to have multiple tags.- Returns:
- Analyzed sentence, where each word has only one (possibly the most correct) tag.
- Since:
- 3.7
-
disambiguate
If possible, filters out the wrong POS tags.- Parameters:
input- The sentence with already tagged words. The words are expected to have multiple tags.- Returns:
- Analyzed sentence, where each word has only one (possibly the most correct) tag.
- Throws:
IOException
-
disambiguate
default AnalyzedSentence disambiguate(AnalyzedSentence input, @Nullable JLanguageTool.CheckCancelledCallback checkCanceled) throws IOException The same asdisambiguate(AnalyzedSentence), but may callcheckCanceled(if it's non-null) to allow for better interruptibility.- Throws:
IOException
-