Fix a memory leak.
1. Remove context. 2. Change the word pos to the char pos in the document. 3.Calculate the word count. 4. Modify parser.