diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-01-25 23:11:30 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-01-25 23:11:30 +0100 |
commit | db379fd8e1b9b9f4829217b2d5262e7629360413 (patch) | |
tree | bf4facbf718a803a5b3b86f8a2ffe9e727303778 /data | |
parent | 06485aeb187dde5e81204b06c8e956e7e035c323 (diff) |
markov: whitespace cleanup
Diffstat (limited to 'data')
-rwxr-xr-x | data/rbot/plugins/markov.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/data/rbot/plugins/markov.rb b/data/rbot/plugins/markov.rb index 574dde57..28211203 100755 --- a/data/rbot/plugins/markov.rb +++ b/data/rbot/plugins/markov.rb @@ -294,15 +294,15 @@ class MarkovPlugin < Plugin output = word1 keys = [] @chains.each_key(output) do |key| - if key.downcase.include? output - keys << key - else - break - end + if key.downcase.include? output + keys << key + else + break + end end return nil if keys.empty? output = keys[rand(keys.size)].split(/ /) - end + end output = output.split(/ /) unless output.is_a? Array input = [word1, word2] while output.length < @bot.config['markov.max_words'] and (output.first != MARKER or output.last != MARKER) do @@ -317,8 +317,8 @@ class MarkovPlugin < Plugin if output == input nil else - output.join(" ") - end + output.join(" ") + end end def help(plugin, topic="") |