|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jabb.util.text.word.TextAnalyzer
public abstract class TextAnalyzer
Text Analyzer; Result of the analysis will be hold in AnalyzedText.
文本分析器;分析的结果会放在AnalyzedText中。
| Field Summary | |
|---|---|
protected String |
dictionaryPath
|
protected Map<String,? extends Object> |
keywordDefinitions
|
protected TreeMap<Integer,? extends Object> |
lengthDefinitions
|
static int |
TYPE_FAST
使用KeywordMatcher与自定义的字典表进行分词(试验中,尚不完善) |
static int |
TYPE_MMSEG_COMPLEX
使用com.chenlb.mmseg4j.ComplexSeg进行分词 |
static int |
TYPE_MMSEG_MAXWORD
使用com.chenlb.mmseg4j.MaxWordSeg进行分词 |
static int |
TYPE_MMSEG_SIMPLE
使用com.chenlb.mmseg4j.SimpleSeg进行分词 |
| Constructor Summary | |
|---|---|
protected |
TextAnalyzer(String dictionaryPath,
Map<String,? extends Object> keywordDefinitions,
Map<Integer,? extends Object> lengthDefinitions)
Constructor that will be used internally. 仅供内部使用的构造方法。 |
| Method Summary | |
|---|---|
AnalyzedText |
analyze(String text)
对文本进行立刻分析,不用lazy方式。 |
AnalyzedText |
analyze(String text,
boolean lazy)
对文本进行分析。 |
static TextAnalyzer |
createInstance(int type)
Create an instance of TextAnalyzer. 创建一个文本分析器实例。 |
static TextAnalyzer |
createInstance(int type,
Map<String,? extends Object> keywordDefinitions,
Map<Integer,? extends Object> lengthDefinitions)
Create an instance of TextAnalyzer. 创建一个文本分析器实例。 |
static TextAnalyzer |
createInstance(int type,
String dictionaryPath,
Map<String,? extends Object> keywordDefinitions,
Map<Integer,? extends Object> lengthDefinitions)
Create an instance of TextAnalyzer. 创建一个文本分析器实例。 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_MMSEG_SIMPLE
public static final int TYPE_MMSEG_MAXWORD
public static final int TYPE_MMSEG_COMPLEX
public static final int TYPE_FAST
protected String dictionaryPath
protected Map<String,? extends Object> keywordDefinitions
protected TreeMap<Integer,? extends Object> lengthDefinitions
| Constructor Detail |
|---|
protected TextAnalyzer(String dictionaryPath,
Map<String,? extends Object> keywordDefinitions,
Map<Integer,? extends Object> lengthDefinitions)
dictionaryPath - 字典文件路径keywordDefinitions - 关键词字的定义lengthDefinitions - 文本长度类别定义| Method Detail |
|---|
public static TextAnalyzer createInstance(int type,
String dictionaryPath,
Map<String,? extends Object> keywordDefinitions,
Map<Integer,? extends Object> lengthDefinitions)
type - TYPE_MMSEG_SIMPLE | TYPE_MMSEG_COMPLEX | TYPE_MMSEG_MAXWORD | TYPE_FASTdictionaryPath - 字典文件路径,如果为null,则表示使用缺省位置的字典文件keywordDefinitions - 关键词字的定义lengthDefinitions - 文本长度类别定义
public static TextAnalyzer createInstance(int type,
Map<String,? extends Object> keywordDefinitions,
Map<Integer,? extends Object> lengthDefinitions)
type - TYPE_MMSEG_SIMPLE | TYPE_MMSEG_COMPLEX | TYPE_MMSEG_MAXWORD | TYPE_FASTkeywordDefinitions - 关键词字的定义lengthDefinitions - 文本长度类别定义
public static TextAnalyzer createInstance(int type)
type - TYPE_MMSEG_SIMPLE | TYPE_MMSEG_COMPLEX | TYPE_MMSEG_MAXWORD | TYPE_FAST
public AnalyzedText analyze(String text,
boolean lazy)
text - 待分析的文本lazy - 是否延迟分析(所谓延迟是指直到用到分析结果的时候才进行实质性分析)
public AnalyzedText analyze(String text)
text - 待分析的文本
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||