Best pattern Matching algorithm implemented in Jav

2019-06-11 12:29发布

问题:

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