Java - Count words in two documents
- by user552961
Good Morning - it is school assignment, I am not asking for any source code (if you can provide any pesudo code it would be awesome).
Here is the problem :(
I have to create a term frequency table. It is not pure TF, I just need to count the words and write down.
I know basic steps to do it
1 - extract all terms (I can do it with file reader)
2 - remove repeating terms (I can do it with TreeMap)
The output of 2nd step would be
Niga, ponga, dinga, bitlo, etc.
3 - Now I have to see if there is any word in current file from above terms or not, if yes then I will count.
Now this is my problem, I stucked on step 3 :(
I have some idea how to count words with TreeMap (treemap.containskey etc.) but it would be global count not local count for each file :(
Any pseudo code?