Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(int document_position = 0; i < listDocumentsWithTerm.size(); document_position++) {
- System.out.println(document_position);
- //The document ID
- int document = listDocumentsWithTerm.get(document_position);
- //The number of total documents in that document
- int totalTokensForDocument = indexTC.get(document);
- //TF for the term in the document
- int tfForTermInDocument = listOfTFForTerm.get(document_position);
- //Normalized TF for that term in that document
- double normalizedTF = tfForTermInDocument / (double) totalTokensForDocument;
- queryTermMap.put(document, tfForTermInDocument / (double) totalTokensForDocument);
- }
Advertisement
Add Comment
Please, Sign In to add comment