replace buggy Display implementation for Pronounce with Debug trait - #820
Conversation
|
ok so |
|
The Display part was just for debugging help, so the unmatched brackets was just a little ugly. However, you are right that it should make use of the DEBUG trait. "eloquence" is a speech engine used with JAWS... except that JAWS doesn't use it when incorporating MathCAT so it isn't implemented for real. However, the code was set up to read the value if specified as part of a "Pronounce" yaml command (forces pronunciation). Every TTS has different ways of doing that, so translators should list how it is done for each TTS. Very ugly, but I don't know of another way other than allowing a finite list of Pronounce values and interally have the values set up. Some rule files use "eloquence", so you still need to handle it in to |
|
ok, fixed it, I think ?!? |
Linux library size: 0.58 MiB (-0.02%)
Built with default features, Rust 1.96.0, and Ubuntu 24.04. Workflow run. |
not 100% sure what is going on here.
impl fmt::Display for Pronouncelooks buggy to me, as pronounce: [ is opened 4 times, but only closed once at the end.And even after fixing it, it looks basically the same as what the Debug trait provides anyway.
to me, the simplest solution is to just use the Debug trait from Rust, whose main difference is explicitly escaping strings with ", as seen in the test.
Generally, having multiple (slightly different) forms of displaying a type is something that has shown not worth it to me in past projects (eg as a source of error like here).
I'm pretty sure there are more spots like this, which I can search for if you agree with me here.