de.danielnaber.languagetool.synthesis
Class BaseSynthesizer
Object
BaseSynthesizer
- All Implemented Interfaces:
- Synthesizer
- Direct Known Subclasses:
- DutchSynthesizer, EnglishSynthesizer, RomanianSynthesizer, RussianSynthesizer, SlovakSynthesizer
public class BaseSynthesizer
- extends Object
- implements Synthesizer
|
Method Summary |
String |
getPosTagCorrection(String posTag)
Gets a corrected version of the POS tag used for synthesis. |
String[] |
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)
Generates a form of the word with a given POS tag for a given lemma. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseSynthesizer
public BaseSynthesizer(String resFile,
String tagFile)
synthesize
public String[] synthesize(AnalyzedToken token,
String posTag)
throws IOException
- Get a form of a given AnalyzedToken, where the form is defined by a
part-of-speech tag.
- Specified by:
synthesize in interface Synthesizer
- 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
- Description copied from interface:
Synthesizer
- Generates a form of the word with a given POS tag for a given lemma.
POS tag can be specified using regular expressions.
- Specified by:
synthesize in interface Synthesizer
- Parameters:
token - the token to be used for synthesisposTag - POS tag of the form to be generated.posTagRegExp - Specifies whether the posTag string is a
regular expression.
- Throws:
IOException
getPosTagCorrection
public String getPosTagCorrection(String posTag)
- Description copied from interface:
Synthesizer
- Gets a corrected version of the POS tag used for synthesis.
Useful when the tagset defines special disjunction that
need to be converted into regexp disjunctions.
- Specified by:
getPosTagCorrection in interface Synthesizer
- Parameters:
posTag - Original POS tag.
to correct.
- Returns:
- @String Converted POS tag.
Copyright © 2005-2009 Daniel Naber