public class XmlRuleDisambiguator extends AbstractDisambiguator
Constructor and Description |
---|
XmlRuleDisambiguator(Language language) |
XmlRuleDisambiguator(Language language,
boolean useGlobalDisambiguation) |
Modifier and Type | Method and Description |
---|---|
AnalyzedSentence |
disambiguate(AnalyzedSentence input)
If possible, filters out the wrong POS tags.
|
AnalyzedSentence |
disambiguate(AnalyzedSentence sentence,
JLanguageTool.CheckCancelledCallback checkCanceled)
The same as
Disambiguator.disambiguate(AnalyzedSentence) ,
but may call checkCanceled (if it's non-null) to allow for better interruptibility. |
protected List<DisambiguationPatternRule> |
loadPatternRules(String filename)
Load disambiguation rules from an XML file.
|
preDisambiguate
public XmlRuleDisambiguator(Language language)
public XmlRuleDisambiguator(Language language, boolean useGlobalDisambiguation)
public AnalyzedSentence disambiguate(AnalyzedSentence input) throws IOException
Disambiguator
input
- The sentence with already tagged words. The words are expected to
have multiple tags.IOException
public AnalyzedSentence disambiguate(AnalyzedSentence sentence, @Nullable JLanguageTool.CheckCancelledCallback checkCanceled) throws IOException
Disambiguator
Disambiguator.disambiguate(AnalyzedSentence)
,
but may call checkCanceled
(if it's non-null) to allow for better interruptibility.IOException
protected List<DisambiguationPatternRule> loadPatternRules(String filename) throws ParserConfigurationException, SAXException, IOException
JLanguageTool.addRule(org.languagetool.rules.Rule)
to add these rules to the checking process.DisambiguationPatternRule
objectsParserConfigurationException
SAXException
IOException