Expand description
The speech module is where the speech rules are read in and speech generated.
The speech rules call out to the preferences and tts modules and the dividing line is not always clean. A number of useful utility functions used by other modules are defined here.
Structs§
- File
AndTime - Files
AndTimes - MyXPath
- Replacement
Array - An array of rule
Replacements (text, xpath, tts commands, etc) - Speech
Rules SpeechRulesWithContextencapsulates a named group of speech rules (e.g, “ClearSpeak”) along with the preferences to be used for speech.- Speech
Rules With Context SpeechRulesWithContextencapsulates a named group of speech rules (e.g, “ClearSpeak”) along with the preferences to be used for speech. Because speech rules can define variables, there is also a context that is carried with them
Enums§
Constants§
- BRAILLE_
RULES - CONCAT_
INDICATOR - A bit of a hack to concatenate replacements (without a ’ ’). The CONCAT_INDICATOR is added by a “ct:” (instead of ‘t:’) in the speech rules and checked for by the tts code.
- CONCAT_
STRING - INTENT_
RULES - The current set of speech rules
- NAVIGATION_
RULES - NAV_
NODE_ SPEECH_ NOT_ FOUND - OVERVIEW_
RULES - SPEECH_
RULES
Traits§
- Tree
OrString - As the name says, TreeOrString is either a Tree (Element) or a String It is used to share code during pattern matching
Functions§
- as_
hash_ checked - Returns the Yaml as a
Hashor an error if it isn’t. - as_
str_ checked - Returns the Yaml as a
&stror an error if it isn’t. - as_
vec_ checked - Returns the Yaml as a
Vecor an error if it isn’t. - braille_
replace_ chars - Hack to allow replacement of
strwith braille chars. - compile_
rule - Given a string that should be Yaml, it calls
build_fnwith that string. The build function/closure should process the Yaml as appropriate and capture any errors and write them tostd_err. The returned value should be a Vector containing the paths of all the files that were included. - intent_
from_ mathml - The main external call,
intent_from_mathmlreturns a string for the speech associated with themathml. It matches against the rules that are computed by user prefs such as “Language” and “SpeechStyle”. - is_
quoted_ string - Checks the string to see if it is “quoted”
- make_
quoted_ string - Converts ‘string’ into a “quoted” string – use is_quoted_string and unquote_string
- overview_
mathml - process_
include - remove_
optional_ indicators - speak_
mathml - unquote_
string - Converts ‘string’ into a “quoted” string – use is_quoted_string and unquote_string IMPORTANT: this assumes the string is quoted – no check is made
- yaml_
to_ type - Converts its argument to a string that can be used in a debugging message.