Skip to content

Commit

Permalink
Restrict skipping of saying "of" when NavVerbosity is 'terse' to just…
Browse files Browse the repository at this point in the history
… trig-like functions. This means "f x" -> "f of x" in terse mode. It would say "of" in other modes before this.

Fixes #336.
  • Loading branch information
NSoiffer committed Jan 17, 2025
1 parent 34886d4 commit ba62dae
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
Binary file added PythonScripts/BrailleMathCodes Repository.xlsx
Binary file not shown.
3 changes: 2 additions & 1 deletion Rules/Languages/en/unicode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@

- "": # 0x2061
- test:
if: "$Verbosity!='Terse' and not(preceding-sibling::*[1][IsInDefinition(., 'GeometryShapes')]) and
# skip saying "of" when Terse and a trig function, when it is a shape (does this happen?), or we are in :literal mode
if: "not($Verbosity='Terse' and preceding-sibling::*[1][IsInDefinition(., 'TrigFunctionNames')]) and not(preceding-sibling::*[1][IsInDefinition(., 'GeometryShapes')]) and
not(@data-changed='added' and ancestor-or-self::*[contains(@data-intent-property, ':literal:')])"
then: [t: "of"]
- "": [t: ""] # 0x2062
Expand Down
5 changes: 3 additions & 2 deletions Rules/Languages/fi/unicode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,9 @@

- "": # 0x2061, function application
- test:
if: "$Verbosity!='Terse' and not(preceding-sibling::*[1][IsInDefinition(., 'GeometryShapes')]) and
not(@data-changed='added' and ancestor-or-self::*[contains(@data-intent-property, ':structure:')])"
# skip saying "of" when Terse and a trig function, when it is a shape (does this happen?), or we are in :literal mode
if: "not($Verbosity='Terse' and preceding-sibling::*[1][IsInDefinition(., 'TrigFunctionNames')]) and not(preceding-sibling::*[1][IsInDefinition(., 'GeometryShapes')]) and
not(@data-changed='added' and ancestor-or-self::*[contains(@data-intent-property, ':literal:')])"
then: [T: "arvolla"]
- "": [T: ""] # 0x2062 # invisible 'times', fi: should this have a value?
- "": [T: ""] # 0x2063 # invisible 'separator', fi: should this have a value?
Expand Down
6 changes: 1 addition & 5 deletions Rules/Languages/zh/tw/unicode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,7 @@
then: [T: "等等"] # (en: 'and so on', google translation)
else: [T: "等等"] # (en: 'and so on up to', google translation)

- "": # 0x2061
- test:
if: "$Verbosity!='Terse' and not(preceding-sibling::*[1][IsInDefinition(., 'GeometryShapes')]) and
not(@data-changed='added' and ancestor-or-self::*[contains(@data-intent-property, ':literal:')])"
then: [T: ""] # (en: 'of', google translation)
- "": [T: ""] # (en: 'of', google translation)
- "": [t: ""] # 0x2062
- "": [t: ""] # 0x2063
- "": [T: "又"] # 0x2064 (en: 'and', google translation)(3 又 1/2)
Expand Down
2 changes: 1 addition & 1 deletion tests/Languages/en/SimpleSpeak/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn other_names() {
expr, "covariance x");
let expr = "<math> <mrow><mi>exp</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow> </math>";
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "exp x");
expr, "exp of x");
test_prefs("en", "SimpleSpeak", vec![("Verbosity", "Medium")],
expr, "exponential of x");
}
Expand Down

0 comments on commit ba62dae

Please sign in to comment.