public final class Match extends Object
Match
is the configuration of an algorithm used to match AnalyzedTokenReadings
s.
In XML, it's the <match/>
element.
Use createState(Synthesizer, AnalyzedTokenReadings)
and createState(Synthesizer, AnalyzedTokenReadings[], int, int)
to create a MatchState
used to actually match AnalyzedTokenReadings
.Modifier and Type | Class and Description |
---|---|
static class |
Match.CaseConversion
Possible string case conversions.
|
static class |
Match.IncludeRange |
Constructor and Description |
---|
Match(String posTag,
String posTagReplace,
boolean postagRegexp,
String regexMatch,
String regexReplace,
Match.CaseConversion caseConversionType,
boolean setPOS,
boolean suppressMisspelled,
Match.IncludeRange includeSkipped) |
Modifier and Type | Method and Description |
---|---|
boolean |
checksSpelling()
Used to tell whether the Match class will spell-check the result so
that misspelled suggestions are suppressed.
|
boolean |
convertsCase()
Used to let LT know that it should change the case of the match.
|
MatchState |
createState(Synthesizer synthesizer,
AnalyzedTokenReadings token)
Creates a state used for actually matching a token.
|
MatchState |
createState(Synthesizer synthesizer,
AnalyzedTokenReadings[] tokens,
int index,
int next)
Creates a state used for actually matching a token.
|
Match.CaseConversion |
getCaseConversionType() |
Match.IncludeRange |
getIncludeSkipped() |
String |
getLemma() |
Pattern |
getPosRegexMatch() |
String |
getPosTag() |
String |
getPosTagReplace() |
Pattern |
getRegexMatch() |
String |
getRegexReplace() |
int |
getTokenRef()
Gets the token number referenced by the match.
|
boolean |
isInMessageOnly() |
boolean |
isPostagRegexp() |
boolean |
isStaticLemma() |
boolean |
posRegExp()
Checks if the Match element uses regexp-based form of the POS tag.
|
void |
setInMessageOnly(boolean inMessageOnly) |
void |
setLemmaString(String lemmaString)
Sets a base form (lemma) that will be formatted, or synthesized, using the
specified POS regular expressions.
|
boolean |
setsPos()
Checks if the Match element is used for setting the part of speech:
setpos="yes" in XML. |
void |
setTokenRef(int i)
Sets the token number referenced by the match.
|
public Match(String posTag, String posTagReplace, boolean postagRegexp, String regexMatch, String regexReplace, Match.CaseConversion caseConversionType, boolean setPOS, boolean suppressMisspelled, Match.IncludeRange includeSkipped)
public MatchState createState(Synthesizer synthesizer, AnalyzedTokenReadings token)
public MatchState createState(Synthesizer synthesizer, AnalyzedTokenReadings[] tokens, int index, int next)
public boolean setsPos()
setpos="yes"
in XML.public boolean posRegExp()
public void setLemmaString(String lemmaString)
lemmaString
- String that specifies the base form.public String getLemma()
public boolean isStaticLemma()
public boolean checksSpelling()
public void setTokenRef(int i)
i
- Token number.public int getTokenRef()
public boolean convertsCase()
public Match.CaseConversion getCaseConversionType()
public void setInMessageOnly(boolean inMessageOnly)
public boolean isInMessageOnly()
public String getPosTag()
public Pattern getRegexMatch()
public String getRegexReplace()
public Pattern getPosRegexMatch()
public boolean isPostagRegexp()
public String getPosTagReplace()
public Match.IncludeRange getIncludeSkipped()