Package org.languagetool.rules.patterns
Class MatchState
- java.lang.Object
-
- org.languagetool.rules.patterns.MatchState
-
public class MatchState extends Object
The state of a matching process. This state is NOT thread-safe.- Since:
- 2.3
- Author:
- Stefan Lotties
-
-
Constructor Summary
Constructors Constructor Description MatchState(Match match, Synthesizer synthesizer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnalyzedTokenReadings
filterReadings()
Match
getMatch()
String
getTargetPosTag()
Format POS tag using parameters already defined in the class.void
setToken(AnalyzedTokenReadings token)
void
setToken(AnalyzedTokenReadings[] tokens, int index, int next)
Sets the token to be formatted etc.String[]
toFinalString(Language lang)
Gets all strings formatted using the match element.
-
-
-
Constructor Detail
-
MatchState
public MatchState(Match match, Synthesizer synthesizer)
-
-
Method Detail
-
setToken
public void setToken(AnalyzedTokenReadings token)
-
setToken
public final void setToken(AnalyzedTokenReadings[] tokens, int index, int next)
Sets the token to be formatted etc. and includes the support for including the skipped tokens.- Parameters:
tokens
- Array of tokensindex
- Index of the token to be formattednext
- Position of the next token (the skipped tokens are the ones between the tokens[index] and tokens[next]
-
filterReadings
public final AnalyzedTokenReadings filterReadings()
-
toFinalString
public final String[] toFinalString(Language lang) throws IOException
Gets all strings formatted using the match element.- Throws:
IOException
-
getTargetPosTag
public final String getTargetPosTag()
Format POS tag using parameters already defined in the class.- Returns:
- Formatted POS tag as String.
-
getMatch
public Match getMatch()
-
-