Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Rules/Languages/de/ClearSpeak_Rules.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
---
- name: pause
tag: "!*"
match: "not(self::m:math) and not($MatchingPause) and @data-intent-property[contains(., ':pause')]"
replace:
- with:
variables: [MatchingPause: "true()"]
replace:
- test:
- if: "contains(@data-intent-property, ':pause-long')"
then: [pause: long]
- else_if: "contains(@data-intent-property, ':pause-short')"
then: [pause: short]
else: [pause: medium]
- x: "."

- name: intent-literal-silent
tag: [mi, mo, mn]
match: "contains(@data-intent-property, ':silent:')"
Expand Down
21 changes: 21 additions & 0 deletions tests/Languages/de/intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@
use crate::common::*;
use anyhow::Result;

#[test]
fn clear_speak_short_pause_intent() -> Result<()> {
// A short pause intent should survive intent inference and render as a comma.
let expr = "<math><mrow><mi>x</mi><mi intent=':pause-short:y'>y</mi></mrow></math>";
test("de", "ClearSpeak", expr, "x, y")
}

#[test]
fn clear_speak_medium_pause_intent() -> Result<()> {
// An unsuffixed pause intent requests the default medium pause.
let expr = "<math><mrow><mi>x</mi><mi intent=':pause:y'>y</mi></mrow></math>";
test("de", "ClearSpeak", expr, "x; y")
}

#[test]
fn clear_speak_long_pause_intent() -> Result<()> {
// A long pause intent should be preserved in ClearSpeak text output.
let expr = "<math><mrow><mi>x</mi><mi intent=':pause-long:y'>y</mi></mrow></math>";
test("de", "ClearSpeak", expr, "x; y")
}


#[test]
fn silent_intent() -> Result<()> {
Expand Down
Loading