It takes a stream of . and - and sees what it might be:

$ ruby morse.rb
..-..-..-..
All Possible Decodings:
EAEAEAEE
EAEAEAI
EAEAEED
...

Of course you could run the program and find out for yourself.