used in testing
(language: &str, style: &str, mathml: &str, speech: &str)
| 49 | // This uses default preferences |
| 50 | #[allow(dead_code)] // used in testing |
| 51 | pub fn test(language: &str, style: &str, mathml: &str, speech: &str) { |
| 52 | set_rules_dir(abs_rules_dir_path()).unwrap(); |
| 53 | libmathcat::speech::SPEECH_RULES.with(|rules| { |
| 54 | let rules = rules.borrow_mut(); |
| 55 | let mut prefs = rules.pref_manager.borrow_mut(); |
| 56 | prefs.set_user_prefs("SpeechOverrides_CapitalLetters", ""); // makes testing simpler |
| 57 | prefs.set_user_prefs("PauseFactor", "100"); // makes testing simpler |
| 58 | prefs.set_user_prefs("Verbosity", "Medium"); |
| 59 | }); |
| 60 | |
| 61 | set_preference("Language".to_string(), language.to_string()).unwrap(); |
| 62 | set_preference("SpeechStyle".to_string(), style.to_string()).unwrap(); |
| 63 | check_answer(mathml, speech, &format!("{}/{}", language, style)); |
| 64 | } |
| 65 | |
| 66 | // Compare the result of speaking the mathml input to the output 'speech' |
| 67 | // This takes the speech style along with a vector of (pref_name, pref_value) |