Package org.apache.lucene.analysis.morph
Class Token
java.lang.Object
org.apache.lucene.analysis.morph.Token
Analyzed token with morphological data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final intprotected final intprotected intprotected intprotected final intprotected final char[]protected final TokenType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the end offset of the term in the analyzed text.intintintintGet the length (in tokens) of this token.intGet the start offset of the term in the analyzed text.char[]getType()Returns the type of this tokenvoidsetPositionIncrement(int posIncr) voidsetPositionLength(int posLen) Set the position length (in tokens) of this token.
-
Field Details
-
surfaceForm
protected final char[] surfaceForm -
offset
protected final int offset -
length
protected final int length -
startOffset
protected final int startOffset -
endOffset
protected final int endOffset -
posIncr
protected int posIncr -
posLen
protected int posLen -
type
-
-
Constructor Details
-
Token
protected Token(char[] surfaceForm, int offset, int length, int startOffset, int endOffset, TokenType type)
-
-
Method Details
-
getSurfaceForm
public char[] getSurfaceForm()- Returns:
- surfaceForm
-
getOffset
public int getOffset()- Returns:
- offset into surfaceForm
-
getLength
public int getLength()- Returns:
- length of surfaceForm
-
getSurfaceFormString
- Returns:
- surfaceForm as a String
-
getStartOffset
public int getStartOffset()Get the start offset of the term in the analyzed text. -
getEndOffset
public int getEndOffset()Get the end offset of the term in the analyzed text. -
setPositionIncrement
public void setPositionIncrement(int posIncr) -
getPositionIncrement
public int getPositionIncrement() -
setPositionLength
public void setPositionLength(int posLen) Set the position length (in tokens) of this token. For normal tokens this is 1; for compound tokens it's > 1. -
getPositionLength
public int getPositionLength()Get the length (in tokens) of this token. For normal tokens this is 1; for compound tokens it's > 1. -
getType
Returns the type of this token
-