Skip to content

ja: read a leading minus as マイナス - #4

Closed
yasumorishima wants to merge 1 commit into
jafrom
ja-negative-numbers
Closed

ja: read a leading minus as マイナス#4
yasumorishima wants to merge 1 commit into
jafrom
ja-negative-numbers

Conversation

@yasumorishima

@yasumorishima yasumorishima commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Third of the small PRs from daisy#715, independent of daisy#720 and daisy#721.

What is wrong

A unary + or - was spoken 正の / 負の. Those name a kind of number — 負の数 is "the negative numbers" as a category — and they are not how −5 is read aloud. Japanese reads it マイナス 5, using the same word as the binary operator; there is no separate "negative" word the way English distinguishes "negative five" from "five minus".

The reference this series follows agrees: its worked example reads −b as 「マイナス b」, and the symbol table in its appendix gives ± as 「プラス・オア・マイナス」. 負の does not appear anywhere in it.

山口雄仁・川根深・澤崎陽彦「日本語による数式読み上げ法の基本構成について」日本数学教育学会誌 78(9), 239–247 (1996)

Changes

Three pairs in ClearSpeak_Rules.yaml — the two PosNegSqRoot rules and negative_and_positive — and the prefix= forms of plus and minus in definitions.yaml.

Deliberately not touched: SharedRules/general.yaml, where 正の / 負の are correct. There they modify 整数 in "the set of all positive integers", which is exactly the categorical sense that makes them wrong as a reading of −5. A blanket replacement would have broken that, so the patch asserts that file is unchanged.

Tests

negative_number (−5 → 「マイナス 5」) in both styles.

Related

This is what daisy#721 left out. There, x⁻² came out as 「x の 負の 2 乗」; with this change it reads 「x の マイナス 2 乗」. I did not add that test to either PR because it needs both changes; it belongs in whichever of the two merges second, or in a follow-up.

Also spotted while here, for a later PR rather than this one: general.yaml renders ℂ as 「複雑な数字」 ("complicated numbers") and ℕ as 「自然な数字」. The mathematical terms are 複素数 and 自然数.

Summary by CodeRabbit

  • Improvements

    • Updated Japanese speech output to use “プラス” and “マイナス” for leading positive and negative signs.
    • Applied the updated wording to square-root, root, and unary plus/minus expressions.
    • Preserved existing wording for infix plus and minus operations.
  • Tests

    • Added coverage verifying that negative numbers are spoken correctly in Japanese ClearSpeak and SimpleSpeak modes.

A unary + or - was spoken 正の / 負の. Those name a kind of number -- 負の数
is "the negative numbers" as a category -- and are not how -5 is read aloud.
Japanese says マイナス 5, with the same word used for the binary operator;
the reference's worked example reads -b as マイナス b, and its symbol table
gives ± as プラス・オア・マイナス.

Three pairs in ClearSpeak_Rules.yaml (the two PosNegSqRoot rules and
negative_and_positive) and the prefix forms of "plus" and "minus" in
definitions.yaml.

Not touched: SharedRules/general.yaml, where 正の / 負の are correct -- there
they modify 整数 in "the set of all positive integers".
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bffd91f7-2f45-405c-9dfa-62d56576a557

📥 Commits

Reviewing files that changed from the base of the PR and between 7a6e3ad and e6fa70d.

📒 Files selected for processing (3)
  • Rules/Languages/ja/ClearSpeak_Rules.yaml
  • Rules/Languages/ja/definitions.yaml
  • tests/Languages/ja/ja.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Japanese sign pronunciation

Layer / File(s) Summary
Update sign speech rules and tests
Rules/Languages/ja/ClearSpeak_Rules.yaml, Rules/Languages/ja/definitions.yaml, tests/Languages/ja/ja.rs
Japanese ClearSpeak and prefix intent mappings now speak signs as “プラス” and “マイナス”. A test verifies negative-number output in ClearSpeak and SimpleSpeak.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to e6fa7

This localized Japanese speech-output change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Suggested reviewers: moritz-gross

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: Japanese speech reads a leading minus sign as 「マイナス」.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (2 skipped: 2 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ja-negative-numbers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yasumorishima

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@yasumorishima

Copy link
Copy Markdown
Owner Author

upstream に daisy#722 として提出したのでプリフライトは閉じます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant