|
[OP on mathjax-dev](https://groups.google.com/forum/#!topic/mathjax-dev/BpP3bF-NvaY)
|
|
Simple starting example: `a+b+c` which might be realized as
|
|
|
|
|
|
Starting example: `a+b+c` which might be realized as
|
|
|
|
|
|
|
|
```html
|
|
```html
|
|
<math>
|
|
<math>
|
... | @@ -24,13 +22,13 @@ which would yield [a semantic tree](https://github.com/zorkow/speech-rule-engine |
... | @@ -24,13 +22,13 @@ which would yield [a semantic tree](https://github.com/zorkow/speech-rule-engine |
|
which could be embedded as follows
|
|
which could be embedded as follows
|
|
|
|
|
|
```html
|
|
```html
|
|
<math>
|
|
<math id=0>
|
|
<mrow data-math-semantic-parent="sum" data-math-semantic-children="3">
|
|
<mrow id=1 data-math-semantic-parent="3,5" data-math-semantic-children="2,4,6">
|
|
<mi data-math-semantic-child>a</mi>
|
|
<mi id=2 data-math-semantic-child>a</mi>
|
|
<mo data-math-semantic-operator>+</mo>
|
|
<mo id=3 data-math-semantic-operator="sum(meaning),+(type)">+</mo>
|
|
<mi data-math-semantic-child>b</mi>
|
|
<mi id=4 data-math-semantic-child>b</mi>
|
|
<mo data-math-semantic-operator>+</mo>
|
|
<mo id=5 data-math-semantic-operator="sum,+">+</mo>
|
|
<mi data-math-semantic-child>c</mi>
|
|
<mi id=6 data-math-semantic-child>c</mi>
|
|
</mrow>
|
|
</mrow>
|
|
</math>
|
|
</math>
|
|
```
|
|
```
|
... | @@ -38,8 +36,8 @@ which could be embedded as follows |
... | @@ -38,8 +36,8 @@ which could be embedded as follows |
|
In other words,
|
|
In other words,
|
|
|
|
|
|
* add mrows when necessary for semantic-tree-nodes with children
|
|
* add mrows when necessary for semantic-tree-nodes with children
|
|
* identify children
|
|
* identify parent and children
|
|
* do some countin.
|
|
* use "standard" MathML tree numbering (IDs) (Texthelp/DSI/MathJax conversation but simplified).
|
|
|
|
|
|
The hope is that this simple parent/child structure works well recursively, e.g.,
|
|
The hope is that this simple parent/child structure works well recursively, e.g.,
|
|
|
|
|
... | @@ -75,22 +73,22 @@ would lead to a semantic tree of |
... | @@ -75,22 +73,22 @@ would lead to a semantic tree of |
|
and we simply start from the leafs adding an mrow for * etc. to get
|
|
and we simply start from the leafs adding an mrow for * etc. to get
|
|
|
|
|
|
```html
|
|
```html
|
|
<math>
|
|
<math id=0>
|
|
<mrow data-math-semantic-parent="sum" data-math-semantic-children="3">
|
|
<mrow id=1 data-math-semantic-parent="3,8" data-math-semantic-children="2,4,9">
|
|
<mi data-math-semantic-child> a</mi>
|
|
<mi id=2 data-math-semantic-child>a</mi>
|
|
<mo data-math-semantic-operator>+</mo>
|
|
<mo id=3 data-math-semantic-operator="sum,+">+</mo>
|
|
<mrow data-math-semantic-parent="product" data-math-semantic-children="2">
|
|
<mrow id=4 data-math-semantic-child data-math-semantic-parent="6" data-math-semantic-children="5,7">
|
|
<mi data-math-semantic-child>b</mi>
|
|
<mi id=5 data-math-semantic-child>b</mi>
|
|
<mo data-math-semantic-operator>⋅</mo>
|
|
<mo id=6 data-math-semantic-operator="product,⋅">⋅</mo>
|
|
<mi data-math-semantic-child>d</mi>
|
|
<mi id=7 data-math-semantic-child>d</mi>
|
|
</mrow>
|
|
</mrow>
|
|
<mo data-math-semantic-operator>+</mo>
|
|
<mo id=8 data-math-semantic-operator="sum,+">+</mo>
|
|
<mi data-math-semantic-child>c</mi>
|
|
<mi id=9 data-math-semantic-child>c</mi>
|
|
</mrow>
|
|
</mrow>
|
|
</math>
|
|
</math>
|
|
```
|
|
```
|
|
|
|
|
|
This is assuming the MathML tree numbering (IDs) that Neil, Davide and the folks at Texthelp designed.
|
|
|
|
|
|
|
|
Questions:
|
|
Questions:
|
|
|
|
|
... | | ... | |