public class BaseSynthesizer extends Object implements Synthesizer
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
possibleTags |
| Constructor and Description |
|---|
BaseSynthesizer(String resourceFileName,
String tagFileName) |
| Modifier and Type | Method and Description |
|---|---|
protected morfologik.stemming.IStemmer |
createStemmer()
Creates a new
IStemmer based on the configured dictionary. |
protected morfologik.stemming.Dictionary |
getDictionary()
Returns the
Dictionary used for this synthesizer. |
String |
getPosTagCorrection(String posTag)
Gets a corrected version of the POS tag used for synthesis.
|
morfologik.stemming.IStemmer |
getStemmer() |
protected void |
initPossibleTags() |
protected void |
lookup(String lemma,
String posTag,
List<String> results)
Lookup the inflected forms of a lemma defined by a part-of-speech tag.
|
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.
|
protected morfologik.stemming.Dictionary getDictionary()
throws IOException
Dictionary used for this synthesizer.
The dictionary file can be defined in the constructor.IOException - In case the dictionary cannot be loaded.protected morfologik.stemming.IStemmer createStemmer()
IStemmer based on the configured dictionary.
The result must not be shared among threads.protected void lookup(String lemma, String posTag, List<String> results)
lemma - the lemma to be inflected.posTag - the desired part-of-speech tag.results - the list to collect the inflected forms.public String[] synthesize(AnalyzedToken token, String posTag) throws IOException
synthesize in interface Synthesizertoken - AnalyzedToken to be inflected.posTag - The desired part-of-speech tag.IOExceptionpublic String[] synthesize(AnalyzedToken token, String posTag, boolean posTagRegExp) throws IOException
Synthesizersynthesize in interface Synthesizertoken - the token to be used for synthesisposTag - POS tag of the form to be generatedposTagRegExp - Specifies whether the posTag string is a regular expression.IOExceptionpublic String getPosTagCorrection(String posTag)
SynthesizergetPosTagCorrection in interface SynthesizerposTag - original POS tag to correctpublic morfologik.stemming.IStemmer getStemmer()
protected void initPossibleTags()
throws IOException
IOException