Package org.languagetool.synthesis.en
Class EnglishSynthesizer
java.lang.Object
org.languagetool.synthesis.BaseSynthesizer
org.languagetool.synthesis.en.EnglishSynthesizer
- All Implemented Interfaces:
Synthesizer
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 Stringprivate static final Stringprivate final AvsAnRulestatic final EnglishSynthesizerprivate static final Stringprivate static final Stringprivate static final StringFields inherited from class org.languagetool.synthesis.BaseSynthesizer
language, possibleTags, SPELLNUMBER_FEMININE_TAG, SPELLNUMBER_ROMAN_TAG, SPELLNUMBER_TAG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprivate voidString[]synthesize(AnalyzedToken token, String posTag) Get a form of a given AnalyzedToken, where the form is defined by a part-of-speech tag.String[]synthesize(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\\+INDTor\\+DT.Methods inherited from class org.languagetool.synthesis.BaseSynthesizer
createStemmer, getDictionary, getPosTagCorrection, getRomanNumber, getSpelledNumber, getStemmer, getTargetPosTag, initPossibleTags, lookup, removeExceptions, synthesizeForPosTags
-
Field Details
-
RESOURCE_FILENAME
- See Also:
-
TAGS_FILE_NAME
- See Also:
-
SOR_FILE_NAME
- See Also:
-
exceptions
-
ADD_DETERMINER
- See Also:
-
ADD_IND_DETERMINER
- See Also:
-
aVsAnRule
-
INSTANCE
-
-
Constructor Details
-
EnglishSynthesizer
Deprecated.useINSTANCE -
EnglishSynthesizer
private EnglishSynthesizer()
-
-
Method Details
-
synthesize
Get a form of a given AnalyzedToken, where the form is defined by a part-of-speech tag.- Specified by:
synthesizein interfaceSynthesizer- Overrides:
synthesizein classBaseSynthesizer- Parameters:
token- AnalyzedToken to be inflected.posTag- A desired part-of-speech tag.- Returns:
- String value - inflected word.
- Throws:
IOException
-
synthesize
public String[] synthesize(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\\+INDTor\\+DT.- Specified by:
synthesizein interfaceSynthesizer- Overrides:
synthesizein classBaseSynthesizer- Parameters:
token- the token to be used for synthesisposTag- POS tag of the form to be generatedposTagRegExp- Specifies whether the posTag string is a regular expression.- Throws:
IOException- Since:
- 2.5
-
lookup
-
isException
- Overrides:
isExceptionin classBaseSynthesizer
-
INSTANCE