MultiSet
works fine. Take a close look at your results - switching the printf
to e.g. "|%S| %d"
will help:
|lemurs.| 1
|lemurs| 1
|Lemurs| 1
It is immediately apparent that those are all 3 different strings. The solution in this case is to simply strip all non-alphabetical chars, and lowercase all words.