From e7ddad7d3ed5af2f02ef86c4ad89b8aa7c27b62a Mon Sep 17 00:00:00 2001 From: Simon Parri Date: Thu, 22 Oct 2020 13:55:35 -0500 Subject: Fix fatal regression in spelling-rbee --- spelling-rbee | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/spelling-rbee b/spelling-rbee index 1c79af0..0a83cd9 100755 --- a/spelling-rbee +++ b/spelling-rbee @@ -26,18 +26,11 @@ def read(file) end def repl(words) - results = [] + rr = [] words.each do |word| say word - result = get - # while result[0] == ":" - # ckopt(word,result) - # if $exit - # return $exit - # end - # result = get - # end - case result + r = get + case r when ":r" redo when ":imacheaterandknowit" @@ -47,15 +40,15 @@ def repl(words) $exit = true end break if $exit - results.push ckword(word,result) + rr.push ckword(word, r) end - return results + return rr end def results(words) - results = [] + correct = [] words.each {|word| - results.push(word[0] + ": " + word[1] + ": " + word[2]) + correct.push(word[0] + ": " + word[1] + ": " + word[2]) } return correct end @@ -63,9 +56,9 @@ end def run(file = (ARGV[0] || "http://zoar.cx/~simon/21k/words.txt")) $exit = false words = read file - correct = repl words + rr = repl words return true if $exit - puts results results + puts results rr end run -- cgit v1.2.3