模糊字符串匹配

发布于 2024-11-19 02:10:11 字数 290 浏览 8 评论 0原文

对一些图像运行光学字符识别后,我得到了近似的文本。通常认可度并不高。例如,实际文本“DATE”为“DHTE”或“0HTE”。基本上我需要识别并提取每一行中的数据,所以我不需要完美的识别,只要足以识别日期线即可。我尝试计算 Levenshtein 编辑距离,但不幸的是,这往往会为 DATE 和 TIME 提供相似的值。目前,我正在尝试探索是否可以使用正则表达式来匹配数据模式。

有没有一种方法/算法可以改善匹配过程?幸运的是,我的词组不是很大。

(我使用 tesseract 进行 ocr 并使用 groovy/java 进行算法)

After running optical char recognition on some images, I get approximate text. Often the recognition is not great. For instance, the actual text "DATE" comes as "DHTE" or "0HTE". Basically I need to identify and extract the data in each line, so i don't want perfect recognition, just enough to identify the date line. I tried to calculate the Levenshtein edit distance, but unfortunately this tends to give similar values for DATE and TIME. At the moment, I'm trying to explore if I can match the data patterns using regular expressions instead.

Is there a method/algorithm to better the matching process? Fortunately, my set of words is not very large.

(i'm using tesseract for ocr and groovy/java for the algorithm)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

宣告ˉ结束 2024-11-26 02:10:11

这个有一些很酷的算法
http://secondstring.sourceforge.net/

这是 StringUtils 中的基本一个
莱文斯坦距离

This one has a few pretty cool algorithms
http://secondstring.sourceforge.net/

This is a basic one in StringUtils
levenstein distance

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文