markov_words 0.2.2 → 0.2.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8178f4afd270e5707e65d66b6643e8b768be1026
4
- data.tar.gz: 6bbe0d6c68c4a1f40719f204e0221cdf6723c358
3
+ metadata.gz: 37eb273f25ad18c46a9c3a66c6467222af81817c
4
+ data.tar.gz: 8ad07cb6d169686909c60d3f492e0bdedd2b4a23
5
5
  SHA512:
6
- metadata.gz: 3990ff760c7be9efa3953ca04b44173e4ba06329826e480c86a60b74d22b1664171696eac7ed58c85bedb2a9e7132059478d940b102af5befbfb1dab053eb98d
7
- data.tar.gz: bcd4abb7a85dbd5e4337f86c731c2dbf7549cb02dd5ce9c55183bce6000b95fab230ad6f73ba2fc2ed47be2f7bb5d6294fa898f79e702b04b250907127ba2607
6
+ metadata.gz: 1c04a14d059551ecff738aee90e93c60f0ec9750922e9c076392cc09f013ec9e7231dcb7b42811a3ba00181638b82e21b3ab758d892d0d3e8dd288602378d408
7
+ data.tar.gz: 394f7499450531865e92164708c95ef4d0b6c39ecb8f2e7bb680830f428714669f6b2d86977c40f0422fe51ee7ff5edc04f8b7b87f754d88387673d39f700af7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- markov_words (0.2.2)
4
+ markov_words (0.2.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,4 +1,4 @@
1
1
  module MarkovWords
2
2
  # Current version
3
- VERSION = '0.2.2'.freeze
3
+ VERSION = '0.2.3'.freeze
4
4
  end
@@ -190,7 +190,7 @@ module MarkovWords
190
190
  # In the example hash above, "a" would have a 33% chance of being chosen,
191
191
  # while "b" would have a 66% chance (1/2 ratio).
192
192
  def pick_random_char(counts_hash)
193
- counts_hash ||= {}
193
+ return nil if counts_hash.nil?
194
194
  total = counts_hash.values.sum
195
195
  pick_num = SecureRandom.rand(total)
196
196
  counter = 0
@@ -201,7 +201,7 @@ module MarkovWords
201
201
  end
202
202
 
203
203
  def line_ending?(word)
204
- word.match(/[\r \n]/)
204
+ /[\r\n]/.match? word
205
205
  end
206
206
 
207
207
  def set_grams
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markov_words
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Merand