Here's a more practical Morse parser. (Although it's not part
of the quiz...)

gegroet,
Erik V. - http://www.erikveen.dds.nl/

----------------------------------------------------------------

 $ cat morse2.rb
 class Morse
   MORSE_CODES           = %w{.- -... -.-. -.. . ..-. --. .... .. .---
-.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.--
--..}.zip(("a".."z").to_a)

   DICTIONARY_WORDS      = File.open("/usr/share/dict/words"){|f|
f.read}.downcase.split(/[^a-z]/)       rescue nil

   def parse(sequence)
     real_words(find_words(sequence.gsub(/\s+/, "")))
   end

   private

   def find_words(sequence, word="", results=[])
     if sequence.empty?
       results << word
     else
       MORSE_CODES.each do |seq, chr|
         if sequence.index(seq) == 0
           find_words(sequence[seq.length..-1], word+chr, results)
         end
       end
     end

     results
   end

   def real_words(words)
     words & DICTIONARY_WORDS rescue words
   end
 end

 puts(
   $stdin.read.split(/\r*\n+/).collect do |sequence|
     list        = Morse.new.parse(sequence)

     case list.length
     when 0      then    "?"
     when 1      then    list[0]
     else                "(#{list.join("|")})"
     end
   end.join(" ")
 )

----------------------------------------------------------------

 $ cat morse.txt
 ..
 .... --- .--. .
 -.-- --- ..-
 .- .-. .
 .- -... .-.. .
 - ---
 .-. . .- -..
 - .... .. ...
 ... . -. - . -. -.-. .

----------------------------------------------------------------

 $ ruby morse2.rb < morse.txt
 i hope you (al|are|end|rd) (abets|able|adele|pile|wests) to (lad|lane|
read|rune) (nisei|thees|these|this) sentence

----------------------------------------------------------------