且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

LUCENE标准分析仪连字符注意事项

更新时间:2023-02-26 12:31:33

StandardAnalyzer将tokanization委托给StandardTokenizer. 您可以创建自己的tokanizer来满足您的确切需求(可以基于StandardTokenizer).

StandardAnalyzer delegates tokanization to StandardTokenizer. You create your own tokanizer to match your exact needs (you could base it on StandardTokenizer).

或者,如果您愿意,可以使用相关的正则表达式对String.replace()进行肮脏的破解,仅运行分析器即可.是的.丑.

Alternatively, if you prefer, you could do a dirty hack of a String.replace(), with the relevant regular expression, just the analyzer runs. Yeah. Ugly.