marky_markov 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,15 @@
1
+ # @private
1
2
  class OneWordDictionary
2
3
  attr_accessor :dictionary
3
4
  def initialize
4
5
  @dictionary = {}
5
6
  end
6
7
 
8
+ # If File does not exist.
7
9
  class FileNotFoundError < Exception
8
10
  end
9
11
 
12
+ # Open supplied text file:
10
13
  def open_source(source)
11
14
  if File.exists?(source)
12
15
  File.open(source, "r").read.split
@@ -1,3 +1,4 @@
1
+ # @private
1
2
  class OneWordSentenceGenerator
2
3
  def initialize(dictionary)
3
4
  @dictionary = dictionary
@@ -1,6 +1,7 @@
1
1
  require 'yajl'
2
2
  require_relative 'two_word_dictionary'
3
3
 
4
+ # @private
4
5
  class PersistentDictionary < TwoWordDictionary
5
6
  def initialize(dictionary)
6
7
  @dictionarylocation = "#{dictionary}.mmd"
@@ -1,5 +1,6 @@
1
1
  require_relative 'one_word_dictionary'
2
2
 
3
+ # @private
3
4
  class TwoWordDictionary < OneWordDictionary
4
5
  def parse_source(source, file=true)
5
6
  contents = file ? open_source(source) : contents = source.split
@@ -1,5 +1,6 @@
1
1
  require_relative 'one_word_sentence_generator'
2
2
 
3
+ # @private
3
4
  class TwoWordSentenceGenerator < OneWordSentenceGenerator
4
5
  def generate(wordcount)
5
6
  sentence = []
@@ -0,0 +1 @@
1
+ {"The cat":{"likes":1},"cat likes":{"pie":1},"likes pie":{"and":1},"pie and":{"chainsaws":1},"and chainsaws":{}}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marky_markov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yajl-ruby
16
- requirement: &70100468290580 !ruby/object:Gem::Requirement
16
+ requirement: &70096919809000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -24,7 +24,7 @@ dependencies:
24
24
  version: 2.0.0
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *70100468290580
27
+ version_requirements: *70096919809000
28
28
  description: ! "MarkyMarkov makes it easy to generate simply Markov Chains based upon
29
29
  input from\n either a source file or a string. While usable as a module in your
30
30
  code it can also be called on\n from the command line and piped into like a stanard
@@ -38,6 +38,23 @@ extra_rdoc_files:
38
38
  files:
39
39
  - README.md
40
40
  - bin/marky_markov
41
+ - doc/MarkyMarkov.html
42
+ - doc/MarkyMarkov/Dictionary.html
43
+ - doc/MarkyMarkov/TemporaryDictionary.html
44
+ - doc/_index.html
45
+ - doc/class_list.html
46
+ - doc/css/common.css
47
+ - doc/css/full_list.css
48
+ - doc/css/style.css
49
+ - doc/file.README.html
50
+ - doc/file_list.html
51
+ - doc/frames.html
52
+ - doc/index.html
53
+ - doc/js/app.js
54
+ - doc/js/full_list.js
55
+ - doc/js/jquery.js
56
+ - doc/method_list.html
57
+ - doc/top-level-namespace.html
41
58
  - lib/marky_markov.rb
42
59
  - lib/marky_markov/one_word_dictionary.rb
43
60
  - lib/marky_markov/one_word_sentence_generator.rb
@@ -50,6 +67,7 @@ files:
50
67
  - spec/marky_markov/two_word_dict_spec.rb
51
68
  - spec/marky_markov/two_word_sentence_spec.rb
52
69
  - spec/spec_helper.rb
70
+ - spec/textdictcompare.mmd
53
71
  homepage: http://www.thefurd.com
54
72
  licenses: []
55
73
  post_install_message: