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
6 changes: 3 additions & 3 deletions Rules/Languages/de/ClearSpeak_Rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
then: [pause: short]
else: [pause: long]

# The 'negative' rule interacts with the msqrt/mroot rules as those might pick off this case ("the negative square root of x")
# Prefix signs interact with the msqrt/mroot rules as those might pick off this case.
- name: negative_and_positive
tag: [plus, minus]
match: "count(*)=1 and contains(@data-intent-property, ':prefix:')"
Expand All @@ -122,8 +122,8 @@
- bookmark: "@id"
- test:
if: "self::m:minus"
then: [T: "negative"]
else: [T: "positive"]
then: [T: "minus"]
else: [T: "plus"]
- x: "*[1]"

# Fraction rules
Expand Down
4 changes: 2 additions & 2 deletions Rules/Languages/de/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"lim-inf": "prefix=lim inf bei: der untere grenzwert bei : der untere grenzwert bei",
"logarithm-with-base": "prefix=logarithmus basis: der logarithmus basis: der logarithmus basis",
"natural-logarithm": "function=ln: natürlicher logarithmus: natürlicher logarithmus",
"minus": "infix=minus || prefix=negativ",
"plus": "infix=plus || prefix=positiv",
"minus": "infix=minus || prefix=minus",
"plus": "infix=plus || prefix=plus",
"real-part": "function=der reale teil",
"transpose": "postfix=transponiert || function=die Transponierte",
"magnitude": "function=; Norm: Norm: Norm; Ende Norm",
Expand Down
6 changes: 3 additions & 3 deletions tests/Languages/de/ClearSpeak/intervals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn interval_negative_infinity_to_open_endpoint() -> Result<()> {
"ClearSpeak_Paren",
"Interval",
expr,
"das Intervall negative unendlich bis d, nicht einschließlich d",
"das Intervall minus unendlich bis d, nicht einschließlich d",
)
}

Expand All @@ -96,7 +96,7 @@ fn interval_negative_infinity_to_closed_endpoint() -> Result<()> {
"ClearSpeak_Paren",
"Interval",
expr,
"das Intervall negative unendlich bis d, einschließlich d",
"das Intervall minus unendlich bis d, einschließlich d",
)
}

Expand Down Expand Up @@ -144,6 +144,6 @@ fn interval_between_infinities_has_no_endpoint_qualifier() -> Result<()> {
"ClearSpeak_Paren",
"Interval",
expr,
"das Intervall negative unendlich bis unendlich",
"das Intervall minus unendlich bis unendlich",
)
}
2 changes: 1 addition & 1 deletion tests/Languages/de/ClearSpeak/mroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn neg_without_root() -> Result<()> {
let expr = "<math>
<mo>-</mo> <mi>x</mi> <mo>-</mo> <mi>y</mi>
</math>";
test("de", "ClearSpeak", expr, "negative x minus y")?;
test("de", "ClearSpeak", expr, "minus x minus y")?;
return Ok(());

}
Expand Down
8 changes: 4 additions & 4 deletions tests/Languages/de/ClearSpeak/symbols_and_adornments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn ellipses_auto_start() -> Result<()> {
<mi>…</mi><mo>,</mo>
<mo>-</mo><mn>2</mn><mo>,</mo><mo>-</mo><mn>1</mn><mo>,</mo><mn>0</mn>
</math>";
test("de", "ClearSpeak", expr, "punkt punkt punkt komma negative 2 komma negative 1 komma 0")?;
test("de", "ClearSpeak", expr, "punkt punkt punkt komma minus 2 komma minus 1 komma 0")?;
return Ok(());

}
Expand Down Expand Up @@ -135,7 +135,7 @@ fn ellipses_auto_both() -> Result<()> {
<mo>,</mo><mi>…</mi>
</math>";
test_ClearSpeak("de", "ClearSpeak_Ellipses", "Auto", expr,
"punkt punkt punkt komma negative 2 komma negative 1 komma 0 komma 1 komma 2 komma punkt punkt punkt")?;
"punkt punkt punkt komma minus 2 komma minus 1 komma 0 komma 1 komma 2 komma punkt punkt punkt")?;
return Ok(());

}
Expand All @@ -146,7 +146,7 @@ fn ellipses_and_so_on_start() -> Result<()> {
<mi>…</mi><mo>,</mo>
<mo>-</mo><mn>2</mn><mo>,</mo><mo>-</mo><mn>1</mn><mo>,</mo><mn>0</mn>
</math>";
test_ClearSpeak("de", "ClearSpeak_Ellipses", "AndSoOn", expr, "punkt punkt punkt komma negative 2 komma negative 1 komma 0")?;
test_ClearSpeak("de", "ClearSpeak_Ellipses", "AndSoOn", expr, "punkt punkt punkt komma minus 2 komma minus 1 komma 0")?;
return Ok(());

}
Expand Down Expand Up @@ -196,7 +196,7 @@ fn ellipses_and_so_on_both() -> Result<()> {
<mo>,</mo><mi>…</mi>
</math>";
test_ClearSpeak("de", "ClearSpeak_Ellipses", "AndSoOn", expr,
"punkt punkt punkt komma negative 2 komma negative 1 komma 0 komma 1 komma 2 komma punkt punkt punkt")?;
"punkt punkt punkt komma minus 2 komma minus 1 komma 0 komma 1 komma 2 komma punkt punkt punkt")?;
return Ok(());

}
Expand Down
2 changes: 1 addition & 1 deletion tests/Languages/de/mtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ fn identity_matrix_false_positive_negative_one() -> Result<()> {
<mo>]</mo>
</math>";
test_prefs("de", "SimpleSpeak", vec![("Verbosity", "Terse")],
expr, "die 2 mal 2 diagonalmatrix; spalte 1; 1; spalte 2; negativ 1")?;
expr, "die 2 mal 2 diagonalmatrix; spalte 1; 1; spalte 2; minus 1")?;
Ok(())
}

Expand Down
13 changes: 13 additions & 0 deletions tests/Languages/de/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ fn variable_powers() -> Result<()> {
Ok(())
}

#[test]
fn unary_signs_use_plus_and_minus() -> Result<()> {
// Unary signs use their mathematical names rather than adjectival forms.
let signed_numbers = "<math><mo>−</mo><mn>5</mn><mo>,</mo><mo>+</mo><mn>5</mn></math>";
test("de", "ClearSpeak", signed_numbers, "minus 5 komma plus 5")?;
test("de", "SimpleSpeak", signed_numbers, "minus 5 komma plus 5")?;

let negative_root = "<math><mo>−</mo><msqrt><mi>x</mi></msqrt></math>";
test("de", "ClearSpeak", negative_root, "minus die quadratwurzel von x")?;
test("de", "SimpleSpeak", negative_root, "minus die quadratwurzel von x")?;
Ok(())
}

#[test]
fn modified_vars() -> Result<()> {
let expr = "<math> <mrow>
Expand Down
Loading