term frequency using java program

后端 未结 2 1816
南方客
南方客 2020-12-11 22:44

I have set of documents. I want to know the frequency count of each word in each document (i.e) term frequency using java program. thanks in advance. I know how to find the

相关标签:
2条回答
  • 2020-12-11 22:54

    You can split your documents on spaces and punctuation, go through the resulting array and then count frequency for each word (a Map<String, Integer> would really help you with this).


    Resources :

    • Java - faster data structure to count word frequency?

    On the same topic :

    • How to count words in java
    0 讨论(0)
  • 2020-12-11 23:11

    If it's more than a one time problem to solve, you should consider using Lucene to index your documents. Then this post would help you answer your question.

    0 讨论(0)
提交回复
热议问题