用 Java 实现的最佳模式匹配算法
我是 Java 新手。我的问题是我必须选择整个文件的行(大小小于 70MB)来匹配我的模式(例如
I am new to Java . My problem is I have to select the rows of an entire file (Size less than 70MB) to match my pattern (e.g.<subject> <Predicate> <Object>
). Currently I am using basic string matching algorithm bit it takes time so I want to use "Boyer-Moore algorithm". Is it good to use? Do we have some other better solution? If yes Please let me know and the code also in Java.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Google 快速返回:
也许您只是尝试一下并查看结果。
A quick Google returned:
Maybe you simply give it a try and see the results.
很久以前我在这方面做了一些工作。我发现 Knuth-Morris-Pratt 算法比 Boyer-Moore 算法更快。
I did some work on this a long time ago.I found the Knuth-Morris-Pratt algorithm faster than Boyer-Moore.
JEval 是一个高级库,用于添加高性能、数学、
对 Java 应用程序进行布尔和函数表达式解析和评估
JEval is an advanced library for adding high-performance, mathematical,
Boolean and functional expression parsing and evaluation to your Java applications