net.sf.jabb.util.text.word
Class Word

java.lang.Object
  extended by net.sf.jabb.util.text.word.Word

public class Word
extends Object

词典里的中文词条。

Chinese word defined in dictionary.

Author:
Zhengmao HU (James)

Field Summary
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 Summary
Word()
           
Word(Word original)
          创建一个实例,其内容是另一个实例的拷贝。 注意,keywordAttachment不会被拷贝,它会被引用。
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NORMAL

public static final int TYPE_NORMAL
正常词汇
Normal word

See Also:
Constant Field Values

TYPE_IGNORE

public static final int TYPE_IGNORE
需先剔除然后再进行分词处理的字符
Characters that should be removed before word identifying

See Also:
Constant Field Values

TYPE_SEPARATOR

public static final int TYPE_SEPARATOR
词与词之间的分隔字符
Characters that separate adjacent words

See Also:
Constant Field Values

TYPE_KEYWORD

public static final int TYPE_KEYWORD
需要提取出来的关键词
Keywords that need to be identified

See Also:
Constant Field Values
Constructor Detail

Word

public Word()

Word

public Word(Word original)
创建一个实例,其内容是另一个实例的拷贝。 注意,keywordAttachment不会被拷贝,它会被引用。

Create an instance which is a copy of another instance. Note that keywordAttachment will not be copied, it will be referenced.

Parameters:
original -
Method Detail

getWord

public String getWord()
Returns:
代表这个词的字符串
String that represents the word

setWord

public void setWord(String word)
Parameters:
word - 代表这个词的字符串
String that represents the word

setType

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.

Parameters:
type - 类型
the type

clearType

public void clearType(int type)
标志这个词条不属于某种类型。

Clear the flag to indicate this word does not belong to a specified type.

Parameters:
type - 类型
the type

clearTypes

public void clearTypes()
标示这个词条不属于任何一种类型。

Clear all flags to indicate that this word does not belong to any type.


getTypes

public int getTypes()
Returns:
the types

setTypes

public void setTypes(int types)
Parameters:
types - the types to set

getKeywordAttachment

public Object getKeywordAttachment()
Returns:
进行关键词匹配时这个词所对应的附件对象
Attachment object associated with this word when performing keyword matching

setKeywordAttachment

public void setKeywordAttachment(Object keywordAttachment)
Parameters:
keywordAttachment - 进行关键词匹配时这个词所对应的附件对象
Attachment object associated with this word when performing keyword matching


Copyright © 2012. All Rights Reserved.