public class TFDictionary extends SimpleDictionary<TermFrequency> implements ISaveAble
SimpleDictionary.Filter<V>| 构造器和说明 |
|---|
TFDictionary() |
TFDictionary(String delimeter) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(String key) |
static int |
combine(String... path)
合并多个词典
|
int |
combine(TFDictionary dictionary,
int limit,
boolean add)
合并自己(主词典)和某个词频词典
|
int |
getFrequency(String key)
获取频次
|
protected Map.Entry<String,TermFrequency> |
onGenerateEntry(String line)
由参数构造一个词条
|
boolean |
saveKeyTo(String path)
仅仅将值保存到文件
|
boolean |
saveTxtTo(String path)
将自己以文本文档的方式保存到磁盘
|
TreeSet<TermFrequency> |
values()
按照频率从高到低排序的条目
|
public TFDictionary(String delimeter)
public TFDictionary()
protected Map.Entry<String,TermFrequency> onGenerateEntry(String line)
SimpleDictionaryonGenerateEntry 在类中 SimpleDictionary<TermFrequency>public int combine(TFDictionary dictionary, int limit, boolean add)
dictionary - 某个词频词典limit - 如果该词频词典试图引入一个词语,其词频不得超过此limit(如果不需要使用limit功能,可以传入Integer.MAX_VALUE)add - 设为true则是词频叠加模式,否则是词频覆盖模式public static int combine(String... path)
path - 多个词典的路径,第一个是主词典。主词典与其他词典的区别详见com.hankcs.hanlp.corpus.dictionary.TFDictionary#combine(com.hankcs.hanlp.corpus.dictionary.TFDictionary, int, boolean)public int getFrequency(String key)
key - public void add(String key)
public boolean saveKeyTo(String path)
path - public TreeSet<TermFrequency> values()
Copyright © 2014–2017 码农场. All rights reserved.