Package org.languagetool.synthesis.en
Class EnglishSynthesizer
java.lang.Object
org.languagetool.synthesis.BaseSynthesizer
org.languagetool.synthesis.en.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:
- +DT - tag that adds "a" or "an" (according to the way the word is pronounced) and "the"
- +INDT - a tag that adds only "a" or "an"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private final AvsAnRule
private static final String
private static final String
Fields inherited from class org.languagetool.synthesis.BaseSynthesizer
possibleTags, SPELLNUMBER_TAG
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
String[]
synthesize
(org.languagetool.AnalyzedToken token, String posTag) Get a form of a given AnalyzedToken, where the form is defined by a part-of-speech tag.String[]
synthesize
(org.languagetool.AnalyzedToken token, 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
-
Field Details
-
RESOURCE_FILENAME
- See Also:
-
TAGS_FILE_NAME
- See Also:
-
ADD_DETERMINER
- See Also:
-
ADD_IND_DETERMINER
- See Also:
-
aVsAnRule
-
-
Constructor Details
-
EnglishSynthesizer
public EnglishSynthesizer(org.languagetool.Language lang)
-
-
Method Details
-
synthesize
Get a form of a given AnalyzedToken, where the form is defined by a part-of-speech tag.- Specified by:
synthesize
in interfaceorg.languagetool.synthesis.Synthesizer
- Overrides:
synthesize
in classorg.languagetool.synthesis.BaseSynthesizer
- Parameters:
token
- AnalyzedToken to be inflected.posTag
- A desired part-of-speech tag.- Returns:
- String value - inflected word.
- Throws:
IOException
-
synthesize
public String[] synthesize(org.languagetool.AnalyzedToken token, String posTag, boolean posTagRegExp) throws 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 interfaceorg.languagetool.synthesis.Synthesizer
- Overrides:
synthesize
in classorg.languagetool.synthesis.BaseSynthesizer
- Throws:
IOException
- Since:
- 2.5
-
lookup
-