diff --git a/Rules/Languages/ja/SharedRules/general.yaml b/Rules/Languages/ja/SharedRules/general.yaml index 75f113e5..1642e6fa 100644 --- a/Rules/Languages/ja/SharedRules/general.yaml +++ b/Rules/Languages/ja/SharedRules/general.yaml @@ -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] diff --git a/tests/Languages/ja/ja.rs b/tests/Languages/ja/ja.rs index bdc1fcca..41d1f0f0 100644 --- a/tests/Languages/ja/ja.rs +++ b/tests/Languages/ja/ja.rs @@ -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 = "P25"; + test("ja", "ClearSpeak", expr, "5 個から 2 個取る順列")?; + test("ja", "SimpleSpeak", expr, "5 個から 2 個取る順列")?; + return Ok(()); +}