org.wltea.analyzer.core
类 Lexeme

java.lang.Object
  继承者 org.wltea.analyzer.core.Lexeme
所有已实现的接口:
java.lang.Comparable<Lexeme>

public class Lexeme
extends java.lang.Object
implements java.lang.Comparable<Lexeme>

IK词元对象


字段摘要
static int TYPE_ARABIC
           
static int TYPE_CNUM
           
static int TYPE_CNWORD
           
static int TYPE_COUNT
           
static int TYPE_CQUAN
           
static int TYPE_ENGLISH
           
static int TYPE_LETTER
           
static int TYPE_OTHER_CJK
           
static int TYPE_UNKNOWN
           
 
构造方法摘要
Lexeme(int offset, int begin, int length, int lexemeType)
           
 
方法摘要
 boolean append(Lexeme l, int lexemeType)
          合并两个相邻的词元
 int compareTo(Lexeme other)
           
 boolean equals(java.lang.Object o)
           
 int getBegin()
           
 int getBeginPosition()
          获取词元在文本中的起始位置
 int getEndPosition()
          获取词元在文本中的结束位置
 int getLength()
          获取词元的字符长度
 java.lang.String getLexemeText()
          获取词元的文本内容
 int getLexemeType()
          获取词元类型
 int getOffset()
           
 int hashCode()
           
 void setBegin(int begin)
           
 void setLength(int length)
           
 void setLexemeText(java.lang.String lexemeText)
           
 void setLexemeType(int lexemeType)
           
 void setOffset(int offset)
           
 java.lang.String toString()
           
 
从类 java.lang.Object 继承的方法
getClass, notify, notifyAll, wait, wait, wait
 

字段详细信息

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
另请参见:
常量字段值

TYPE_ENGLISH

public static final int TYPE_ENGLISH
另请参见:
常量字段值

TYPE_ARABIC

public static final int TYPE_ARABIC
另请参见:
常量字段值

TYPE_LETTER

public static final int TYPE_LETTER
另请参见:
常量字段值

TYPE_CNWORD

public static final int TYPE_CNWORD
另请参见:
常量字段值

TYPE_OTHER_CJK

public static final int TYPE_OTHER_CJK
另请参见:
常量字段值

TYPE_CNUM

public static final int TYPE_CNUM
另请参见:
常量字段值

TYPE_COUNT

public static final int TYPE_COUNT
另请参见:
常量字段值

TYPE_CQUAN

public static final int TYPE_CQUAN
另请参见:
常量字段值
构造方法详细信息

Lexeme

public Lexeme(int offset,
              int begin,
              int length,
              int lexemeType)
方法详细信息

equals

public boolean equals(java.lang.Object o)
覆盖:
java.lang.Object 中的 equals

hashCode

public int hashCode()
覆盖:
java.lang.Object 中的 hashCode

compareTo

public int compareTo(Lexeme other)
指定者:
接口 java.lang.Comparable<Lexeme> 中的 compareTo

getOffset

public int getOffset()

setOffset

public void setOffset(int offset)

getBegin

public int getBegin()

getBeginPosition

public int getBeginPosition()
获取词元在文本中的起始位置

返回:
int

setBegin

public void setBegin(int begin)

getEndPosition

public int getEndPosition()
获取词元在文本中的结束位置

返回:
int

getLength

public int getLength()
获取词元的字符长度

返回:
int

setLength

public void setLength(int length)

getLexemeText

public java.lang.String getLexemeText()
获取词元的文本内容

返回:
String

setLexemeText

public void setLexemeText(java.lang.String lexemeText)

getLexemeType

public int getLexemeType()
获取词元类型

返回:
int

setLexemeType

public void setLexemeType(int lexemeType)

append

public boolean append(Lexeme l,
                      int lexemeType)
合并两个相邻的词元

参数:
l -
lexemeType -
返回:
boolean 词元是否成功合并

toString

public java.lang.String toString()
覆盖:
java.lang.Object 中的 toString