Implement totalFrequency in Term object