Class EnglishSynthesizer

  • All Implemented Interfaces:
    org.languagetool.synthesis.Synthesizer

    public class EnglishSynthesizer
    extends org.languagetool.synthesis.BaseSynthesizer
    English word form synthesizer. Based on part-of-speech lists in Public Domain. See readme.txt for details, the POS tagset is described in tagset.txt. There are to special additions:
    1. +DT - tag that adds "a" or "an" (according to the way the word is pronounced) and "the"
    2. +INDT - a tag that adds only "a" or "an"
    • Constructor Summary

      Constructors 
      Constructor Description
      EnglishSynthesizer​(org.languagetool.Language lang)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void lookup​(java.lang.String lemma, java.lang.String posTag, java.util.List<java.lang.String> results, java.lang.String determiner)  
      java.lang.String[] synthesize​(org.languagetool.AnalyzedToken token, java.lang.String posTag)
      Get a form of a given AnalyzedToken, where the form is defined by a part-of-speech tag.
      java.lang.String[] synthesize​(org.languagetool.AnalyzedToken token, java.lang.String posTag, boolean posTagRegExp)
      Special English regexp based synthesizer that allows adding articles when the regexp-based tag ends with a special signature \\+INDT or \\+DT.
      • Methods inherited from class org.languagetool.synthesis.BaseSynthesizer

        createStemmer, getDictionary, getPosTagCorrection, getSpelledNumber, getStemmer, initPossibleTags, lookup
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EnglishSynthesizer

        public EnglishSynthesizer​(org.languagetool.Language lang)
    • Method Detail

      • synthesize

        public java.lang.String[] synthesize​(org.languagetool.AnalyzedToken token,
                                             java.lang.String posTag)
                                      throws java.io.IOException
        Get a form of a given AnalyzedToken, where the form is defined by a part-of-speech tag.
        Specified by:
        synthesize in interface org.languagetool.synthesis.Synthesizer
        Overrides:
        synthesize in class org.languagetool.synthesis.BaseSynthesizer
        Parameters:
        token - AnalyzedToken to be inflected.
        posTag - A desired part-of-speech tag.
        Returns:
        String value - inflected word.
        Throws:
        java.io.IOException
      • synthesize

        public java.lang.String[] synthesize​(org.languagetool.AnalyzedToken token,
                                             java.lang.String posTag,
                                             boolean posTagRegExp)
                                      throws java.io.IOException
        Special English regexp based synthesizer that allows adding articles when the regexp-based tag ends with a special signature \\+INDT or \\+DT.
        Specified by:
        synthesize in interface org.languagetool.synthesis.Synthesizer
        Overrides:
        synthesize in class org.languagetool.synthesis.BaseSynthesizer
        Throws:
        java.io.IOException
        Since:
        2.5
      • lookup

        private void lookup​(java.lang.String lemma,
                            java.lang.String posTag,
                            java.util.List<java.lang.String> results,
                            java.lang.String determiner)