BigramModel.java provided by Prof.Mooney.