read_spelled
read_spelled
Return the units a caller spelled, one uppercase letter, digit, or symbol each, from the recognizer’s text. It reads the common ways a caller spells:
- Letter by letter (
"s m i t h"), or with a hyphen between letters ("S-M-I-T-H"). - Letter names (
"ess em eye tee aitch"). "S as in Sam": the letter, with the word after “as in” skipped.- NATO alphabet words (
"sierra mike"). "double l"for two of a letter, and"double u"for W.- Digit words (
"one two") and symbol words ("dot","at","dash","underscore","plus","slash").
“Capital”, “uppercase”, “lowercase”, and similar words before a letter are dropped.
A word that names no letter, such as "smith", is taken as spelled: its letters.
Parameters
text
The recognizer’s text.
oh_is_zero
Keyword-only. True reads “oh” as the digit 0, for a code of digits. By default
it’s the letter O.
Returns
list[str] — The units, in order. Pass them to
spelling_variants() to list likely misrecognitions.
Example
Part of the speech helpers module.