Programming project 9

Download the archive It contains all the files for this project.

In this task you build a decoder for the Morse alphabet using a decision tree.

I've already implemented the node class Morse and entered the decision tree for the 26 letters for you. Your first task is to implement the missing method decode. It should be recursive. Do not modify anything else in the code.

You can test the decode method interactively:

>>> from morse import morse_table
>>> morse_table.decode(".")
>>> morse_table.decode("-")
>>> morse_table.decode("---")

Your second task is to extend the decision tree, so that it also supports decoding the digits 0 to 9.

You can find the Morse code for the letters in the lecture slides, or look on Wikipedia.

Running the script will decode a few letters, digits, and sentences. You can use the unit tests in to test all required Morse symbols.

Submission: Upload your file to the submission server.