itsjube

Untitled

Nov 19th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. for(int document_position = 0; i < listDocumentsWithTerm.size(); document_position++) {
  2.  
  3. System.out.println(document_position);
  4. //The document ID
  5. int document = listDocumentsWithTerm.get(document_position);
  6.  
  7. //The number of total documents in that document
  8. int totalTokensForDocument = indexTC.get(document);
  9.  
  10. //TF for the term in the document
  11. int tfForTermInDocument = listOfTFForTerm.get(document_position);
  12.  
  13. //Normalized TF for that term in that document
  14. double normalizedTF = tfForTermInDocument / (double) totalTokensForDocument;
  15.  
  16. queryTermMap.put(document, tfForTermInDocument / (double) totalTokensForDocument);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment