markov_words 0.2.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37eb273f25ad18c46a9c3a66c6467222af81817c
4
- data.tar.gz: 8ad07cb6d169686909c60d3f492e0bdedd2b4a23
3
+ metadata.gz: 51ad9f97683566b1d304b1b4a65c9468e5a9ec16
4
+ data.tar.gz: 83d124fbaa55ec819de036a82f8e02a8401f68b7
5
5
  SHA512:
6
- metadata.gz: 1c04a14d059551ecff738aee90e93c60f0ec9750922e9c076392cc09f013ec9e7231dcb7b42811a3ba00181638b82e21b3ab758d892d0d3e8dd288602378d408
7
- data.tar.gz: 394f7499450531865e92164708c95ef4d0b6c39ecb8f2e7bb680830f428714669f6b2d86977c40f0422fe51ee7ff5edc04f8b7b87f754d88387673d39f700af7
6
+ metadata.gz: 161f176055d116252078f2435413096097d40337a6891f804e82f99923c79ddaeb689df4fdc27df09bb743339fa1f18fd0c04707c9d89ea521b7ffa456d3b12a
7
+ data.tar.gz: '0291eed8a0eb463aa20904a1c6376522477eab5cbfd88f7577e91bc97bcf61fc560397a99694e680f0f4345718dc3b31b6575786a98045495d0183ae71e9ac0c'
data/.rubocop.yml ADDED
@@ -0,0 +1,4 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+ Metrics/ClassLength:
4
+ Max: 150
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- markov_words (0.2.3)
4
+ markov_words (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -13,6 +13,9 @@ GEM
13
13
  coderay (~> 1.1.0)
14
14
  method_source (~> 0.9.0)
15
15
  rake (10.5.0)
16
+ sqlite3 (1.3.13)
17
+ sqlite3-ruby (1.3.3)
18
+ sqlite3 (>= 1.3.3)
16
19
  yard (0.9.12)
17
20
 
18
21
  PLATFORMS
@@ -24,6 +27,7 @@ DEPENDENCIES
24
27
  minitest (~> 5.0)
25
28
  pry (~> 0.11)
26
29
  rake (~> 10.0)
30
+ sqlite3-ruby (~> 1.3)
27
31
  yard (~> 0.6)
28
32
 
29
33
  BUNDLED WITH
data/README.md CHANGED
@@ -7,8 +7,6 @@ As it turns out, [Markov Chains](http://www.thagomizer.com/blog/2017/11/07/marko
7
7
 
8
8
  While there are [quite](https://github.com/dabrorius/markov-noodles) a [few](https://github.com/dabrorius/markov-noodles) [wonderful](https://github.com/imikimi/literate_randomizer) Ruby libraries that do this, they all focus either on _actual_ English words, or on creating random _sentences_ but not words. We created this library to do the same thing, but with words, hence the name `MarkovWords`.
9
9
 
10
-
11
-
12
10
  ## Installation
13
11
 
14
12
  Add this line to your application's Gemfile:
@@ -32,19 +30,19 @@ Basic usage is as follows:
32
30
  ```ruby
33
31
  require 'markov_words'
34
32
 
35
- words = MarkovWords::Words.new
33
+ generator = MarkovWords::Generator.new
36
34
  # returns a random word
37
- puts words.word
35
+ puts generator.word
38
36
  ```
39
37
 
40
- You might prefer using a number of n-grams (letter combinations being tracked) higher than the default number (which is 2). We've found that the higher you go, the more accurate words tend to sound, at the expense of having to generate a much larger database of n-gram => letter correspondences. In the case of the default `/usr/share/dict` file, `gram_size = 1` yields a roughly `3.2Kb` database size; `gram_size = 2` yields `18Kb`. Once you get up to `gram_size = 8`, you're into ~`30MB` territory, which slows things down a bit.
38
+ You might prefer using a number of n-grams (letter combinations being tracked) higher than the default number (which is 2). We've found that the higher you go, the more accurate words tend to sound, as the likelihood that you've started with a partial word the entire length of a word from your dictionary goes up. The increased "real-sounding-ness" comes at the expense of having to generate a much larger database of n-gram => letter correspondences, and accordingly slower access times.
41
39
 
42
40
  To set gram_size:
43
41
 
44
42
  ```ruby
45
- words = MarkovWords::words.new(gram_size: 8)
43
+ generator = MarkovWords::Generator.new(gram_size: 7)
46
44
  # Will take a while the first time, while the database is created.
47
- puts words.word
45
+ puts generator.word
48
46
  ```
49
47
 
50
48
  ### Dictionary
@@ -53,48 +51,58 @@ By default, `MarkovWords` will use the system dictionary located (on Macs) in `/
53
51
 
54
52
  ```ruby
55
53
  # eg to generate random proper names instead of English-sounding words.
56
- words = MarkovWords::Words.new(corpus_file: '/usr/share/dict/propernames')
54
+ generator = MarkovWords::Generator.new(corpus_file: '/usr/share/dict/propernames')
57
55
  ```
58
56
 
59
57
  This is pretty great, because it means that if you have a dictionary to emulate, you can make words that sound like anything!
60
58
 
61
59
  ### Data Storage
62
60
 
63
- `MarkovWords` stores its database of n-gram concurrences in `Marshal`'ed text files on disk and loads it into memory when necessary. You can control the location of the data file with:
61
+ `MarkovWords` stores its database of n-gram concurrences on disk and loads it into memory when necessary. You can control the location of the data file with:
62
+
63
+ ```ruby
64
+ # eg to store the data in /tmp/markov.data
65
+ generator = MarkovWords::Generator.new(data_file: /tmp/markov.data)
66
+ ```
67
+
68
+ You can also clear out the contents of the data file (because `MarkovWords` will re-use it by default), by passing `flush_data: true`:
64
69
 
65
70
  ```ruby
66
71
  # eg to store the data in /tmp/markov.data
67
- words = MarkovWords::Words.new(data_file: /tmp/markov.data)
72
+ generator = MarkovWords::Generator.new(data_file: /tmp/markov.data, flush_data: true)
68
73
  ```
69
74
 
75
+
70
76
  ### Caching
71
77
 
72
- Because calculation can get slow, especially at high n-gram sizess, `MarkovWords` will cache 100 words into a `words_ngramsize.cache` file by default. If you want to control caching, you can adjust caching parameters eg:
78
+ Because calculation can get slow, especially at high n-gram sizes, `MarkovWords` will cache 100 words by default . If you want to control caching, you can adjust caching parameters eg:
73
79
 
74
80
  ```ruby
75
81
  # For no caching whatsoever
76
- words = MarkovWords::Words.new(cache: false)
82
+ generator = MarkovWords::Generator.new(perform_caching: false)
77
83
 
78
84
  # To change the number of pre-computed/stored words to 1000:
79
- words = MarkovWords::Words.new(cache_size: 1000)
80
-
81
- # To change the location of the cache file to /tmp/markov.cache:
82
- words = MarkovWords::Words.new(cache_file: '/tmp/markov.cache')
83
-
84
- # Of course, options can be combined:
85
- words = MarkovWords::Words.new(
86
- cache_file: '/tmp/markov.cache',
87
- cache_size: 1000
88
- )
85
+ generator = MarkovWords::Generator.new(cache_size: 1000)
89
86
  ```
90
87
 
91
- Lastly, you can "top off" the cache to make sure it's full with:
88
+ You can "top off" the cache to make sure it's full with:
92
89
 
93
90
  ```ruby
94
- words = MarkovWords::Words.new
95
- words.refresh_cache
91
+ generator = MarkovWords::Generator.new
92
+ generator.refresh_cache
96
93
  ```
97
94
 
95
+ ## Change Log
96
+
97
+ - `1.0.0` introduced a couple of breaking changes:
98
+ - `Words` class renamed to `Generator`.
99
+ - `Generator`:
100
+ - `cache: [boolean]` parameter was re-named to `perform_caching: [boolean]`.
101
+ - Removed a lot of `attr_accessor` variables such as `data_store`, `min_length`, `max_length` etc., in favor of a leaner + cleaner API.
102
+ - The cache file is no longer persisted to disk separately (because `FileStore` is using SQLite instead of direct-disk storage).
103
+ - `0.2.x` was all about Rubocop compliance, so it was a few method refactors but nothing major.
104
+ - `0.1.0` initial commit
105
+
98
106
  ## Development
99
107
 
100
108
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rake/testtask'
3
5
 
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen-string-literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'markov_words'
@@ -1,39 +1,68 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'securerandom'
4
+ require 'sqlite3'
2
5
 
3
6
  module MarkovWords
4
- # Utility for persisting arbitrary data to disk as Marshal'ed Ruby objects
7
+ # Utility for persisting arbitrary data to disk.
5
8
  class FileStore
6
- attr_reader :file_path
7
- attr_reader :data
8
-
9
9
  # @option opts [String] :file_path Path and name for where the file should
10
10
  # be stored.
11
11
  # @option opts [Boolean] :flush_data Do you want the file to be cleared on
12
12
  # open?
13
13
  def initialize(opts)
14
14
  @file_path = opts.fetch :file_path, "/tmp/#{SecureRandom.base64}"
15
- delete_if_exists(@file_path) if opts[:flush_data]
15
+ initialize_db
16
+ empty_db if opts[:flush_data]
16
17
  end
17
18
 
18
- # Store arbitary data into file storage
19
+ # Store arbitary data, named with a `key`
20
+ # @param key [Symbol] Unique key for later data retrieval
19
21
  # @param data [Object] Any Marshal-able object
20
- def store_data(data)
21
- File.open(@file_path, 'wb') { |f| Marshal.dump(data, f) }
22
+ def store_data(key = :discard, data = nil)
23
+ key = key.to_s unless key.is_a? String
24
+ if data_exists(key)
25
+ @db.execute 'UPDATE data SET value = ? WHERE key = ?',
26
+ [Marshal.dump(data), key]
27
+ else
28
+ @db.execute 'INSERT INTO data VALUES ( ?, ? )',
29
+ [key, Marshal.dump(data)]
30
+ end
22
31
  end
23
32
 
24
- # Retrieve whatever data is stored in the file + return it
25
- def retrieve_data
26
- result = nil
27
- if File.exist?(@file_path)
28
- File.open(@file_path, 'r') { |f| result = Marshal.load(f) }
29
- end
30
- result
33
+ # Retrieve whatever data is stored in at `key`, and return it!
34
+ def retrieve_data(key = '')
35
+ key = key.to_s unless key.is_a? String
36
+ data_array = @db.execute 'SELECT value FROM data WHERE key = ?', key
37
+ Marshal.load(data_array[0][0]) unless data_array[0].nil?
31
38
  end
32
39
 
33
40
  private
34
41
 
35
- def delete_if_exists(path)
36
- File.delete path if File.exist? path
42
+ def create_initial_tables
43
+ @db.execute <<~SQL
44
+ create table data (
45
+ key varchar(5),
46
+ value binary
47
+ );
48
+ SQL
49
+ end
50
+
51
+ def data_exists(key)
52
+ query = 'SELECT count(*) FROM data WHERE key = ?'
53
+ @db.execute(query, key)[0][0].positive?
54
+ end
55
+
56
+ def empty_db
57
+ @db.execute 'delete from data'
58
+ end
59
+
60
+ def initialize_db
61
+ @db = SQLite3::Database.new @file_path
62
+ table = @db.execute("SELECT name FROM sqlite_master
63
+ WHERE type='table'
64
+ AND name='data';").first
65
+ create_initial_tables unless table
37
66
  end
38
67
  end
39
68
  end
@@ -1,38 +1,41 @@
1
+ # frozen-string-literal: true
2
+
1
3
  module MarkovWords
2
4
  # This class takes care of word generation, caching, and data storage.
3
- class Words
4
- # Perform caching? Defaults to true.
5
- attr_reader :cache
6
- # File location where you want to store the cache
7
- attr_reader :cache_file
8
- # How many words you want to store in the cache?
9
- attr_reader :cache_size
10
- # Object for storing + retrieving cache data from persistent storage
11
- attr_reader :cache_store
12
- # Your dictionary of words. Defaults to /usr/share/dict/words.
13
- attr_reader :corpus_file
14
- # Where should your database be stored on disk?
15
- attr_reader :data_file
16
- # Object for storing + retrieving n-gram data from persistent storage
17
- attr_reader :data_store
18
- # The database of "grams" (word/count combinations), stored on the disk and
19
- # loaded into this variable in memory when generating words.
20
- attr_reader :grams
21
- # Number of n-grams to compute for your database. Defaults to 2
22
- attr_reader :gram_size
23
- # Max generated word length. Defaults to 16
24
- attr_reader :max_length
25
- # Minimum generated word length. Defaults to 3. NOTE: If your corpus size
26
- # is very small (<1000 words or so), it's hard to guarantee a min_length
27
- # because so many n-grams will have no association, which terminates word
28
- # generation.
29
- attr_reader :min_length
5
+ class Generator
6
+ # The current list of cached words.
7
+ # @return [Array<String>] All words in the cache.
8
+ def cache
9
+ @data_store.retrieve_data(:cache)
10
+ end
11
+
12
+ # The current database of n-gram mappings
13
+ # @return [Hash] n-gram database
14
+ def grams
15
+ @grams = @grams ||
16
+ @data_store.retrieve_data(:grams) ||
17
+ markov_corpus(@corpus_file, @gram_size)
18
+ end
30
19
 
31
20
  # Create a new "Words" object
32
- # @param opts [Hash] options sent to the object. Any of the object
33
- # attributes (eg `:cache_file` or `:gram_size`) are valid parameters to
34
- # add to the `opts` hash.
35
- # @return [Words] A `MarkovWords::Words` object.
21
+ # @param opts [Hash]
22
+ # @option opts [Integer] :cache_size How many words to pre-calculate +
23
+ # store in the cache for quick retrieval
24
+ # @option opts [String] :corpus_file ('/usr/share/dict/words') Your
25
+ # dictionary of words.
26
+ # @option opts [String] :data_file Location where calculations are
27
+ # persisted to disk.
28
+ # @option opts [String] :flush_data Remove any previously-stored data from
29
+ # an existing database file.
30
+ # @option opts [Integer] :gram_size (2) Number of n-grams to compute for
31
+ # your database.
32
+ # @option opts [Integer] :max_length (16) Max generated word length.
33
+ # @option opts [Integer] :min_length (3) Minimum generated word length.
34
+ # NOTE: If your corpus size is very small (<1000 words or so), it's hard
35
+ # to guarantee a min_length because so many n-grams will have no
36
+ # association, which terminates word generation.
37
+ # @option opts [Boolean] :perform_caching (true) Perform caching?
38
+ # @return [Words] A `MarkovWords::Generator` object.
36
39
  def initialize(opts = {})
37
40
  @grams = nil
38
41
  @gram_size = opts.fetch :gram_size, 2
@@ -44,13 +47,14 @@ module MarkovWords
44
47
  end
45
48
 
46
49
  # "Top off" the cache of stored words, and ensure that it's at
47
- # `@cache_size`. If `@cache` is set to `false`, returns an empty array.
50
+ # `@cache_size`. If `perform_caching` is set to `false`, returns an empty
51
+ # array.
48
52
  # @return [Array<String>] All words in the cache.
49
53
  def refresh_cache
50
- if @cache
51
- words_array = @cache_store.retrieve_data
54
+ if @perform_caching
55
+ words_array = @data_store.retrieve_data(:cache) || []
52
56
  words_array << generate_word while words_array.length < @cache_size
53
- @cache_store.store_data words_array
57
+ @data_store.store_data(:cache, words_array)
54
58
  words_array
55
59
  else
56
60
  []
@@ -60,7 +64,7 @@ module MarkovWords
60
64
  # Generate a new word, or return one from the cache if available.
61
65
  # @return [String] The word.
62
66
  def word
63
- if @cache
67
+ if @perform_caching
64
68
  load_word_from_cache
65
69
  else
66
70
  generate_word
@@ -69,22 +73,6 @@ module MarkovWords
69
73
 
70
74
  private
71
75
 
72
- def initialize_cache(opts)
73
- @cache = opts.fetch :cache, true
74
- @cache_file = opts.fetch :cache_file,
75
- "tmp/markov_words_#{@gram_size}.cache"
76
- @cache_size = opts.fetch :cache_size, 70
77
- @cache_store = FileStore.new(file_path: @cache_file)
78
- end
79
-
80
- def initialize_data(opts)
81
- @corpus_file = opts.fetch :corpus_file,
82
- '/usr/share/dict/words'
83
- @data_file = opts.fetch :data_file,
84
- "tmp/markov_words_#{@gram_size}.data"
85
- @data_store = FileStore.new(file_path: @data_file)
86
- end
87
-
88
76
  def contains_vowel?(ary)
89
77
  if ary.length < 2
90
78
  true
@@ -93,9 +81,20 @@ module MarkovWords
93
81
  end
94
82
  end
95
83
 
96
- # Generates an English (by default) -sounding word.
84
+ def initialize_cache(opts)
85
+ @cache_size = opts.fetch :cache_size, 100
86
+ @perform_caching = opts.fetch :perform_caching, true
87
+ end
88
+
89
+ def initialize_data(opts)
90
+ @corpus_file = opts.fetch :corpus_file, '/usr/share/dict/words'
91
+ @data_file = opts.fetch :data_file, 'tmp/markov_words.data'
92
+ @flush_data = opts.fetch :flush_data, false
93
+ @data_store = FileStore.new file_path: @data_file,
94
+ flush_data: @flush_data
95
+ end
96
+
97
97
  def generate_word
98
- set_grams if @grams.nil?
99
98
  generate_gram_array(generate_word_length).join
100
99
  end
101
100
 
@@ -109,19 +108,16 @@ module MarkovWords
109
108
  current_gram_size = gal >= @gram_size ? @gram_size : gal
110
109
  key = gram_array[-current_gram_size..-1].join
111
110
 
112
- gram = pick_random_char(@grams[key])
111
+ gram = pick_random_char(grams[key])
113
112
  gram_array << gram
114
113
  end
115
114
  gram_array
116
115
  end
117
116
 
118
- # Set initial array of chars, which is taken from the @grams key list.
119
- # must contain a vowel in the first 2 chars (unless @gram_size == 1 in
120
- # which case any letter).
121
117
  def generate_initial_gram_array
122
118
  initial_gram_array = []
123
119
 
124
- all_grams_array = @grams.to_a
120
+ all_grams_array = grams.to_a
125
121
  gram_min_length = @gram_size < @min_length ? @gram_size : @min_length
126
122
  until initial_gram_array.length >= gram_min_length &&
127
123
  contains_vowel?(initial_gram_array)
@@ -130,7 +126,6 @@ module MarkovWords
130
126
  initial_gram_array
131
127
  end
132
128
 
133
- # The word must be a random length, between @min and @max
134
129
  def generate_word_length
135
130
  word_length = 0
136
131
  until word_length >= @min_length
@@ -139,14 +134,18 @@ module MarkovWords
139
134
  word_length
140
135
  end
141
136
 
137
+ def line_ending?(word)
138
+ /[\r\n]/.match? word
139
+ end
140
+
142
141
  def load_word_from_cache
143
- words_array = @cache_store.retrieve_data
142
+ words_array = @data_store.retrieve_data(:cache)
144
143
  if words_array.nil? || words_array.empty?
145
144
  words_array = Array.new(@cache_size) { generate_word }
146
145
  end
147
146
 
148
147
  word = words_array.pop
149
- cache_store.store_data words_array
148
+ @data_store.store_data(:cache, words_array)
150
149
 
151
150
  word
152
151
  end
@@ -199,16 +198,5 @@ module MarkovWords
199
198
  return char if counter >= pick_num
200
199
  end
201
200
  end
202
-
203
- def line_ending?(word)
204
- /[\r\n]/.match? word
205
- end
206
-
207
- def set_grams
208
- grams = @data_store.retrieve_data ||
209
- markov_corpus(@corpus_file, @gram_size)
210
- @data_store.store_data grams unless grams == @grams
211
- @grams = grams
212
- end
213
201
  end
214
202
  end
@@ -1,4 +1,6 @@
1
+ # frozen-string-literal: true
2
+
1
3
  module MarkovWords
2
4
  # Current version
3
- VERSION = '0.2.3'.freeze
5
+ VERSION = '1.0.0'
4
6
  end
data/lib/markov_words.rb CHANGED
@@ -1,5 +1,7 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'markov_words/version'
2
- require 'markov_words/words'
4
+ require 'markov_words/generator'
3
5
  require 'markov_words/file_store'
4
6
  require 'securerandom'
5
7
 
data/markov_words.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  lib = File.expand_path('../lib', __FILE__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'markov_words/version'
@@ -8,8 +10,14 @@ Gem::Specification.new do |spec|
8
10
  spec.authors = ['Donald Merand']
9
11
  spec.email = ['dmerand@explo.org']
10
12
 
11
- spec.summary = %{Generate words (not sentences) using Markov-chain techniques.}
12
- spec.description = %{It's often nice to have random English-sounding words, eg. for password generators. This library uses Markov-chain techniques on words, as opposed to many others which focus on sentences.}
13
+ spec.summary = <<~SUMMARY
14
+ Generate words (not sentences) using Markov-chain techniques.}
15
+ SUMMARY
16
+ spec.description = <<~DESCRIPTION
17
+ It's often nice to have random English-sounding words, eg. for password
18
+ generators. This library uses Markov-chain techniques on words, as opposed
19
+ to many others which focus on sentences.
20
+ DESCRIPTION
13
21
  spec.homepage = 'https://github.com/exploration/markov_words'
14
22
  spec.license = 'MIT'
15
23
 
@@ -24,5 +32,8 @@ Gem::Specification.new do |spec|
24
32
  spec.add_development_dependency 'minitest', '~> 5.0'
25
33
  spec.add_development_dependency 'pry', '~> 0.11'
26
34
  spec.add_development_dependency 'rake', '~> 10.0'
35
+ spec.add_development_dependency 'sqlite3-ruby', '~> 1.3'
27
36
  spec.add_development_dependency 'yard', '~> 0.6'
37
+
38
+ spec.required_ruby_version = '~> 2.3'
28
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markov_words
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Merand
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-07 00:00:00.000000000 Z
11
+ date: 2017-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sqlite3-ruby
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.3'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: yard
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -80,9 +94,10 @@ dependencies:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0.6'
83
- description: It's often nice to have random English-sounding words, eg. for password
84
- generators. This library uses Markov-chain techniques on words, as opposed to many
85
- others which focus on sentences.
97
+ description: |
98
+ It's often nice to have random English-sounding words, eg. for password
99
+ generators. This library uses Markov-chain techniques on words, as opposed
100
+ to many others which focus on sentences.
86
101
  email:
87
102
  - dmerand@explo.org
88
103
  executables: []
@@ -90,6 +105,7 @@ extensions: []
90
105
  extra_rdoc_files: []
91
106
  files:
92
107
  - ".gitignore"
108
+ - ".rubocop.yml"
93
109
  - ".travis.yml"
94
110
  - ".yardopts"
95
111
  - CODE_OF_CONDUCT.md
@@ -102,8 +118,8 @@ files:
102
118
  - bin/setup
103
119
  - lib/markov_words.rb
104
120
  - lib/markov_words/file_store.rb
121
+ - lib/markov_words/generator.rb
105
122
  - lib/markov_words/version.rb
106
- - lib/markov_words/words.rb
107
123
  - markov_words.gemspec
108
124
  homepage: https://github.com/exploration/markov_words
109
125
  licenses:
@@ -115,9 +131,9 @@ require_paths:
115
131
  - lib
116
132
  required_ruby_version: !ruby/object:Gem::Requirement
117
133
  requirements:
118
- - - ">="
134
+ - - "~>"
119
135
  - !ruby/object:Gem::Version
120
- version: '0'
136
+ version: '2.3'
121
137
  required_rubygems_version: !ruby/object:Gem::Requirement
122
138
  requirements:
123
139
  - - ">="
@@ -128,5 +144,5 @@ rubyforge_project:
128
144
  rubygems_version: 2.6.13
129
145
  signing_key:
130
146
  specification_version: 4
131
- summary: Generate words (not sentences) using Markov-chain techniques.
147
+ summary: Generate words (not sentences) using Markov-chain techniques.}
132
148
  test_files: []