Class: PokemonNameGenerator::CLI::Commands::Generate
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- PokemonNameGenerator::CLI::Commands::Generate
- Defined in:
- lib/pokemon_name_generator/cli/commands.rb
Instance Method Summary collapse
Instance Method Details
#call(**options) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/pokemon_name_generator/cli/commands.rb', line 26 def call(**) corpus = Corpus.new algorithm = case .fetch(:algorithm) when "naive" then Naive.new(corpus.pokemon_phonemes) when "markov" then Markov.new(corpus.pokemon_phonemes, context_length: .fetch(:context).to_i) end .fetch(:number).to_i.times { puts algorithm.generate_name } end |