def markov_corpus(file, gram_size)
      grams = {}

      # Corpus contains a list of words, separated by newlines
      File.foreach(file) do |word|
        word = word.downcase.delete('-')
        gram_size.downto(1) do |current_gram_size|
          markov_update_count! grams, word, current_gram_size
        end
      end

      @data_store.store_data(:grams, grams)
      grams
    end
def markov_corpus(file, gram_size)
      grams = {}

      # Corpus contains a list of words, separated by newlines
      File.foreach(file) do |word|
        word = word.downcase.delete('-')
        gram_size.downto(1) do |current_gram_size|
          markov_update_count! grams, word, current_gram_size
        end
      end

      @data_store.store_data(:grams, grams)
      grams
    end
Generate a MarkovWords corpus from a datafile, with a given size of
 n-gram.  Returns a hash of "grams", which are a map of a letter to the
 frequency of the letters that follow it, eg: {"c" => {"a" => 1, "b" =>
 2}}