用Java实现的最佳模式匹配算法 [英] Best pattern Matching algorithm implemented in Java
本文介绍了用Java实现的最佳模式匹配算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Java的新手.我的问题是我必须选择整个文件的行(大小小于70MB)以匹配我的模式(例如<subject> <Predicate> <Object>
).目前,我正在使用基本的字符串匹配算法,这需要时间,因此我想使用"Boyer-Moore算法".很好用吗?我们还有其他更好的解决方案吗?如果是,请让我知道,并且代码也使用Java.
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.
推荐答案
Google快速返回:
A quick Google returned:
- BoyerMoore implementation
- Boyer-Moore string search algorithm (Java)
也许您只是尝试一下并查看结果.
Maybe you simply give it a try and see the results.
这篇关于用Java实现的最佳模式匹配算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文