Не имеет прямого отношения к вашему вопросу, но как замечание, которое может улучшить ваш код ... шаблон
freqDict = {}
...
if word not in freqDict:
freqDict[word] = 1
else:
freqDict[word] += 1
обычно заменяется на
import collections
freqDict = collections.defaultdict(int)
...
freqDict[word] += 1
или до 2,5
freqDict = {}
...
freqDict.setdefault(word, 0) += 1