marky_markov 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +0 -1
- data/doc/MarkyMarkov.html +120 -0
- data/doc/MarkyMarkov/Dictionary.html +415 -0
- data/doc/MarkyMarkov/TemporaryDictionary.html +588 -0
- data/doc/_index.html +136 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.README.html +162 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +162 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +110 -0
- data/doc/top-level-namespace.html +105 -0
- data/lib/marky_markov.rb +8 -1
- data/lib/marky_markov/one_word_dictionary.rb +3 -0
- data/lib/marky_markov/one_word_sentence_generator.rb +1 -0
- data/lib/marky_markov/persistent_dictionary.rb +1 -0
- data/lib/marky_markov/two_word_dictionary.rb +1 -0
- data/lib/marky_markov/two_word_sentence_generator.rb +1 -0
- data/spec/textdictcompare.mmd +1 -0
- metadata +21 -3
@@ -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
|
@@ -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.
|
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: &
|
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: *
|
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:
|