public class Word extends Object
Chinese word defined in dictionary.
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_IGNORE
需先剔除然后再进行分词处理的字符
Characters that should be removed before word identifying |
static int |
TYPE_KEYWORD
需要提取出来的关键词
Keywords that need to be identified |
static int |
TYPE_NORMAL
正常词汇
Normal word |
static int |
TYPE_SEPARATOR
词与词之间的分隔字符
Characters that separate adjacent words |
Constructor and Description |
---|
Word() |
Word(Word original)
创建一个实例,其内容是另一个实例的拷贝。
注意,keywordAttachment不会被拷贝,它会被引用。
|
Modifier and Type | Method and Description |
---|---|
void |
clearType(int type)
标志这个词条不属于某种类型。
|
void |
clearTypes()
标示这个词条不属于任何一种类型。
|
Object |
getKeywordAttachment() |
int |
getTypes() |
String |
getWord() |
void |
setKeywordAttachment(Object keywordAttachment) |
void |
setType(int type)
标志这个词条属于某种类型。注意同一个词条可能同时属于多种类型。
|
void |
setTypes(int types) |
void |
setWord(String word) |
public static final int TYPE_NORMAL
public static final int TYPE_IGNORE
public static final int TYPE_SEPARATOR
public static final int TYPE_KEYWORD
public Word()
public Word(Word original)
Create an instance which is a copy of another instance. Note that keywordAttachment will not be copied, it will be referenced.
original
- public String getWord()
public void setWord(String word)
word
- 代表这个词的字符串
public void setType(int type)
Set the flag to indicate that this word belongs to a specified type. Note that one word can belong to many types in one time.
type
- 类型public void clearType(int type)
Clear the flag to indicate this word does not belong to a specified type.
type
- 类型public void clearTypes()
Clear all flags to indicate that this word does not belong to any type.
public int getTypes()
public void setTypes(int types)
types
- the types to setpublic Object getKeywordAttachment()
public void setKeywordAttachment(Object keywordAttachment)
keywordAttachment
- 进行关键词匹配时这个词所对应的附件对象
Copyright © 2014. All Rights Reserved.