markov_twitter 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/markov_twitter/markov_builder/node.rb +6 -2
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd6b5de1600afc6e7f5cba800814c945b7e4f520
|
4
|
+
data.tar.gz: b3637dfe3025cf956fde46e23ffaace751d48e47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac476e80dc8159e0fe005f5463862f1b5cdcdcefb7e21e4ed4144a6146820eccc5536cf60493bfb94d1930a5cf1b56b6a6815eb544e2bb064401375060bc2bf6
|
7
|
+
data.tar.gz: 4ea44112cdd56355e2eaf8ce8b9c6d8c35da562db079453818db7fc86fcfc8ddfad75b3ea1a87fb0afe52b3f198424e3b9d79f49c5fe272331b972f4e56d4adf
|
data/README.md
CHANGED
@@ -188,9 +188,9 @@ All of these methods can be safely run many times. Note that `remove_next_linkag
|
|
188
188
|
|
189
189
|
The gem boilerplate was scaffolded using a gem I made, [gemmyrb](http://github.com/maxpleaner/gemmyrb).
|
190
190
|
|
191
|
-
Test scripts are in the [spec/](http://github.com/maxpleaner/markov_twitter/tree/master/spec) folder, although some helper methods are written into the application code at [
|
191
|
+
Test scripts are in the [spec/](http://github.com/maxpleaner/markov_twitter/tree/master/spec) folder, although some helper methods are written into the application code at [MarkovTwitter::TestHelperMethods](http://rubydoc.info/gems/markov_twitter/MarkovTwitter/TestHelperMethods).
|
192
192
|
|
193
|
-
The application code is in [lib/](http://github.com/maxpleaner/markov_twitter/tree/lib).
|
193
|
+
The application code is in [lib/](http://github.com/maxpleaner/markov_twitter/tree/master/lib).
|
194
194
|
|
195
195
|
Documentation is built with [yard](https://github.com/lsegal/yard) into [doc/](http://github.com/maxpleaner/markov_twitter/tree/master/doc) - it's viewable [on rubydoc](http://rubydoc.info/gems/markov_twitter). It has 100% documentation at time of writing. If when building, it shows that something is undocumented, run `yard --list-undoc` to find out where it is.
|
196
196
|
|
@@ -10,7 +10,7 @@ class MarkovTwitter::MarkovBuilder
|
|
10
10
|
# the :next and :previous linkages.
|
11
11
|
# - Outer hash is keyed by the direction (:next, :prev).
|
12
12
|
# - Inner hash represents possible traversals -
|
13
|
-
#
|
13
|
+
# keyed by string value, its values are probabilities
|
14
14
|
# representing the likelihood of choosing that route.
|
15
15
|
attr_accessor :linkages
|
16
16
|
|
@@ -20,7 +20,7 @@ class MarkovTwitter::MarkovBuilder
|
|
20
20
|
attr_accessor :total_num_inputs
|
21
21
|
|
22
22
|
# @return [Hash<String,Node>]
|
23
|
-
# a reference to the attr of the parent MarkovBuilder
|
23
|
+
# a reference to the attr of the parent MarkovBuilder.
|
24
24
|
attr_reader :nodes
|
25
25
|
|
26
26
|
# @param value [String] for example, a word.
|
@@ -161,6 +161,7 @@ class MarkovTwitter::MarkovBuilder
|
|
161
161
|
|
162
162
|
# Adds another node to the :next linkages, updating probabilities.
|
163
163
|
# @param child_node [Node] to be added.
|
164
|
+
# @param mirror_change [Boolean] whether to update the opposite direction.
|
164
165
|
# @return [void]
|
165
166
|
def add_next_linkage(child_node, mirror_change=true)
|
166
167
|
add_and_adjust_probabilities(:next, child_node)
|
@@ -168,6 +169,7 @@ class MarkovTwitter::MarkovBuilder
|
|
168
169
|
|
169
170
|
# Adds another node to the :prev linkages, updating probabilities.
|
170
171
|
# @param parent_node [Node] to be added.
|
172
|
+
# @param mirror_change [Boolean] whether to update the opposite direction.
|
171
173
|
# @return [void]
|
172
174
|
def add_prev_linkage(parent_node, mirror_change=true)
|
173
175
|
add_and_adjust_probabilities(:prev, parent_node)
|
@@ -175,6 +177,7 @@ class MarkovTwitter::MarkovBuilder
|
|
175
177
|
|
176
178
|
# Removes a node from the :next linkages, updating probabilities.
|
177
179
|
# @param child_node [Node] to be removed.
|
180
|
+
# @param mirror_change [Boolean] whether to update the opposite direction.
|
178
181
|
# @return [void]
|
179
182
|
def remove_next_linkage(child_node, mirror_change=true)
|
180
183
|
remove_and_adjust_probabilities(:next, child_node)
|
@@ -182,6 +185,7 @@ class MarkovTwitter::MarkovBuilder
|
|
182
185
|
|
183
186
|
# Removes a node from the :prev linkages, updating probabilities.
|
184
187
|
# @param parent_node [Node] to be removed.
|
188
|
+
# @param mirror_change [Boolean] whether to update the opposite direction.
|
185
189
|
# @return [void]
|
186
190
|
def remove_prev_linkage(parent_node, mirror_change=true)
|
187
191
|
remove_and_adjust_probabilities(:prev, parent_node)
|
data/lib/version.rb
CHANGED