lib/two_chainz/generator.rb
def hear(words)
    words         = sanitize(words)
    previous_word = nil

    words.scan(/[\w\':+#]+/) do |current_word|
      # Skip the word if it's in the blacklist
      next if WORD_BLACKLIST.include?(current_word)

      # Increment the number of times the current word has been the successor of
      # the previous word.
      @words_table.increment(previous_word, current_word)

      previous_word = current_word
    end

    # Record what the last word was.
    @words_table.increment(previous_word) if previous_word

    true
  end
# Public: Hear some words and remember them for future spitting.
#
# words - String of words to hear.
#
# Returns nothing.
Hear some words and remember them for future spitting.
words - String of words to hear.

Returns nothing.
Hear some words and remember them for future spitting . words - String of words to hear . Returns nothing .
def hear(words)
    words         = sanitize(words)
    previous_word = nil
    words.scan(/[\w\':+#]+/) do |current_word|
      next if WORD_BLACKLIST.include?(current_word)
      @words_table.increment(previous_word, current_word)
      previous_word = current_word
    end
    @words_table.increment(previous_word) if previous_word
    true
  end
def hear ( words ) words = sanitize ( words ) previous_word = nil words . scan ( / [ \w \' :+#]+ / ) do | current_word | next if WORD_BLACKLIST . include? ( current_word ) @words_table . increment ( previous_word , current_word ) previous_word = current_word end @words_table . increment ( previous_word ) if previous_word true end
Public: Hear some words and remember them for future spitting.
Public : Hear some words and remember them for future spitting .
# Skip the word if it's in the blacklist # Increment the number of times the current word has been the successor of # the previous word. # Record what the last word was.
words