public class Word extends Object implements IWord, Cloneable
org.lionsoul.jcseg.core.IWord interface implemented
at 2017/03/29:
make the synonyms series method getSyn() setSyn(String[]) addSyn(String)
and the part of speech series method getPartSpeech() setPartSpeech(String[]) addPartSpeech(String)
and the clone() method synchronized for may coming concurrent access.EN_POSPEECH, MIX_POSPEECH, NAME_POSPEECH, NUMERIC_POSPEECH, PPT_POSPEECH, PUNCTUATION, T_BASIC_LATIN, T_CJK_PINYIN, T_CJK_WORD, T_CN_NAME, T_CN_NICKNAME, T_CN_NUMERIC, T_LETTER_NUMBER, T_MIXED_WORD, T_OTHER_NUMBER, T_PUNCTUATION, T_UNRECOGNIZE_WORD, TIME_POSPEECH, UNRECOGNIZE| Constructor and Description |
|---|
Word(String value,
int type) |
Word(String value,
int fre,
int type) |
Word(String value,
int fre,
int type,
String entity)
construct method to initialize the newly created Word instance
|
Word(String value,
int type,
String entity) |
| Modifier and Type | Method and Description |
|---|---|
String |
__toString()
for debug only
|
void |
addPartSpeech(String ps)
add a new part to speech to the word.
|
void |
addSyn(String s)
add a new syn word to the word.
|
IWord |
clone()
Interface to clone the current object
|
boolean |
equals(Object o)
I mean: you have to rewrite the equals method
cause the Jcseg require it
|
String |
getEntity()
get the entity name of the word
|
int |
getFrequency()
return the frequency of the word,
use only when the word's length is one.
|
int |
getLength()
return the length of the word
|
String[] |
getPartSpeech()
return the part of speech of the word.
|
String |
getPinyin()
return the pinying of the word
|
int |
getPosition()
return the start position of the word.
|
String[] |
getSyn()
return the syn words of the word.
|
int |
getType()
return the type of the word
|
String |
getValue()
return the value of the word
|
int |
hashCode()
rewrite the hash code generate algorithm
take the value as the main factor
|
void |
setEntity(String entity)
set the entity name of the word
|
void |
setLength(int length)
self define the length
|
void |
setPartSpeech(String[] partspeech) |
void |
setPinyin(String py)
set the pinying of the word
|
void |
setPosition(int pos)
set the position of the word
|
void |
setSyn(String[] syn) |
String |
toString() |
public Word(String value, int fre, int type, String entity)
value - fre - type - entity - public Word(String value, int fre, int type)
public Word(String value, int type)
public String getValue()
IWordgetValue in interface IWordIWord.getValue()public int getLength()
IWordgetLength in interface IWordIWord.getLength()public void setLength(int length)
IWordsetLength in interface IWordIWord.setLength(int)public int getFrequency()
IWordgetFrequency in interface IWordIWord.getFrequency()public int getType()
IWordgetType in interface IWordIWord.getType()public void setPosition(int pos)
IWordsetPosition in interface IWordIWord.setPosition(int)public int getPosition()
IWordgetPosition in interface IWordIWord.getPosition()public String getEntity()
IWordgetEntity in interface IWordIWord.getEntity()public void setEntity(String entity)
IWordsetEntity in interface IWordIWord.setEntity(String)public String getPinyin()
IWordpublic void setPinyin(String py)
IWordpublic String[] getSyn()
IWordgetSyn in interface IWordIWord.getSyn()public void addSyn(String s)
IWordaddSyn in interface IWordIWord.addSyn(String)public String[] getPartSpeech()
IWordgetPartSpeech in interface IWordIWord.getPartSpeech()public void setPartSpeech(String[] partspeech)
setPartSpeech in interface IWordpublic void addPartSpeech(String ps)
IWordaddPartSpeech in interface IWordIWord.addPartSpeech( String );public IWord clone()
public boolean equals(Object o)
IWordequals in interface IWordequals in class ObjectObject.equals(Object),
IWord.equals(Object)public String __toString()
public String toString()
toString in class ObjectObject.toString()Copyright © 2017. All Rights Reserved.