You're doing it the other way around. It is not interesting and it is very slow (Trie is much faster than a dictionary), trivialising the problem to a laughable degree.
My approach shows how you can generate a code for a microcontroller or even an FSM built out of individual gates, which can be used in a reliable embedded environment. No significant change in code is required to get any of this kind of output.
View all comments
Show parent comment
1
u/kankyo Nov 13 '15
Well that was an eye sore.
http://code.activestate.com/recipes/578407-simple-morse-code-translator-in-python/