public static class AnalysisResponseBase.TokenInfo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
end |
private boolean |
match |
private int |
position |
private java.lang.String |
rawText |
private int |
start |
private java.lang.String |
text |
private java.lang.String |
type |
Constructor and Description |
---|
TokenInfo(java.lang.String text,
java.lang.String rawText,
java.lang.String type,
int start,
int end,
int position,
boolean match)
Constructs a new TokenInfo.
|
Modifier and Type | Method and Description |
---|---|
int |
getEnd()
Returns the end position of this token within the text it was originally extracted from.
|
int |
getPosition()
Returns the position of this token within the produced token stream.
|
java.lang.String |
getRawText()
Returns the raw text of the token.
|
int |
getStart()
Returns the start position of this token within the text it was originally extracted from.
|
java.lang.String |
getText()
Returns the text of the token.
|
java.lang.String |
getType()
Returns the type of the token.
|
boolean |
isMatch()
Returns whether this token matches one of the query tokens (if query analysis is performed).
|
private final java.lang.String text
private final java.lang.String rawText
private final java.lang.String type
private final int start
private final int end
private final int position
private final boolean match
TokenInfo(java.lang.String text, java.lang.String rawText, java.lang.String type, int start, int end, int position, boolean match)
text
- The text of the tokenrawText
- The raw text of the token. If the token is stored in the index in a special format (e.g.
dates or padded numbers) this argument should hold this value. If the token is stored as is,
then this value should be null
.type
- The type fo the token (typically either word
or <ALPHANUM>
though it depends
on the tokenizer/filter used).start
- The start position of the token in the original text where it was extracted from.end
- The end position of the token in the original text where it was extracted from.position
- The position of the token within the token stream.match
- Indicates whether this token matches one of the the query tokens.public java.lang.String getText()
public java.lang.String getRawText()
null
if the token is indexed as is.public java.lang.String getType()
word
or <ALPHANUM>
, but it really
depends on the tokenizer and filters that are used.public int getStart()
public int getEnd()
public int getPosition()
public boolean isMatch()