python set, dictionary implementation of find duplicate
words from a text