public class CoreStopWordDictionary extends Object
| Modifier and Type | Field and Description |
|---|---|
static StopWordDictionary |
dictionary
储存词条的结构
|
static Filter |
FILTER
核心停用词典的核心过滤器,词性属于名词、动词、副词、形容词,并且不在停用词表中才不会被过滤
|
| Constructor and Description |
|---|
CoreStopWordDictionary() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
add(String stopWord)
加入停用词到停用词词典中
|
static List<Term> |
apply(List<Term> termList)
对分词结果应用过滤
|
static boolean |
contains(String key) |
static void |
load(String coreStopWordDictionaryPath,
boolean loadCacheIfPossible)
加载另一部停用词词典
|
static void |
reload()
重新加载
HanLP.Config#CoreStopWordDictionaryPath所指定的停用词词典,并且生成新缓存。 |
static boolean |
remove(String stopWord)
从停用词词典中删除停用词
|
static boolean |
shouldInclude(Term term)
是否应当将这个term纳入计算
|
static boolean |
shouldRemove(Term term)
是否应当去掉这个词
|
public static StopWordDictionary dictionary
public static Filter FILTER
public static void reload()
HanLP.Config#CoreStopWordDictionaryPath所指定的停用词词典,并且生成新缓存。public static void load(String coreStopWordDictionaryPath, boolean loadCacheIfPossible)
coreStopWordDictionaryPath - 词典路径loadCacheIfPossible - 是否优先加载缓存(速度更快)public static boolean contains(String key)
public static boolean shouldInclude(Term term)
term - public static boolean shouldRemove(Term term)
term - 词public static boolean add(String stopWord)
stopWord - 停用词public static boolean remove(String stopWord)
stopWord - 停用词Copyright © 2014–2021 码农场. All rights reserved.