lucene token

Token是分好词的结果。每个token是一个分好的词。

超类:Attribute(空接口)

所有接口和类都是用来存放属性信息的。Token中保存了所有的属性信息。

public class Token extends AttributeImpl 

                   implements Cloneable, TermAttribute, TypeAttribute, PositionIncrementAttribute,
                              FlagsAttribute, OffsetAttribute, PayloadAttribute {

  public static final String DEFAULT_TYPE = "word";

  private static int MIN_BUFFER_SIZE = 10;

  private char[] termBuffer;
  private int termLength;
  private int startOffset,endOffset;
  private String type = DEFAULT_TYPE;
  private int flags;
  private Payload payload;
  private int positionIncrement = 1;

}