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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
A quick Google returned:
- BoyerMoore implementation
- Boyer-Moore string search algorithm (Java)
Maybe you simply give it a try and see the results.
回答2:
I did some work on this a long time ago.I found the Knuth-Morris-Pratt algorithm faster than Boyer-Moore.
回答3:
JEval is an advanced library for adding high-performance, mathematical, Boolean and functional expression parsing and evaluation to your Java applications