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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
//! Locators humans can exchange when speaking aloud.
//!
//! This is a symbol set with sixteen uniquely pronounceable digits. English16
//! was somewhat inspired by the record locators used by the civilian air
//! travel industry, but with the restriction that the symbol set is carefully
//! chosen (aviation locators do heroic things like excluding 'I' but not much
//! else).
//!
//! The fact there are sixteen symbols is more an indication of a certain
//! degree of bullheaded-ness on the part of the author, and less of any kind
//! of actual requirement. We might have a slightly better readback score if we
//! dropped to 15 or 14 unique characters. It does mean you can match up with
//! hexadecimal, which is not entirely without merit.
//!
//! The grouping of letters and numbers was the hard part; having come up with
//! the set and deconflicted the choices, the ordering is then entirely
//! arbitrary. Since there are some numbers, might as well have them at the
//! same place they correspond to in base 10; the letters were then allocated
//! in alpha order in the remaining slots.
//!
//! The symbol set is as follows:
//!
//! | Digit | Ordinal | Phoneme | Selection Notes |
//! |:-:|:-|:-|:------|
//! | **`'0'`** | _0th_ | \[ˈziˈro\] | `'0'` Conflicts with `'O'` obviously, and `'Q'` often enough. |
//! | **`'1'`** | _1st_ | \['wan\] | |
//! | **`'2'`** | _2nd_ | /u:/ | `'U'`, `'W'`, and `'2'`. `'W'` is disqualified because of the way Australians butcher double-this and triple-that. \"Double U" or \"W\"? Who would know. |
//! | **`'C'`** | _3rd_ | /eː/ | `'B'`, `'C'`, `'D'`, `'E'`, `'G'`, `'P'`, `'T'`, `'V'`, and `'3'` (plus `'Z'` because Americans can't pronounce \"Zed\" properly). |
//! | **`'4'`** | _4th_ | \['foa\] | `'4'` and `'5'` are often confused, and '5' is definitely out due to its collision with `'I'` when spoken, and `'S'` in writing. |
//! | **`'F'`** | _5th_ | /f/ | `'F'` and `'S'` are notoriously confused when spoken aloud, making the choice of `'F'` borderline, but `'S'` is already disqualified for looking like `'5'`. |
//! | **`'H'`** | _6th_ | /h/ | chosen from `'H'` and `'8'`. The sixth ordinal is `'6'` knocked out by choice of `'X'` below |
//! | **`'7'`** | _7th_ | \[ˈsɛv.n\] | chosen from `'7'` and `'N'`, the former's additional sounds giving it a bit of additional aural distinction. |
//! | **`'8'`** | _8th_ | \[ˈei̯t\] | Uncomfortably close to `'H'` above, but the pronunciation _is_ distinct. |
//! | **`'9'`** | _9th_ | \[ˈnaɪn\] | |
//! | **`'K'`** | _10th_ | /eɪ/ | `'A'`, `'J'`, `'K'`. |
//! | **`'L'`** | _11th_ | \[el\] | `'L'` has good phonetics, and as long as it is upper case (which the whole English16 symbol set is) there's no conflict with `'1'`. |
//! | **`'M'`** | _12th_ | \[em\] | chosen from `'M'` and `'N'`, which while phonetically distinct, seem to get frequently confused in readbacks as they both hold the consonant sound and can be confused. |
//! | **`'R'`** | _13th_ | \[r\] | chef-kiss, no notes |
//! | **`'X'`** | _14th_ | /x/ | chosen from `'X'` and `'6'`. |
//! | **`'Y'`** | _15th_ | /aɪ/ | chosen from `'I'`, `'Y'`, and `'5'`. `'I'` is out for the usual reason of being similar to `'1'`. |
use crategreater_than;
/// Given a number, convert it to a string in the English16 base 16 symbol
/// alphabet.
///
/// You can use this as a replacement for the standard `'0'`-`'9'` and
/// `'A'`-`'F'` symbols traditionally used to express hexadecimal, though
/// really the fact that we came up with 16 total unique symbols was a nice
/// co-incidence, not a requirement.
/// Given a number encoded in the English16 alphabet, convert it back to a
/// base 10 decimal.