Class: ChainPunk::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/chain_punk/generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(frequency_table) ⇒ Generator



5
6
7
# File 'lib/chain_punk/generator.rb', line 5

def initialize(frequency_table)
  @frequency_table = frequency_table
end

Instance Method Details

#generate(grapheme_count, options = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/chain_punk/generator.rb', line 9

def generate(grapheme_count, options = {})
  boundary = options[:boundary] || ''
  index_size = options[:index_size] || 1
  seeds = options[:seeds]
  create_phrase(grapheme_count, seeds, index_size, boundary, options[:closure])
end