Package org.languagetool
Class AnalyzedToken
java.lang.Object
org.languagetool.AnalyzedToken
A word (or punctuation, or whitespace) and its analysis (part-of-speech tag, lemma)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
@Nullable String
getLemma()
@Nullable String
getToken()
int
hashCode()
boolean
hasNoTag()
boolean
boolean
matches
(AnalyzedToken an) void
setNoPOSTag
(boolean noTag) If other readings of the token have real POS tags, you can set the flag here that they do, so that the test in the Element class would be correct for all cases.void
setWhitespaceBefore
(boolean whitespaceBefore) toString()
-
Field Details
-
token
-
posTag
-
lemma
-
lemmaOrToken
-
isWhitespaceBefore
private boolean isWhitespaceBefore -
hasNoPOSTag
private boolean hasNoPOSTag
-
-
Constructor Details
-
AnalyzedToken
-
-
Method Details
-
getToken
-
getPOSTag
- Returns:
- the token's part-of-speech tag or
null
-
getLemma
- Returns:
- the token's lemma or
null
-
setWhitespaceBefore
public void setWhitespaceBefore(boolean whitespaceBefore) -
isWhitespaceBefore
public boolean isWhitespaceBefore() -
matches
- Parameters:
an
- AnalyzedToken to test- Returns:
- true if all of the non-null values (lemma, POS, token) of AnalyzedToken match this token
- Since:
- 1.5
-
hasNoTag
public boolean hasNoTag()- Returns:
- true if the AnalyzedToken has no real POS tag (= is not null or a special tag)
- Since:
- 1.5
-
setNoPOSTag
public void setNoPOSTag(boolean noTag) If other readings of the token have real POS tags, you can set the flag here that they do, so that the test in the Element class would be correct for all cases.- Since:
- 1.5
-
toString
-
hashCode
public int hashCode() -
equals
-