Class XmlRuleDisambiguator

    • Constructor Detail

      • XmlRuleDisambiguator

        public XmlRuleDisambiguator​(Language language)
    • Method Detail

      • disambiguate

        public AnalyzedSentence disambiguate​(AnalyzedSentence input)
                                      throws java.io.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:
        java.io.IOException
      • loadPatternRules

        protected java.util.List<DisambiguationPatternRule> loadPatternRules​(java.lang.String filename)
                                                                      throws javax.xml.parsers.ParserConfigurationException,
                                                                             org.xml.sax.SAXException,
                                                                             java.io.IOException
        Load disambiguation rules from an XML file. Use JLanguageTool.addRule(org.languagetool.rules.Rule) to add these rules to the checking process.
        Returns:
        a List of DisambiguationPatternRule objects
        Throws:
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
        java.io.IOException