已关闭。此问题需要details or clarity。当前不接受答案。
**想要改进此问题吗?**通过editing this post添加详细信息并阐明问题。
去年关闭了。
Improve this question
例如:Hello World
预期值:Hello World
我尝试使用Solr的tokenizer,但是没有找到合适的tokenizer。我该怎么办?
已关闭。此问题需要details or clarity。当前不接受答案。
**想要改进此问题吗?**通过editing this post添加详细信息并阐明问题。
去年关闭了。
Improve this question
例如:Hello World
预期值:Hello World
我尝试使用Solr的tokenizer,但是没有找到合适的tokenizer。我该怎么办?
3条答案
按热度按时间rdrgkggo1#
在Solr中,DictionaryCompoundWordFilter是为此而构建的;它不是一个tokenizer,但是它在tokenizer之后作为一个过滤器工作,将一个子字符串中的已知单词拆分成单独的token。这在英语以外的许多语言中特别有用,但在这里也有价值。
您为它提供一个所选语言的有效单词字典(在示例中,这些单词是
hello
和world
),过滤器将这些单词提取到单独的标记中:假设germanwords.txt至少包含以下单词:
dumm kopf donau dampf schiff
英寸:
"Donaudampfschiff dummkopf"
要筛选的标记器:
"Donaudampfschiff"(1), "dummkopf"(2),
输出:
"Donaudampfschiff"(1), "Donau"(1), "dampf"(1), "schiff"(1), "dummkopf"(2), "dumm"(2), "kopf"(2)
tvmytwxo2#
如果标记器接受正则表达式,则可以使用以下模式作为标记:
示例Java代码:
gt0wga4j3#
你可以用
示例:
正则表达式示例:RegExr Example
明细: