Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow word choosing strategy to be injected into the transformer

  • Loading branch information...
commit 3a203804f2b08d37c0a6505b60a854add6e871dc 1 parent f1748e9
George Hemmings authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/trigram/transformer.rb
4 lib/trigram/transformer.rb
View
@@ -4,11 +4,11 @@
module Trigram
class Transformer
- def initialize(input)
+ def initialize(input, word_chooser = Proc.new { |words| words.sample })
@input = input
analysis = Analyser.analyse(input)
table = Table.new(analysis)
- @generator = Generator.new(table)
+ @generator = Generator.new(table, word_chooser)
end
def generate_new_text
Please sign in to comment.
Something went wrong with that request. Please try again.