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: 6 additions & 4 deletions Rules/Languages/ja/SharedRules/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@
- t: "同じ式が評価されるマイナス" # phrase(this result is 'minus the same expression evaluated at' an earlier point)
- x: "*[2]"

- name: permutation
# Not a default because the order of the args is reversed
- name: permutation # audit-ignore
# en reverses the args ("k permutations of n"); Japanese reads nPk in display
# order with the standard school phrase: 5P2 = "5 個から 2 個取る順列"
tag: pochhammer
match: "count(*)=2 and contains(@data-intent-property, ':infix:')"
replace:
- x: "*[2]"
- t: "順列の" # phrase(the solution involves several 'permutations of' values)
- x: "*[1]"
- T: "個から" # phrase(the solution involves several 'permutations of' values)
- x: "*[2]"
- T: "個取る順列"

- name: intervals
tag: [open-interval, open-closed-interval, closed-interval, closed-open-interval]
Expand Down
12 changes: 12 additions & 0 deletions tests/Languages/ja/ja.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,3 +629,15 @@ fn divides_and_similar() -> Result<()> {
}
return Ok(());
}

/// nPk permutation notation is read with the standard Japanese school phrase
/// and in display order: (superscript 5) P (subscript 2) is
/// "5 個から 2 個取る順列" ("permutations taking 2 out of 5").
/// en reverses the arguments ("2 permutations of 5"); Japanese does not need to.
#[test]
fn permutation_p_notation() -> Result<()> {
let expr = "<math><msubsup><mi>P</mi><mn>2</mn><mn>5</mn></msubsup></math>";
test("ja", "ClearSpeak", expr, "5 個から 2 個取る順列")?;
test("ja", "SimpleSpeak", expr, "5 個から 2 個取る順列")?;
return Ok(());
}