// for each discovered phrase, do manual count and verify if tf and tfByDocument are correct.
AllPhrases allPhrases = context.allPhrases;
for (int index = 0; index < allPhrases.size(); index++)
{
IntIntOpenHashMap realTfByDocuments = countManually(context, allPhrases.wordIndices[index]);
final int realTf = realTfByDocuments.forEach(new IntIntProcedure()
{
int tf;
public void apply(int key, int value)
{
tf += value;