markov_chain 0.1.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/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source :rubygems
2
+
3
+ gem 'rake'
4
+
5
+ group :development do
6
+ gem 'jeweler'
7
+ end
8
+
9
+ group :test do
10
+ gem 'shoulda'
11
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,18 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ git (1.2.5)
5
+ jeweler (1.6.4)
6
+ bundler (~> 1.0)
7
+ git (>= 1.2.5)
8
+ rake
9
+ rake (0.9.2.2)
10
+ shoulda (2.11.3)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ jeweler
17
+ rake
18
+ shoulda
data/History.txt ADDED
@@ -0,0 +1,3 @@
1
+ === 0.1.0 / 2011-10-31
2
+
3
+ Initial release.
data/README.rdoc ADDED
@@ -0,0 +1,27 @@
1
+ = Markov Chain
2
+
3
+ == DESCRIPTION
4
+
5
+ A simple library for creating Markov chains from strings of text.
6
+
7
+ == SYNOPSIS
8
+
9
+ require 'markov_chain'
10
+
11
+ # Generate a chain and return the results
12
+ MarkovChain.generate 'foo' # ["foo", "foon", "foone", "foona", "foong", "foonan", "foones" ...
13
+
14
+ # Explicitly load the default dictionary
15
+ MarkovChain.load_dictionary!
16
+
17
+ # Load a custom dictionary
18
+ MarkovChain.load_dictionary! '/path/to/dictionary'
19
+
20
+ # Check if a dictionary is loaded
21
+ MarkovChain.dictionary_loaded?
22
+
23
+ # Check the path of the loaded dictionary
24
+ MarkovChain.dictionary # '/path/to/dictionary'
25
+
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"]
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ require 'rake'
2
+
3
+ begin
4
+ require 'jeweler'
5
+ Jeweler::Tasks.new do |s|
6
+ s.name = 'markov_chain'
7
+ s.summary = %Q{
8
+ A simple Markov chain generator.
9
+ }
10
+ s.email = 'alexrabarts@gmail.com'
11
+ s.homepage = 'http://github.com/alexrabarts/markov_chain'
12
+ s.description = 'Markov chain generator'
13
+ s.authors = ['Alex Rabarts']
14
+ end
15
+ rescue LoadError
16
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
17
+ end
18
+
19
+ require 'rake/testtask'
20
+ Rake::TestTask.new(:test) do |t|
21
+ t.libs << 'lib' << 'test'
22
+ t.pattern = 'test/**/*_test.rb'
23
+ t.verbose = false
24
+ end
25
+
26
+ task :default => :test
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0