Speech-Rule-Engine / speech-rule-engine

Generating speech descriptions for XML structures
https://zorkow.github.io/speech-rule-engine/
Apache License 2.0
76 stars 39 forks source link

Aata test #108 #568

Open NSoiffer opened 3 years ago

NSoiffer commented 3 years ago

MathML

<math>
<msup><mn>128</mn><mn>4</mn></msup><mo>=</mo>
<mn>268</mn><mo>,</mo><mn>435</mn><mo>,</mo><mn>456</mn>
</math>
returns   "⠼⠂⠆⠦⠘⠲⠀⠨⠅⠀⠼⠆⠖⠦⠠⠀⠼⠲⠒⠢⠠⠀⠼⠲⠢⠖"
should be "⠼⠂⠆⠦⠘⠲⠀⠨⠅⠀⠼⠆⠖⠦⠠⠲⠒⠢⠠⠲⠢⠖"

See 9b (1) -- interior commas do not get a space, and hence no numeric indicator

zorkow commented 3 years ago

That's the problem with parsing numbers that we had discussed

At the moment this is not an interior comma so there will be a visible space behind the commata, leading to the interpretation of a non-enclosed list.

I have a couple of heuristics ready that try to deal with some of these cases, in particular, preferences of relations over punctuation that could help here. But they are still somewhat immature to release into the wild. E.g., how do you classify x=123,456=y vs x=123,y=456 (note that the correct 123{,}456 is easy!).