diff options
-rwxr-xr-x | spelling-rbee | 25 |
1 files 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 |