markov_chain 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.2.1 / 2011-10-31
2
+
3
+ * Fixes issue reading dictionary passed in as symbol or string.
4
+
1
5
  === 0.2.0 / 2011-10-31
2
6
 
3
7
  * MarkovChain.generate is now called MarkovChain.grow_string to more closely
data/README.rdoc CHANGED
@@ -9,7 +9,7 @@ A simple library for creating Markov chains from strings of text.
9
9
  require 'markov_chain'
10
10
 
11
11
  # Generate a chain and return the results
12
- MarkovChain.generate 'foo' # ["foo", "foon", "foone", "foona", "foong", "foonan", "foones" ...
12
+ MarkovChain.grow_string 'foo' # ["foo", "foon", "foone", "foona", "foong", "foonan", "foones" ...
13
13
 
14
14
  # Explicitly load the default dictionary
15
15
  MarkovChain.load_dictionary!
@@ -24,7 +24,13 @@ A simple library for creating Markov chains from strings of text.
24
24
  MarkovChain.dictionary # '/path/to/dictionary'
25
25
 
26
26
  # Specify the max number of words returned and the size of those words
27
- MarkovChain.generate('foo', :max_size => 6, :max_word_length => 4) # ["foo", "foon", "foong", "foone", "foona", "foongl"]
27
+ MarkovChain.grow_string('foo', :max_size => 6, :max_word_length => 4) # ["foo", "foon", "foong", "foone", "foona", "foongl"]
28
+
29
+ == LIMITATIONS
30
+
31
+ This library currently only supports the extension of words, character by
32
+ character. In the future, it ought to be able to build a Markov Chain using
33
+ any kind of input array.
28
34
 
29
35
  == INSTALL:
30
36
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/markov_chain.rb CHANGED
@@ -57,8 +57,8 @@ class MarkovChain
57
57
 
58
58
  dictionary = File.read file
59
59
 
60
- if file
61
- file.each do |line|
60
+ if dictionary
61
+ dictionary.each do |line|
62
62
  s = line.strip
63
63
  instance.add_str s
64
64
  end
data/markov_chain.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{markov_chain}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alex Rabarts"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markov_chain
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Rabarts