Skip to content

Commit

Permalink
Merge pull request #56 from Speech-Rule-Engine/bugfix/html_in_token
Browse files Browse the repository at this point in the history
Bugfix/html in token
  • Loading branch information
zorkow authored Nov 14, 2024
2 parents 5cce735 + 1ca3962 commit 2ffc4ef
Show file tree
Hide file tree
Showing 7 changed files with 223 additions and 7 deletions.
60 changes: 60 additions & 0 deletions expected/semantic/enrich_mathml/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,66 @@
},
"issue451_6": {
"expected": "<math type=\"relseq\" role=\"equality\" id=\"19\" children=\"16,18\" content=\"4\"><mrow added=\"true\" type=\"appl\" role=\"simple function\" annotation=\"clearspeak:simple\" id=\"16\" children=\"0,14\" content=\"15,0\" parent=\"19\"><mi type=\"identifier\" role=\"simple function\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"16\" operator=\"appl\">M</mi><mo type=\"punctuation\" role=\"application\" id=\"15\" parent=\"16\" added=\"true\" operator=\"appl\">⁡</mo><mrow added=\"true\" type=\"fenced\" role=\"leftright\" id=\"14\" children=\"2\" content=\"1,3\" parent=\"16\"><mo type=\"fence\" role=\"open\" id=\"1\" parent=\"14\" operator=\"fenced\">(</mo><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"2\" parent=\"14\">t</mi><mo type=\"fence\" role=\"close\" id=\"3\" parent=\"14\" operator=\"fenced\">)</mo></mrow></mrow><mo type=\"relation\" role=\"equality\" id=\"4\" parent=\"19\" operator=\"relseq,=\">=</mo><mrow added=\"true\" type=\"infixop\" role=\"implicit\" annotation=\"clearspeak:unit\" id=\"18\" children=\"12,13\" content=\"17\" parent=\"19\"><mrow type=\"appl\" role=\"implicit\" id=\"12\" children=\"8,10\" content=\"11\" parent=\"18\"><mrow type=\"infixop\" role=\"implicit\" annotation=\"clearspeak:simple;clearspeak:unit\" id=\"8\" children=\"5,6\" content=\"7\" parent=\"12\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"5\" parent=\"8\">l</mi><mo type=\"operator\" role=\"multiplication\" id=\"7\" parent=\"8\" added=\"true\" operator=\"infixop,⁢\">⁢</mo><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"6\" parent=\"8\">i</mi></mrow><mo type=\"punctuation\" role=\"application\" id=\"11\" parent=\"12\" operator=\"appl\">⁡</mo><mi type=\"identifier\" role=\"simple function\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"10\" parent=\"12\">M</mi></mrow><mo type=\"operator\" role=\"multiplication\" id=\"17\" parent=\"18\" added=\"true\" operator=\"infixop,⁢\">⁢</mo><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"13\" parent=\"18\">x</mi></mrow></math>"
},
"Mglyph_Mixed_Token_0": {
"expected": "<math><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\"><mglyph src=\"my-glyph.png\" alt=\"my glyph\"/>a</mi></math>"
},
"Mglyph_Mixed_Token_1": {
"expected": "<math><mo type=\"operator\" role=\"addition\" id=\"0\"><mglyph src=\"my-glyph.png\" alt=\"my glyph\"/>+</mo></math>"
},
"Mglyph_Mixed_Token_2": {
"expected": "<math><mn type=\"number\" role=\"integer\" font=\"normal\" annotation=\"clearspeak:simple\" id=\"0\"><mglyph src=\"my-glyph.png\" alt=\"my glyph\"/>2</mn></math>"
},
"Mglyph_Mixed_Token_3": {
"expected": "<math><mi type=\"identifier\" role=\"unknown\" font=\"normal\" id=\"0\">a<mglyph src=\"my-glyph.png\" alt=\"my glyph\"/>a</mi></math>"
},
"Mglyph_Mixed_Token_4": {
"expected": "<math><mo type=\"operator\" role=\"addition\" id=\"0\">+<mglyph src=\"my-glyph.png\" alt=\"my glyph\"/>+</mo></math>"
},
"Mglyph_Mixed_Token_5": {
"expected": "<math><mn type=\"number\" role=\"integer\" font=\"normal\" annotation=\"clearspeak:simple\" id=\"0\">2<mglyph src=\"my-glyph.png\" alt=\"my glyph\"/>2</mn></math>"
},
"Mglyph_Mixed_Token_6": {
"expected": "<math><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\">a<mglyph src=\"my-glyph.png\" alt=\"my glyph\"/></mi></math>"
},
"Mglyph_Mixed_Token_7": {
"expected": "<math><mo type=\"operator\" role=\"addition\" id=\"0\">+<mglyph src=\"my-glyph.png\" alt=\"my glyph\"/></mo></math>"
},
"Mglyph_Mixed_Token_8": {
"expected": "<math><mn type=\"number\" role=\"integer\" font=\"normal\" annotation=\"clearspeak:simple\" id=\"0\">2<mglyph src=\"my-glyph.png\" alt=\"my glyph\"/></mn></math>"
},
"Mglyph_Mixed_Token_9": {
"expected": "<math type=\"infixop\" role=\"addition\" id=\"3\" children=\"0,2\" content=\"1\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"3\">a</mi><mo type=\"operator\" role=\"addition\" id=\"1\" parent=\"3\" operator=\"infixop,+\">+<mglyph src=\"my-glyph.png\" alt=\"my glyph\"/></mo><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"2\" parent=\"3\">b</mi></math>"
},
"Html_issue_0": {
"expected": "<math><mo type=\"identifier\" role=\"latinletter\" annotation=\"clearspeak:simple\" id=\"0\"><div>a</div>a</mo></math>"
},
"Html_issue_1": {
"expected": "<math><mtext type=\"text\" role=\"unknown\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"0\"><span>y</span></mtext></math>"
},
"Html_issue_2": {
"expected": "<math type=\"infixop\" role=\"implicit\" annotation=\"clearspeak:simple;clearspeak:unit\" id=\"3\" children=\"0,1\" content=\"2\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"3\">x</mi><mo type=\"operator\" role=\"multiplication\" id=\"2\" parent=\"3\" added=\"true\" operator=\"infixop,⁢\">⁢</mo><mtext type=\"identifier\" role=\"latinletter\" font=\"normal\" annotation=\"general:text;clearspeak:simple\" id=\"1\" parent=\"3\"><span>y</span></mtext></math>"
},
"Html_issue_3": {
"expected": "<math type=\"infixop\" role=\"implicit\" annotation=\"clearspeak:unit\" id=\"5\" children=\"0,1,2\" content=\"3,4\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"5\">x</mi><mo type=\"operator\" role=\"multiplication\" id=\"3\" parent=\"5\" added=\"true\" operator=\"infixop,⁢\">⁢</mo><mtext type=\"identifier\" role=\"latinletter\" font=\"normal\" annotation=\"general:text;clearspeak:simple\" id=\"1\" parent=\"5\"><span>y</span></mtext><mo type=\"operator\" role=\"multiplication\" id=\"4\" parent=\"5\" added=\"true\" operator=\"infixop,⁢\">⁢</mo><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"2\" parent=\"5\">y</mi></math>"
},
"Html_issue_4": {
"expected": "<math type=\"punctuated\" role=\"text\" id=\"5\" children=\"0,1,2\" collapsed=\"(5 (c 3 4) 0 1 2)\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"5\">x</mi><mtext type=\"text\" role=\"text\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"1\" parent=\"5\">a<span>y</span></mtext><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"2\" parent=\"5\">y</mi></math>"
},
"Html_issue_5": {
"expected": "<math type=\"punctuated\" role=\"text\" id=\"5\" children=\"0,1,2\" collapsed=\"(5 (c 3 4) 0 1 2)\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"5\">x</mi><mtext type=\"text\" role=\"text\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"1\" parent=\"5\"><span>y</span>b</mtext><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"2\" parent=\"5\">y</mi></math>"
},
"Html_issue_6": {
"expected": "<math type=\"punctuated\" role=\"text\" id=\"5\" children=\"0,1,2\" collapsed=\"(5 (c 3 4) 0 1 2)\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"5\">x</mi><mtext type=\"text\" role=\"text\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"1\" parent=\"5\">a<span>y</span>b</mtext><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"2\" parent=\"5\">y</mi></math>"
},
"Html_issue_7": {
"expected": "<math><mtext type=\"text\" role=\"unknown\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"0\">a<span>y</span></mtext></math>"
},
"Html_issue_8": {
"expected": "<math><mtext type=\"text\" role=\"unknown\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"0\"><span>y</span>b</mtext></math>"
},
"Html_issue_9": {
"expected": "<math><mtext type=\"text\" role=\"unknown\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"0\">a<span>y</span>b</mtext></math>"
}
}
}
20 changes: 16 additions & 4 deletions expected/semantic/enrich_mathml/tables.json
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,10 @@
"expected": "<math type=\"infixop\" role=\"addition\" id=\"3\" children=\"0,2\" content=\"1\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"3\">a</mi><mo type=\"operator\" role=\"addition\" id=\"1\" parent=\"3\" operator=\"infixop,+\">+</mo><semantics><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"2\" parent=\"3\">b</mi><annotation>something</annotation></semantics></math>"
},
"SemanticsAnnotationXml_0": {
"expected": "<math><semantics><annotation-xml><content type=\"text\" role=\"annotation\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"0\">something</content></annotation-xml></semantics></math>"
"expected": "<math><semantics><annotation-xml type=\"text\" role=\"annotation\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"0\"><content>something</content></annotation-xml></semantics></math>"
},
"SemanticsAnnotationXml_1": {
"expected": "<math><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"3\">a</mi><semantics><annotation-xml><mrow added=\"true\" type=\"punctuated\" role=\"text\" id=\"3\" children=\"0,1\" collapsed=\"(3 (c 2) 0 1)\"><content type=\"text\" role=\"annotation\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"1\" parent=\"3\">something</content></mrow></annotation-xml></semantics></math>"
"expected": "<math><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"3\">a</mi><semantics type=\"punctuated\" role=\"text\" id=\"3\" children=\"0,1\" collapsed=\"(3 (c 2) 0 1)\"><annotation-xml type=\"text\" role=\"annotation\" font=\"normal\" annotation=\"clearspeak:unit\" id=\"1\" parent=\"3\"><content>something</content></annotation-xml></semantics></math>"
},
"SemanticsAnnotationXml_2": {
"expected": "<math><semantics><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\">a</mi><annotation-xml><content>something</content></annotation-xml></semantics></math>"
Expand Down Expand Up @@ -884,10 +884,10 @@
"expected": "<math type=\"infixop\" role=\"addition\" id=\"5\" children=\"0,2,4\" content=\"1,3\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"5\">a</mi><mo type=\"operator\" role=\"addition\" id=\"1\" parent=\"5\" operator=\"infixop,+\">+</mo><maction selection=\"2\"><mn>1</mn><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"2\" parent=\"5\">b</mi></maction><mo type=\"operator\" role=\"addition\" id=\"3\" parent=\"5\" operator=\"infixop,+\">+</mo><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"4\" parent=\"5\">c</mi></math>"
},
"EllipsesCombined_0": {
"expected": "<math added=\"true\" type=\"punctuated\" role=\"ellipsis\" id=\"4\" children=\"3\" content=\"3\"><mrow added=\"true\" type=\"punctuation\" role=\"ellipsis\" id=\"3\" children=\"0,1,2\" parent=\"4\" operator=\"punctuated\"><mo type=\"punctuation\" role=\"fullstop\" id=\"0\" parent=\"3\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"3\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"3\">.</mo></mrow></math>"
"expected": "<math type=\"punctuation\" role=\"ellipsis\" id=\"3\" children=\"0,1,2\"><mo type=\"punctuation\" role=\"fullstop\" id=\"0\" parent=\"3\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"3\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"3\">.</mo></math>"
},
"EllipsesCombined_1": {
"expected": "<math added=\"true\" type=\"punctuated\" role=\"ellipsis\" id=\"6\" children=\"5\" content=\"5\"><mrow added=\"true\" type=\"punctuation\" role=\"ellipsis\" id=\"5\" children=\"0,1,2,3,4\" parent=\"6\" operator=\"punctuated\"><mo type=\"punctuation\" role=\"fullstop\" id=\"0\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"3\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"4\" parent=\"5\">.</mo></mrow></math>"
"expected": "<math type=\"punctuation\" role=\"ellipsis\" id=\"5\" children=\"0,1,2,3,4\"><mo type=\"punctuation\" role=\"fullstop\" id=\"0\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"3\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"4\" parent=\"5\">.</mo></math>"
},
"EllipsesCombined_2": {
"expected": "<math type=\"punctuated\" role=\"ellipsis\" id=\"5\" children=\"0,4\" content=\"4\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"5\">a</mi><mrow added=\"true\" type=\"punctuation\" role=\"ellipsis\" id=\"4\" children=\"1,2,3\" parent=\"5\" operator=\"punctuated\"><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"4\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"4\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"3\" parent=\"4\">.</mo></mrow></math>"
Expand All @@ -897,6 +897,18 @@
},
"EllipsesCombined_4": {
"expected": "<math type=\"punctuated\" role=\"sequence\" id=\"6\" children=\"0,5,4\" content=\"5\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"6\">a</mi><mrow added=\"true\" type=\"punctuation\" role=\"ellipsis\" id=\"5\" children=\"1,2,3\" parent=\"6\" operator=\"punctuated\"><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"3\" parent=\"5\">.</mo></mrow><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"4\" parent=\"6\">b</mi></math>"
},
"EllipsesCombined_5": {
"expected": "<math type=\"punctuated\" role=\"ellipsis\" id=\"4\" children=\"0,3\" content=\"3\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"4\">a</mi><mrow type=\"punctuation\" role=\"ellipsis\" id=\"3\" children=\"1,2\" parent=\"4\" operator=\"punctuated\"><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"3\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"3\">.</mo></mrow></math>"
},
"EllipsesCombined_6": {
"expected": "<math type=\"punctuated\" role=\"ellipsis\" id=\"5\" children=\"0,4\" content=\"4\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"5\">a</mi><mrow type=\"punctuation\" role=\"ellipsis\" id=\"4\" children=\"1,2,3\" parent=\"5\" operator=\"punctuated\"><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"4\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"4\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"3\" parent=\"4\">.</mo></mrow></math>"
},
"EllipsesCombined_7": {
"expected": "<math type=\"punctuated\" role=\"sequence\" id=\"6\" children=\"0,4,5\" content=\"4\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"6\">a</mi><mrow type=\"punctuation\" role=\"ellipsis\" id=\"4\" children=\"1,2,3\" parent=\"6\" operator=\"punctuated\"><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"4\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"4\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"3\" parent=\"4\">.</mo></mrow><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"5\" parent=\"6\">b</mi></math>"
},
"EllipsesCombined_8": {
"expected": "<math type=\"infixop\" role=\"implicit\" annotation=\"clearspeak:unit\" id=\"8\" children=\"0,6\" content=\"7\"><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"0\" parent=\"8\">a</mi><mo type=\"operator\" role=\"multiplication\" id=\"7\" parent=\"8\" added=\"true\" operator=\"infixop,⁢\">⁢</mo><mrow type=\"punctuated\" role=\"ellipsis\" id=\"6\" children=\"5,4\" content=\"5\" parent=\"8\"><mrow added=\"true\" type=\"punctuation\" role=\"ellipsis\" id=\"5\" children=\"1,2,3\" parent=\"6\" operator=\"punctuated\"><mo type=\"punctuation\" role=\"fullstop\" id=\"1\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"2\" parent=\"5\">.</mo><mo type=\"punctuation\" role=\"fullstop\" id=\"3\" parent=\"5\">.</mo></mrow><mi type=\"identifier\" role=\"latinletter\" font=\"italic\" annotation=\"clearspeak:simple\" id=\"4\" parent=\"6\">b</mi></mrow></math>"
}
}
}
Loading

0 comments on commit 2ffc4ef

Please sign in to comment.