modifications to ngram methods for matrix to work with wordlist class