|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jabb.util.text.word.Dictionary
public class Dictionary
词典。
Dictionary of words.
| Field Summary | |
|---|---|
protected javolution.util.FastMap<String,Word> |
words
|
| Constructor Summary | |
|---|---|
Dictionary()
|
|
Dictionary(Dictionary original)
创建一个实例,其内容是拷贝自另一个实例。 |
|
| Method Summary | |
|---|---|
void |
addWord(Word newWord)
加入一个新词条,如果这个词条在词典中已经存在,则合并。 词条对象不会被复制,而是会被引用。 |
void |
addWord(Word newWord,
boolean makeCopy)
加入一个新词条,如果这个词条在词典中已经存在,则合并。 |
Map<String,Word> |
getWords()
|
void |
loadWords(InputStream is,
int wordType)
从流中载入一批指定类型的词条。如果某个词条在词典中已经存在,则合并。 |
void |
merge(Dictionary dict)
将另一个字典的内容合并进来。 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javolution.util.FastMap<String,Word> words
| Constructor Detail |
|---|
public Dictionary()
public Dictionary(Dictionary original)
Create an instance which is a copy of another instance.
original - | Method Detail |
|---|
public void merge(Dictionary dict)
Merge the words from another dictionary into this one.
dict - 将要被合并进来的另一个字典
public void addWord(Word newWord,
boolean makeCopy)
Add a new word, if this word already exists in the dictionary then the new definition will be merged into existing one.
newWord - makeCopy - 是否复制词条对象,而非引用
public void addWord(Word newWord)
Add a new word, if this word already exists in the dictionary then the new definition will be merged into existing one. The Word object will not be copied, it will be referenced.
newWord -
public void loadWords(InputStream is,
int wordType)
throws IOException
Load a batch of word of specified type from stream. If any word already exists in the dictionary, then the new definition will be merged into existing one.
is - 输入流wordType - 类型,定义在Word类中IOExceptionpublic Map<String,Word> getWords()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||