Best pattern Matching algorithm implemented in Java

陌路散爱 提交于 2019-12-08 11:48:46

问题


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



来源:https://stackoverflow.com/questions/5961261/best-pattern-matching-algorithm-implemented-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!