---
-
name: intent-exists
tag: "!*" match: "@intent"
replace: [x: "process-intent(.)"]
-
name: turn-off
tag: "!*" match: "$SpeechStyle = 'LiteralSpeak' or ancestor-or-self::*[contains(@data-intent-property, ':literal:')]"
replace:
- test:
- if: "*"
then:
- intent:
xpath-name: "name(.)"
children: [x: "*"]
- else_if: "text()"
then:
- intent:
xpath-name: "name(.)"
children: [x: "text()"]
else:
- intent:
xpath-name: "name(.)"
children: []
- include: "Intent/geometry.yaml"
- include: "Intent/linear-algebra.yaml"
- include: "Intent/calculus.yaml"
-
include: "Intent/general.yaml"
-
name: ignore-punctuation
tag: math
match: "*[1][self::m:mrow and count(*)=2 and *[2][translate(.,'.,;:?', '')='']]"
variables: [TableProperty: "''"]
replace:
- test:
if: "*[1]/*[1]"
then:
- intent:
name: "math"
children: [x: "*[1]/*[1]"]
else: [t: " "]
-
name: default
tag: math
match: "."
variables: [TableProperty: "''"]
replace:
- test:
if: "*"
then:
- intent:
name: "math"
children: [x: "*"]
else: [t: " "]
-
name: default
tag: mstyle
match: "."
replace:
- test:
if: "*"
then: [x: "*"]
else: [t: " "]
-
name: semantics
tag: "semantics"
match: "*[@encoding='MathML-Presentation']"
replace:
- test:
if: "parent::m:math and *[@encoding='MathML-Presentation'][self::m:mrow and count(*)=2 and *[2][translate(.,'.,;:?', '')='']]"
then: [x: "*[@encoding='MathML-Presentation']/*[1]"]
else: [x: "*[@encoding='MathML-Presentation']"]
-
name: semantics-default
tag: "semantics"
match: .
replace:
- test:
if: "parent::m:math and *[1][self::m:mrow and count(*)=2 and *[2][translate(.,'.,;:?', '')='']]"
then: [x: "*[1]/*[1]"]
else: [x: "*[1]"]
-
name: default
tag: "*"
match: "."
replace:
- test:
- if: "count(*) > 0"
then:
- intent:
xpath-name: "name(.)"
children: [x: "*"]
- else_if: "text()"
then:
- intent:
xpath-name: "name(.)"
children: [x: "text()"]
else:
- intent:
xpath-name: "name(.)"
children: []