fix term_frequency with an empty string