String Matching Algorithms - Boyer-Moore string matching algorithm, Rabin-Karp algorithm, and Knuth-Morris- Pratt algorithm
The Project is done using Java SE8 and Eclipse Ide.
Requirements:
- Java JDK SE7/8
- Eclipse IDE ( for java development / JAVA IDE)
To run the project:
-
Extract code.zip which is containg the project.
-
Import the project "String-Searching-Algorithms" using the Eclipse IDE.
-
Navigate to stringmatching package in it (String-Searching-Algorithms\src\stringmatching) to find the four algorithms in it.
-
The Package contains four java programs: boyerbad.java -- Implementing Boyer Moore bad character heuristic Search algorithm. boyergood.java -- Implementing Boyer Moore good suffix heuristic Search algorithm. KMP_String_Matching.java -- Implementing Knuth-Morris-Pratt Search algorithm. rabinkarp.java -- Implementing Rabin-Karp Search algorithm.
-
The package also contains two text fies: test.txt -- Containing the complete text on which search is done. pattern.txt -- Containing the pattern/substring to search for on the given text (in test.txt).
-
Enter the text on which you want to perform search in test.txt file. (All the text should be in Either Upper/ Lower Case)
-
Enter the pattern to search for in the pattern.txt file. ( The Pattern should be either in upper/lower case same as chosen in test.txt)
-
Choose the algorithm (file.java) you want to execute, right click and click on run as java application to see the output.
-
Repeat steps 6 to 8 to run the project on other parameters( different pattern/text/algorithm).