Class XmlRuleDisambiguator
- java.lang.Object
-
- org.languagetool.tagging.disambiguation.AbstractDisambiguator
-
- org.languagetool.tagging.disambiguation.rules.XmlRuleDisambiguator
-
- All Implemented Interfaces:
Disambiguator
public class XmlRuleDisambiguator extends AbstractDisambiguator
Rule-based disambiguator. Implements an idea by Agnes Souque.- Author:
- Marcin MiĆkowski
-
-
Constructor Summary
Constructors Constructor Description XmlRuleDisambiguator(Language language)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnalyzedSentence
disambiguate(AnalyzedSentence input)
If possible, filters out the wrong POS tags.protected List<DisambiguationPatternRule>
loadPatternRules(String filename)
Load disambiguation rules from an XML file.-
Methods inherited from class org.languagetool.tagging.disambiguation.AbstractDisambiguator
preDisambiguate
-
-
-
-
Constructor Detail
-
XmlRuleDisambiguator
public XmlRuleDisambiguator(Language language)
-
-
Method Detail
-
disambiguate
public AnalyzedSentence disambiguate(AnalyzedSentence input) throws IOException
Description copied from interface:Disambiguator
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
-
loadPatternRules
protected List<DisambiguationPatternRule> loadPatternRules(String filename) throws ParserConfigurationException, SAXException, IOException
Load disambiguation rules from an XML file. UseJLanguageTool.addRule(org.languagetool.rules.Rule)
to add these rules to the checking process.- Returns:
- a List of
DisambiguationPatternRule
objects - Throws:
ParserConfigurationException
SAXException
IOException
-
-