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
8 changes: 1 addition & 7 deletions Rules/Languages/de/ClearSpeak_Rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,7 @@
replace:
- x: "*[1]"
- T: "hoch"
- test:
if: "*[2][.>0]"
then: [x: "ToOrdinal(*[2])"]
else: [x: "*[2]"]
- test:
if: "$ClearSpeak_Exponents != 'Ordinal'"
then: [T: "hoch"]
- x: "*[2]"

- name: simple-negative-integer
tag: power
Expand Down
7 changes: 2 additions & 5 deletions Rules/Languages/de/SimpleSpeak_Rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,8 @@
match: "*[2][self::m:mn][not(contains(., '.'))]"
replace:
- x: "*[1]"
- T: "zu dem" # phrase(15 raised 'to the' second power equals 225)
- test:
if: "*[2][.>0]"
then: [x: "ToOrdinal(*[2])"]
else: [x: "*[2]"]
- T: "hoch" # phrase(15 raised 'to the' fourth power equals 50625)
- x: "*[2]"
- name: simple-negative-integer
tag: power
match:
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 @@ -3,6 +3,19 @@
use crate::common::*;
use anyhow::Result;

#[test]
fn ordinary_integer_powers() -> Result<()> {
// Ordinary integer exponents use the idiomatic German "hoch" construction.
let fourth_power = "<math><msup><mi>x</mi><mn>4</mn></msup></math>";
test("de", "ClearSpeak", fourth_power, "x hoch 4")?;
test("de", "SimpleSpeak", fourth_power, "x hoch 4")?;

let zeroth_power = "<math><msup><mi>x</mi><mn>0</mn></msup></math>";
test("de", "ClearSpeak", zeroth_power, "x hoch 0")?;
test("de", "SimpleSpeak", zeroth_power, "x hoch 0")?;
Ok(())
}

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