Repository navigation
Expand file tree
/
Copy pathcommonEncoder.go
More file actions
53 lines (41 loc) · 1.4 KB
/
Copy pathcommonEncoder.go
File metadata and controls
53 lines (41 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package morsegode
// AlphabeticEncoder encodes plain text into International Morse code using
// the 26 letters of the Latin alphabet. Words are separated by " " in the
// input and " / " in the output; letters within a word are joined with " ".
var AlphabeticEncoder = GeneralEncoder{
Tree: AlphabeticMorseTree,
WordSplit: " ",
WordJoin: " / ",
LetterSplit: "",
LetterJoin: " ",
}
// InternationalEncoder encodes plain text into the full International Morse
// code character set (letters, digits and common punctuation). Words are
// separated by " " in the input and " / " in the output; letters within a
// word are joined with " ".
var InternationalEncoder = GeneralEncoder{
Tree: InternationalMorseTree,
WordSplit: " ",
WordJoin: " / ",
LetterSplit: "",
LetterJoin: " ",
}
// NumericEncoder encodes a sequence of digits into Morse code. Digits are
// split on "" in the input and joined with " " in the output.
var NumericEncoder = GeneralEncoder{
Tree: NumericMorseTree,
WordSplit: " ",
WordJoin: " / ",
LetterSplit: "",
LetterJoin: " ",
}
// WabunEncoder encodes plain text into the Wabun (Japanese telegraphic) code
// for katakana and its punctuation. Words are separated by " " in the input
// and " / " in the output; kana within a word are joined with " ".
var WabunEncoder = GeneralEncoder{
Tree: WabunMorseTree,
WordSplit: " ",
WordJoin: " / ",
LetterSplit: "",
LetterJoin: " ",
}