public final class Lexeme extends Object implements Comparable<Lexeme>
| Modifier and Type | Field and Description |
|---|---|
static int |
TYPE_CJK_NORMAL |
static int |
TYPE_CJK_SF |
static int |
TYPE_CJK_SN |
static int |
TYPE_CJK_UNKNOWN |
static int |
TYPE_LETTER |
static int |
TYPE_NUM |
static int |
TYPE_NUMCOUNT |
| Constructor and Description |
|---|
Lexeme(int offset,
int begin,
int length,
int lexemeType) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Lexeme other) |
boolean |
equals(Object o) |
int |
getBegin() |
int |
getBeginPosition()
获取词元在文本中的起始位置
|
int |
getEndPosition()
获取词元在文本中的结束位置
|
int |
getLength()
获取词元的字符长度
|
String |
getLexemeText()
获取词元的文本内容
|
int |
getLexemeType()
获取词元类型
|
int |
getOffset() |
int |
hashCode() |
boolean |
isOverlap(Lexeme other)
判断词元是否彼此包含
|
void |
setBegin(int begin) |
void |
setLength(int length) |
void |
setLexemeText(String lexemeText) |
void |
setLexemeType(int lexemeType) |
void |
setOffset(int offset) |
String |
toString() |
public static final int TYPE_CJK_NORMAL
public static final int TYPE_CJK_SN
public static final int TYPE_CJK_SF
public static final int TYPE_CJK_UNKNOWN
public static final int TYPE_NUM
public static final int TYPE_NUMCOUNT
public static final int TYPE_LETTER
public int compareTo(Lexeme other)
compareTo in interface Comparable<Lexeme>public boolean isOverlap(Lexeme other)
other - public int getOffset()
public void setOffset(int offset)
public int getBegin()
public int getBeginPosition()
public void setBegin(int begin)
public int getEndPosition()
public int getLength()
public void setLength(int length)
public String getLexemeText()
public void setLexemeText(String lexemeText)
public int getLexemeType()
public void setLexemeType(int lexemeType)
Copyright © 2022. All rights reserved.