Java的近似正则表达式库? [英] Approximate regular expression library for Java?
问题描述
我刚刚编写了一些近似字符串匹配的代码。我想将我的天真算法与在JVM上运行的更成熟的实现进行对比。有什么建议?
I have just written some code for approximate string matching. I would like to benchmark my naive algorithm against a more mature implementation running on the JVM. Any suggestions?
推荐答案
我在本网站的其他地方找到了类似问题的答案。
I found these answers elsewhere on this site for similar problems.
Commons Lang实现了Levenshtein距离。
http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringUtils.html
Commons Codec有一个soundex和metaphone的实现。
http://commons.apache.org/codec/api-release/org/apache/commons/codec/language /Soundex.html
http://commons.apache.org/codec/api-release/org/apache/commons/codec/language/Met aphone.html
Commons Codec has an implementation of soundex and metaphone.
http://commons.apache.org/codec/api-release/org/apache/commons/codec/language/Soundex.html
http://commons.apache.org/codec/api-release/org/apache/commons/codec/language/Metaphone.html
( source )
Lucene( http://lucene.apache.org/ )还实现了Levenshtein编辑距离。
Lucene (http://lucene.apache.org/) also implements Levenshtein edit distance.
( source :zarawesome)
(source: zarawesome)
这篇关于Java的近似正则表达式库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!