Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

inverted index using hashMap inside a Hashmap  RSS feed

 
may hamed
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My code is that I read document , then I get the term frequency from each doc such
{Term : D1=Term Frequency in D1 , D2=Term Frequency in D2.}
in which term is key , and values of this is hash map of docno and term frequency in this doc.




Word1 contain :welcome welcome build story welcome

word2 contain : build

My output :

build : {1=1} welcome : {0=3} story : {0=1}


I want to my output to be this

build : {0=1 ,1=1} welcome : {0=3} story : {0=1}


so why is not allowing this to happen
 
Les Morgan
Rancher
Posts: 768
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, because you have not built the System.out.println statement to do so? I can see English is not your native language, but I need to know more about what is happening and what the problem is.
may hamed wrote:
My output :

build : {1=1} welcome : {0=3} story : {0=1}


I want to my output to be this

build : {0=1 ,1=1} welcome : {0=3} story : {0=1}

so why is not allowing this to happen
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!