Module: MarkovTextGenerator

Defined in:
lib/markov_text_generator.rb,
lib/markov_text_generator/api.rb,
lib/markov_text_generator/version.rb,
lib/markov_text_generator/api/utils.rb,
lib/markov_text_generator/api/model.rb,
lib/markov_text_generator/api/errors.rb,
lib/markov_text_generator/api/interface.rb,
lib/markov_text_generator/api/model/knowledge.rb,
lib/markov_text_generator/api/utils/data_structures.rb,
lib/markov_text_generator/api/model/knowledge/entry.rb,
lib/markov_text_generator/api/model/knowledge/registry.rb,
lib/markov_text_generator/api/utils/data_structures/linked_list.rb,
lib/markov_text_generator/api/utils/data_structures/linked_list/impl.rb,
lib/markov_text_generator/api/utils/data_structures/linked_list/node.rb

Defined Under Namespace

Modules: Api

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.loggerObject



26
27
28
# File 'lib/markov_text_generator.rb', line 26

def logger
  @logger ||= Logger.new $stdout
end

.newObject

Examples:


model = MarkovTextGenerator.new

model.train 'hello world, hello buddy, hello world'

model.predict_next_word_for 'hello'

#=> 'world' # Most likely


22
23
24
# File 'lib/markov_text_generator.rb', line 22

def new
  Api::Model.new
end

.rootObject



30
31
32
# File 'lib/markov_text_generator.rb', line 30

def root
  @root ||= Pathname File.expand_path('../../', __FILE__)
end