Useless Dichotomic Morse to Human converter
17 August 2007I'm using the binary decision tree approach to convert Morse Code to "Human"
Here's a part of the tree (not complete)
Lets decipher "— · —":
First mark is a dash -> next level and right node
Second mark is a dot -> next level and left node
Third mark is a dash -> next level and right node
"— · —" = K
use strict;
my $index;
while(<>)
{
chomp;
for(split / +/)
{
$index=0;
for(split //)
{
{
$index=($index+1)*2-1;
}
{
$index=($index+1)*2;
}
else
{
print " ";
$index=0;
}
}
print @morse_table[$index-1] if $index>0;
$index=0;
}
print $/;
}
Download this code: morse.pls
August 18th, 2007 at 7:14 pm
Interesting. Is there still anything that uses Morse Code to transmit anything? It would be cool to transmit email messages to a reader using audible Morse Code and have your code "listen" to it and decode it.
August 18th, 2007 at 7:52 pm
As far as i know Morse isn't very used anymore.
I'm planing to build a hardware Morse transceiver (with a microphone and a speaker, and connected to a computer), but i don't know when i'm going to be able to start that. (a lot of projects to finish)