-4

How to Calculate the Keyword Count in a Particular page in java. I want to Know the ALgo for that.

AurA
  • 12,135
  • 7
  • 46
  • 63
Ashish
  • 1
  • 3

2 Answers2

3

Boyer-Moore String Search Algo

If you want to talk about algorithm the string search algorithm famous is Boyer-Moore String search algorithm.

A Java based implementation of Boyer-Moore can be found at http://algs4.cs.princeton.edu/53substring/BoyerMoore.java.html


KMP Algorithm

Another algorithm which can search with substring too is Knuth-Morris-Pratt(KMP) algorithm.

A Java based implementation of KMP can be found at http://tekmarathon.wordpress.com/2013/05/14/algorithm-to-find-substring-in-a-string-kmp-algorithm/

AurA
  • 12,135
  • 7
  • 46
  • 63
0

Load the HTML into a String and you're good to go. Answer to you next question is right here.

Community
  • 1
  • 1
Janis F
  • 2,637
  • 1
  • 25
  • 36