markov_chain 0.1.0 → 0.2.0

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.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.2.0 / 2011-10-31
2
+
3
+ * MarkovChain.generate is now called MarkovChain.grow_string to more closely
4
+ reflect the specific nature of this method.
5
+
1
6
  === 0.1.0 / 2011-10-31
2
7
 
3
- Initial release.
8
+ * Initial release.
data/README.rdoc CHANGED
@@ -25,3 +25,32 @@ A simple library for creating Markov chains from strings of text.
25
25
 
26
26
  # Specify the max number of words returned and the size of those words
27
27
  MarkovChain.generate('foo', :max_size => 6, :max_word_length => 4) # ["foo", "foon", "foong", "foone", "foona", "foongl"]
28
+
29
+ == INSTALL:
30
+
31
+ gem install markov_chain
32
+
33
+ == LICENSE:
34
+
35
+ (The MIT License)
36
+
37
+ Copyright (c) 2011 Alex Rabarts
38
+
39
+ Permission is hereby granted, free of charge, to any person obtaining
40
+ a copy of this software and associated documentation files (the
41
+ 'Software'), to deal in the Software without restriction, including
42
+ without limitation the rights to use, copy, modify, merge, publish,
43
+ distribute, sublicense, and/or sell copies of the Software, and to
44
+ permit persons to whom the Software is furnished to do so, subject to
45
+ the following conditions:
46
+
47
+ The above copyright notice and this permission notice shall be
48
+ included in all copies or substantial portions of the Software.
49
+
50
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
51
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
52
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
53
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
54
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
55
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
56
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
data/lib/markov_chain.rb CHANGED
@@ -8,7 +8,7 @@ class MarkovChain
8
8
  @__instance__ ||= new
9
9
  end
10
10
 
11
- def generate seed, options = {}
11
+ def grow_string seed, options = {}
12
12
  raise ArgumentError, 'Seed must be at least two characters' unless seed.length > 1
13
13
 
14
14
  max_word_length = seed.length + 8
@@ -0,0 +1,51 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{markov_chain}
8
+ s.version = "0.2.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Alex Rabarts"]
12
+ s.date = %q{2011-10-31}
13
+ s.description = %q{Markov chain generator}
14
+ s.email = %q{alexrabarts@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ "Gemfile",
20
+ "Gemfile.lock",
21
+ "History.txt",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "lib/dictionaries/american_english",
26
+ "lib/markov_chain.rb",
27
+ "markov_chain.gemspec",
28
+ "test/markov_chain_test.rb",
29
+ "test/test_helper.rb"
30
+ ]
31
+ s.homepage = %q{http://github.com/alexrabarts/markov_chain}
32
+ s.require_paths = ["lib"]
33
+ s.rubygems_version = %q{1.4.2}
34
+ s.summary = %q{A simple Markov chain generator.}
35
+
36
+ if s.respond_to? :specification_version then
37
+ s.specification_version = 3
38
+
39
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
40
+ s.add_runtime_dependency(%q<rake>, [">= 0"])
41
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
42
+ else
43
+ s.add_dependency(%q<rake>, [">= 0"])
44
+ s.add_dependency(%q<jeweler>, [">= 0"])
45
+ end
46
+ else
47
+ s.add_dependency(%q<rake>, [">= 0"])
48
+ s.add_dependency(%q<jeweler>, [">= 0"])
49
+ end
50
+ end
51
+
@@ -8,6 +8,6 @@ class MarkovChainTest < Test::Unit::TestCase
8
8
  end
9
9
 
10
10
  should 'generate 100 words by default' do
11
- assert_equal 100, MarkovChain.generate('foo').length
11
+ assert_equal 100, MarkovChain.grow_string('foo').length
12
12
  end
13
13
  end
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: 27
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Rabarts
@@ -63,6 +63,7 @@ files:
63
63
  - VERSION
64
64
  - lib/dictionaries/american_english
65
65
  - lib/markov_chain.rb
66
+ - markov_chain.gemspec
66
67
  - test/markov_chain_test.rb
67
68
  - test/test_helper.rb
68
69
  has_rdoc: true