Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Allow word choosing strategy to be injected into the transformer

  • Loading branch information...
commit 3a203804f2b08d37c0a6505b60a854add6e871dc 1 parent f1748e9
George Hemmings authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 lib/trigram/transformer.rb
4 lib/trigram/transformer.rb
@@ -4,11 +4,11 @@
4 4
5 5 module Trigram
6 6 class Transformer
7   - def initialize(input)
  7 + def initialize(input, word_chooser = Proc.new { |words| words.sample })
8 8 @input = input
9 9 analysis = Analyser.analyse(input)
10 10 table = Table.new(analysis)
11   - @generator = Generator.new(table)
  11 + @generator = Generator.new(table, word_chooser)
12 12 end
13 13
14 14 def generate_new_text

0 comments on commit 3a20380

Please sign in to comment.
Something went wrong with that request. Please try again.