literate_randomizer 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -4
- data/lib/literate_randomizer/version.rb +1 -1
- data/literate_randomizer.gemspec +1 -1
- data/spec/literate_randomizer_spec.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -22,6 +22,7 @@ Example:
|
|
22
22
|
|
23
23
|
require 'literate_randomizer'
|
24
24
|
|
25
|
+
lr = LiterateRandomizer.create
|
25
26
|
lr.word
|
26
27
|
# => "frivolous"
|
27
28
|
lr.sentance
|
@@ -31,7 +32,7 @@ Example:
|
|
31
32
|
|
32
33
|
When creating a randomizer, there are a few options. The source_material should be a large selection of english text. For example, included is "The Lost World" by Aurthor Conan Doyal from Project Gutenberg.
|
33
34
|
|
34
|
-
options:
|
35
|
+
LiterateRandomizer.create options:
|
35
36
|
:source_material => string OR
|
36
37
|
:source_material_file => filename
|
37
38
|
:randomizer => Random.new(seed=0)
|
@@ -39,7 +40,7 @@ When creating a randomizer, there are a few options. The source_material should
|
|
39
40
|
|
40
41
|
Here are the options for the paragraph method:
|
41
42
|
|
42
|
-
options:
|
43
|
+
LiterateRandomizer.create.paragraph options:
|
43
44
|
:first_word => nil - the start word
|
44
45
|
:words => range or int - number of words in sentance
|
45
46
|
:sentances => range or int - number of sentances in paragraph
|
@@ -54,10 +55,10 @@ If you just want to use a single, global instance, you can initialize and access
|
|
54
55
|
|
55
56
|
# initialize on first call
|
56
57
|
# use the same options as .create
|
57
|
-
LiterateRandomizer
|
58
|
+
LiterateRandomizer.global(options={})
|
58
59
|
|
59
60
|
# after the first call, options are ignored and the existing randomizer is returned
|
60
|
-
LiterateRandomizer
|
61
|
+
LiterateRandomizer.global.sentance
|
61
62
|
# => "Muscular arms round opening of sorts while Lord John Roxton."
|
62
63
|
|
63
64
|
## Contributing
|
data/literate_randomizer.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.email = ["shanebdavis@gmail.com"]
|
11
11
|
gem.description = %q{A random sentence and paragraph generator gem. Using Markov chains, this generates near-english prose.}
|
12
12
|
gem.summary = %q{A random sentence and paragraph generator gem. Using Markov chains, this generates near-english prose.}
|
13
|
-
gem.homepage = ""
|
13
|
+
gem.homepage = "https://github.com/Imikimi-LLC/literate_randomizer"
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($/)
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: literate_randomizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -46,7 +46,7 @@ files:
|
|
46
46
|
- lib/literate_randomizer/version.rb
|
47
47
|
- literate_randomizer.gemspec
|
48
48
|
- spec/literate_randomizer_spec.rb
|
49
|
-
homepage:
|
49
|
+
homepage: https://github.com/Imikimi-LLC/literate_randomizer
|
50
50
|
licenses: []
|
51
51
|
post_install_message:
|
52
52
|
rdoc_options: []
|