diff options
author | Simon Parri <simonparri@ganzeria.com> | 2019-02-01 16:12:26 -0600 |
---|---|---|
committer | Simon Parri <simonparri@ganzeria.com> | 2019-02-01 16:12:26 -0600 |
commit | 218c1c0d081c7995a9bb9ae2e2a563e831cf512b (patch) | |
tree | 3d06daa2636bd1c799cc33906d0efbee5104a330 | |
parent | fdde2a0cf735ce466b3a77b962c7acb60c8efb83 (diff) | |
download | spelling-rbee-218c1c0d081c7995a9bb9ae2e2a563e831cf512b.tar.gz spelling-rbee-218c1c0d081c7995a9bb9ae2e2a563e831cf512b.zip |
Clean up file reading block
-rwxr-xr-x | spelling-rbee | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spelling-rbee b/spelling-rbee index 62ed1bd..feedc82 100755 --- a/spelling-rbee +++ b/spelling-rbee @@ -5,14 +5,19 @@ require "open-uri" words = [] correct = [] -=begin open FILE do |f| f.each do |line| words.push line.chomp end end + +=begin +open FILE do |f| + words = f.readlines.map(&:chomp) +end =end +=begin file = open FILE neof = true while neof @@ -27,6 +32,8 @@ while neof end end puts "words: %d" % words.length +=end + words.each {|word| system "espeak -s 100 '#{word}'" print "spell: " |