I am counting the number of times every word occurs in a text file. I would like to avoid cases and hence am doing tolower to my input and then counting. I have a map data struc
What do you want to happen with different case variants of the same word?
One possibility is to use std::multiset with a caseless comparator as its Compare
template parameter. In this case, all variants of each word will be preserved in the set. Number of occurrences of each word can be obtained via count() member function of the set.