How to count words in java

后端 未结 6 1690
心在旅途
心在旅途 2020-12-06 21:00

I am looking for an algorithm, hint or any source code that can solve my following problem.

I have a folder it contains many text files. I read them and store all te

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-06 21:41

    It might be helpful to think about the problem in terms of 'I have this set of words for all documents together' and 'I could store somehow in which of the documents each of these words appear'. Given such a representation of your data it would be very easy to determine if a given word appears in multiple documents. On how to do this, others have provided hints here.

提交回复
热议问题