I\'d like to count frequencies of all words in a text file.
>>> countInFile(\'test.txt\')
should return {\'aaa\':1, \'bbb\':
{\'aaa\':1, \'bbb\':
Skip CountVectorizer and scikit-learn.
The file may be too large to load into memory but I doubt the python dictionary gets too large. The easiest option for you may be to split the large file into 10-20 smaller files and extend your code to loop over the smaller files.