fixed unknown word error
counts occurances of words in input sentences