momblish 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.
- checksums.yaml +4 -4
- data/lib/momblish/version.rb +1 -1
- data/lib/momblish.rb +6 -10
- metadata +2 -3
- data/lib/freq.txt +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b29cb372c16c29c7f4a5b9b8c182c93d96167c0c3327654fb8df752bbd9ad998
|
4
|
+
data.tar.gz: 11543739887cc0088d983f97b9712dde334785571bbe55590a65636e9894e610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ada00fa3f950bf442f62b8e5b2e46384b06d3d7f172b45c07deb0118ca075d6a54ccf8d598c59ee5daced6501c6b43ef80c41f811c36fd4a7fe97c69cd439308
|
7
|
+
data.tar.gz: ae08f229ca5f90f5f0f15943571e20c33ce34743a4452c8b06ec8ebe3831e083501c0c75964cb3b02e68b30750c0ae2f7ba615956ece28f1e9c22667b5e2d3fd
|
data/lib/momblish/version.rb
CHANGED
data/lib/momblish.rb
CHANGED
@@ -59,7 +59,7 @@ class Momblish
|
|
59
59
|
def word(length = nil)
|
60
60
|
length ||= rand(4..12)
|
61
61
|
|
62
|
-
word = @corpus.weighted_bigrams.
|
62
|
+
word = @corpus.weighted_bigrams.weighted_sample
|
63
63
|
|
64
64
|
(length - 2).times do
|
65
65
|
last_bigram = word[-2..-1]
|
@@ -74,17 +74,13 @@ class Momblish
|
|
74
74
|
word.downcase
|
75
75
|
end
|
76
76
|
|
77
|
-
def sentence(count = nil, word_length
|
78
|
-
|
77
|
+
def sentence(count = nil, word_length: nil)
|
78
|
+
return enum_for(:sentence, word_length: word_length) unless block_given?
|
79
79
|
|
80
|
-
if
|
81
|
-
|
82
|
-
loop { yield word(word_length) }
|
83
|
-
else
|
84
|
-
count.times { yield word(word_length) }
|
85
|
-
end
|
80
|
+
if count.nil?
|
81
|
+
loop { yield word(word_length) }
|
86
82
|
else
|
87
|
-
|
83
|
+
count.times { yield word(word_length) }
|
88
84
|
end
|
89
85
|
end
|
90
86
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: momblish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Prater
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,7 +83,6 @@ files:
|
|
83
83
|
- bin/setup
|
84
84
|
- lib/corpuses/simple.txt
|
85
85
|
- lib/corpuses/spanish.txt
|
86
|
-
- lib/freq.txt
|
87
86
|
- lib/momblish.rb
|
88
87
|
- lib/momblish/corpus.rb
|
89
88
|
- lib/momblish/corpus_analyzer.rb
|
data/lib/freq.txt
DELETED
File without changes
|