public class Dictionary extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PATH_DIC_MAIN |
static String |
PATH_DIC_PREP |
static String |
PATH_DIC_QUANTIFIER |
static String |
PATH_DIC_STOP |
static String |
PATH_DIC_SUFFIX |
static String |
PATH_DIC_SURNAME |
| Modifier and Type | Method and Description |
|---|---|
static Dictionary |
getInstance()
词典初始化
由于IK Analyzer的词典采用Dictionary类的静态方法进行词典初始化
只有当Dictionary类被实际调用时,才会开始载入词典,
这将延长首次分词操作的时间
该方法提供了一个在应用加载阶段就初始化字典的手段
用来缩短首次分词时的时延
|
boolean |
isLoadedCustomDictionary() |
static boolean |
isStopWord(char[] charArray,
int begin,
int length)
判断是否是停止词
|
void |
loadCustomDictionary(CustomDictionary customDictionary) |
static void |
loadExtendStopWords(Collection<String> extStopWords)
加载扩展的停止词条
|
static void |
loadExtendWords(Collection<String> extWords)
加载扩展的词条
|
static Hit |
matchInMainDict(char[] charArray)
检索匹配主词典
|
static Hit |
matchInMainDict(char[] charArray,
int begin,
int length)
检索匹配主词典
|
static Hit |
matchInPrepDict(char[] charArray,
int begin,
int length)
检索匹配介词、副词词典
|
static Hit |
matchInQuantifierDict(char[] charArray,
int begin,
int length)
检索匹配量词词典
|
static Hit |
matchInSuffixDict(char[] charArray,
int begin,
int length)
检索匹配在后缀词典
|
static Hit |
matchInSurnameDict(char[] charArray,
int begin,
int length)
检索匹配姓氏词典
|
static Hit |
matchWithHit(char[] charArray,
int currentIndex,
Hit matchedHit)
检索匹配主词典,
从已匹配的Hit中直接取出DictSegment,继续向下匹配
|
public static final String PATH_DIC_MAIN
public static final String PATH_DIC_SURNAME
public static final String PATH_DIC_QUANTIFIER
public static final String PATH_DIC_SUFFIX
public static final String PATH_DIC_PREP
public static final String PATH_DIC_STOP
public void loadCustomDictionary(CustomDictionary customDictionary)
public boolean isLoadedCustomDictionary()
public static Dictionary getInstance()
public static void loadExtendWords(Collection<String> extWords)
extWords - Collectionpublic static void loadExtendStopWords(Collection<String> extStopWords)
extStopWords - Collectionpublic static Hit matchInMainDict(char[] charArray)
charArray - public static Hit matchInMainDict(char[] charArray, int begin, int length)
charArray - begin - length - public static Hit matchWithHit(char[] charArray, int currentIndex, Hit matchedHit)
charArray - currentIndex - matchedHit - public static Hit matchInSurnameDict(char[] charArray, int begin, int length)
charArray - begin - length - public static Hit matchInQuantifierDict(char[] charArray, int begin, int length)
charArray - begin - length - public static Hit matchInSuffixDict(char[] charArray, int begin, int length)
charArray - begin - length - public static Hit matchInPrepDict(char[] charArray, int begin, int length)
charArray - begin - length - public static boolean isStopWord(char[] charArray,
int begin,
int length)
charArray - begin - length - Copyright © 2022. All rights reserved.