Added Python version of term-freq generator