|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jabb.util.text.KeywordMatcher
public class KeywordMatcher
To check which keywords a text matches, and for each matched keyword how many
occurrences are found.
检查文本当中匹配了哪些关键词,以及每个被匹配到的关键词出现了多少次。
| Field Summary | |
|---|---|
protected StringStartWithMatcher |
matcher
|
| Constructor Summary | |
|---|---|
KeywordMatcher(KeywordMatcher toBeCopied)
Constructs a copy which has exactly the same matching definition as the original one. 创建一个副本,这个副本与原先的对象具有完全相同匹配方式定义。 |
|
KeywordMatcher(Map<String,? extends Object> keywordDefinitions)
Constructs a matcher object with specified keywords; When creating internal data structure, choose to consume more memory for better matching speed. 根据关键词列表,创建一个匹配器; 在创建内部数据结构的时候,选择占用更多内存,而换取速度上的提升。 |
|
KeywordMatcher(Map<String,? extends Object> keywordDefinitions,
boolean moreSpaceForSpeed)
Constructs a matcher object with specified keywords. 根据关键词列表,创建一个匹配器。 |
|
| Method Summary | |
|---|---|
Map<Object,org.apache.commons.lang.mutable.MutableInt> |
match(CharSequence text)
Do the matching test, find out which keywords can be matched, and how many occurrences of each keyword can be found. 进行匹配,返回所匹配上的关键词,以及匹配的次数。 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected StringStartWithMatcher matcher
| Constructor Detail |
|---|
public KeywordMatcher(KeywordMatcher toBeCopied)
toBeCopied - original objectpublic KeywordMatcher(Map<String,? extends Object> keywordDefinitions)
keywordDefinitions - Keywords and their associated attachment as identifier.
public KeywordMatcher(Map<String,? extends Object> keywordDefinitions,
boolean moreSpaceForSpeed)
keywordDefinitions - Keywords and their associated attachment as identifier.moreSpaceForSpeed - Whether or not to consume
more memory for better matching speed.| Method Detail |
|---|
public Map<Object,org.apache.commons.lang.mutable.MutableInt> match(CharSequence text)
text - the text string to be tested
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||