diff --git a/CWLibrary/Characters.cs b/CWLibrary/Characters.cs index 2c1e011..45e8d5e 100644 --- a/CWLibrary/Characters.cs +++ b/CWLibrary/Characters.cs @@ -48,10 +48,29 @@ namespace CWLibrary { ".", ".-.-.-" }, { ",", "--..--" }, { "?", "..--.." }, + { "'", ".----." }, { "/", "-..-." }, - { "", ".-.-." }, - { "", "-...-.-" }, - { "", "...-.-" } + { "(", "-.--." }, + { ")", "-.--.-" }, + { ":", "---..." }, + { ";", "-.-.-." }, + { "=", "-...-" }, + { "+", ".-.-." }, + { "-", "-....-" }, + { "\"", ".-..-." }, + { "@", ".--.-." }, + // Prosigns -- see + // http://en.wikipedia.org/wiki/Prosigns_for_Morse_code + { "", ".-.-" }, // Space down one line (new line) + { "", ".-.-." }, // Stop copying (end of message) + { "", ".-..." }, // Stand by + { "", "-...-.-" }, // Break + { "", "-...-" }, // Space down two lines + { "", "-.-..-.." }, // Clear (going off the air) + { "", "-.-.-" }, // Start copying + { "", "-.--." }, // Go only + { "", "...-.-" }, // Silent key (going off the air) + { "", "...-." } // Understood }; } } diff --git a/CWLibrary/TextToMorse.cs b/CWLibrary/TextToMorse.cs index 70ef69a..cc0f6c1 100644 --- a/CWLibrary/TextToMorse.cs +++ b/CWLibrary/TextToMorse.cs @@ -126,7 +126,19 @@ namespace CWLibrary { if (i > 0) data.AddRange(GetInterCharSpace()); - data.AddRange(GetCharacter(word[i].ToString())); + if (word[i] == '<') + { + // Prosign + int end = word.IndexOf('>', i); + if (end < 0) + throw new ArgumentException(); + data.AddRange(GetCharacter(word.Substring(i, end + 1 - i))); + i = end; + } + else + { + data.AddRange(GetCharacter(word[i].ToString())); + } } return data.ToArray();