Implement wordOccurrences