Morse Trie

2026-06-07

If you try decoding Morse code by ear, you'll probably implicitly build a mental trie. Here's it 1 written out explicitly. Solid lines for dash, dotted for dit.

/ TM O0 98 GQZ ,7N KYGO AHEADC ATTENTION DX B6E AWJ 1'PR OUT.L"& / WAIT IU 2? FSV 3ROGERH4 5ERROR

It sort-of looks like a Huffman code with more frequent letters on shallower paths. If we if represent time2 by fixing the path-length from the root node, instead of the x-distance, we get this:

/ TM O0 98 GQZ ,7N KYGO AHEADC ATTENTION DX B6E AWJ 1'PR OUT.L"& / WAIT IU 2? FSV 3ROGERH4 5ERROR

I'm doing some slight path-compression on the visualization here, writing terminals on non-leaf nodes. Although there are a few equivalent representations, I think it's best to conceptualize Morse code as trinary w/ symbols dot, dash, and "gap" as a stop codon 3 4 . This is much less efficient than a true Huffman code, but it does have an edge in that absolutely unambiguous letter-breaks minimize the blast-radius of any error, and the inclusion

i:  meaningful English sentences↪ [[:print:]]* i:\ \text{meaningful English sentences} \hookrightarrow \texttt{[[:print:]]*}

is one where humans are already pretty good at computing the error-correcting projection i +i^+ on the fly, lol.5


  1. Specifically, a subset of ITU-R M.1677-1 International Morse Code, plus a few prosigns.  ↩︎

  2. Path length ∝ \propto the time needed to send the string formed by N repetitions of whatever character, for a large enough N.  ↩︎

  3. Since " " is /gap{2,}/, our word-break (by convention, / ) becomes the label given to the root node. ↩︎

  4. If we were to instead show it as a true binary tree w/ one solid for tone, dotted for silence, and one edge per unit time:

    0 9 8OQ ,7ZGM GO AHEAD Y ATTENTION CK X 6BDNT '1JPW .OUT "& / WAIT LRA 2?FU 3ROGERV 4 ERROR5HSIE/
     ↩︎
  5. This does, however, make it incredibly annoying when trying to unambiguously send Morse on a channel which only supports impulses (clicking a pen, etc). There's competing conventions, but nothing obvious enough to be universal.  ↩︎