fixed some bugs in getWordsCount and getSentences