public class KeywordsParser extends Object implements TokenParser
| Modifier and Type | Field and Description |
|---|---|
protected String |
id |
protected xyz.cofe.collection.Convertor<String,String> |
matchedTextConvertor
Функц. конвертирования совпавших слов
|
| Constructor and Description |
|---|
KeywordsParser()
Конструктор
|
KeywordsParser(boolean ignoreCase,
String... keywords)
Конструктор
|
KeywordsParser(Keywords keywords)
Конструктор
|
KeywordsParser(String id)
Конструктор
|
KeywordsParser(String[] keywords,
boolean ignoreCase,
xyz.cofe.collection.Convertor<String,String> matchedTextConvertor)
Конструктор
|
| Modifier and Type | Method and Description |
|---|---|
Keywords |
getKeywords()
Указывает список ключевых слов
|
xyz.cofe.collection.Convertor<String,String> |
getMatchedTextConvertor()
Указывает функц. конвертирования совпавших слов, возможно null
|
Keyword |
parse(String source,
int offset)
Возвращает токен если ему соответ цепочка сиволов в указаной точке
|
void |
setKeywords(Keywords keywords)
Указывает список ключевых слов
|
void |
setMatchedTextConvertor(xyz.cofe.collection.Convertor<String,String> matchedTextConvertor)
Указывает функц. конвертирования совпавших слов, возможно null
|
protected String id
public KeywordsParser()
public KeywordsParser(String id)
id - Идентификатор токенаpublic KeywordsParser(boolean ignoreCase,
String... keywords)
ignoreCase - Игнорировать регистр буквkeywords - список ключевых словpublic KeywordsParser(String[] keywords, boolean ignoreCase, xyz.cofe.collection.Convertor<String,String> matchedTextConvertor)
keywords - список ключевых словignoreCase - Игнорировать регистр буквmatchedTextConvertor - Функц. конвертирования совпавших слов, возможно nullpublic KeywordsParser(Keywords keywords)
keywords - список ключевых словpublic Keywords getKeywords()
public void setKeywords(Keywords keywords)
keywords - список ключевых словpublic xyz.cofe.collection.Convertor<String,String> getMatchedTextConvertor()
public void setMatchedTextConvertor(xyz.cofe.collection.Convertor<String,String> matchedTextConvertor)
matchedTextConvertor - Функц. конвертирования совпавших слов, возможно nullpublic Keyword parse(String source, int offset)
TokenParserparse in interface TokenParsersource - Цепочка символовoffset - Смещение от начала цепочки символовCopyright © 2017. All rights reserved.