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
10 changes: 5 additions & 5 deletions Rules/Languages/ja/SharedRules/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@
if: "$Verbosity!='Terse'"
then: [ot: ""] # phrase('the' square root of 25 equals 5)
- x: "*[1]"
- t: "から" # phrase(subtracting 5 'from' 10 gives 5)
- x: "*[2]"
- t: "から" # phrase(subtracting 5 'from' 10 gives 5)
- pause: short
- t: "に" # phrase(adding 6 'to' 6 equals 12)
- x: "*[3]"
- t: "まで" # phrase(adding 6 'to' 6 equals 12)
- test:
if: "following-sibling::*"
then: [t: ""] # phrase(the square root 'of' 25 equals 5)
then: [t: "オブ"] # phrase(the square root 'of' 25 equals 5)

- name: bigop-under
tag: large-op
Expand All @@ -173,11 +173,11 @@
if: "$Verbosity!='Terse'"
then: [ot: ""] # phrase('the' square root of 25 equals 5)
- x: "*[1]"
- t: "分の" # phrase(2 'over' 3 equals two thirds)
- x: "*[2]"
- t: "にわたる" # phrase(2 'over' 3 equals two thirds)
- test:
if: "following-sibling::*"
then: [t: ""] # phrase(the square root 'of' 25 equals 5)
then: [t: "オブ"] # phrase(the square root 'of' 25 equals 5)

- name: largeop
tag: mrow
Expand Down
20 changes: 18 additions & 2 deletions tests/Languages/ja/ja.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,30 @@ fn set_membership() -> Result<()> {
#[test]
fn summation() -> Result<()> {
let expr = "<math><munderover><mo>&#x2211;</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><mi>i</mi></math>";
test("ja", "SimpleSpeak", expr, "総和 から i イコール 1, に n の i")?;
test("ja", "SimpleSpeak", expr, "総和 i イコール 1 から, n まで オブ i")?;
return Ok(());
}

/// A large operator with only a lower limit takes the postposed "over" cue.
#[test]
fn summation_lower_limit_only() -> Result<()> {
let expr = "<math><munder><mo>&#x2211;</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow></munder><mi>i</mi></math>";
test("ja", "SimpleSpeak", expr, "総和 i イコール 1 にわたる オブ i")?;
return Ok(());
}

/// The same shape is used for the other large operators.
#[test]
fn product_with_limits() -> Result<()> {
let expr = "<math><munderover><mo>&#x220F;</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><mi>i</mi></math>";
test("ja", "SimpleSpeak", expr, "プロダクト i イコール 1 から, n まで オブ i")?;
return Ok(());
}

/// Verifies the seeded Japanese cues for a definite integral.
#[test]
fn definite_integral() -> Result<()> {
let expr = "<math><msubsup><mo>&#x222B;</mo><mn>0</mn><mn>1</mn></msubsup><mi>x</mi><mo>&#x2146;</mo><mi>x</mi></math>";
test("ja", "SimpleSpeak", expr, "積分 から 0, に 1 の; x 微分 d x")?;
test("ja", "SimpleSpeak", expr, "積分 0 から, 1 まで オブ; x 微分 d x")?;
return Ok(());
}