Skip to content

Conversation

3w36zj6
Copy link
Member

@3w36zj6 3w36zj6 commented Sep 5, 2025

このPull Requestでは、textlintのルールとして、辞書ベースの校正を行うtextlint-rule-prhを導入します。これにより各用語の表記ゆれを抑制できます。

辞書に追加する用語は、「常に表現を統一すべき用語」と「状況に応じて適切な表現を選ぶ必要がある用語」に区分できると考えています。これらの区分に応じて、severity level をそれぞれ errorinfo に設定することで、柔軟な運用が可能になると考えます。このPRでは、まずは「常に表現を統一すべき用語」を辞書に追加します。

@3w36zj6 3w36zj6 marked this pull request as ready for review September 5, 2025 09:02
@3w36zj6 3w36zj6 requested a review from Copilot September 5, 2025 09:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces textlint-rule-prh, a dictionary-based proofreading rule for textlint, to prevent terminology inconsistencies. The implementation includes a prh.yaml configuration file with rules for consistent "Typst" capitalization and updates to textlint configuration to enable the new rule.

  • Adds textlint-rule-prh package dependency for dictionary-based text correction
  • Creates prh.yaml configuration file with Typst terminology rules
  • Updates textlint configuration to integrate the new proofreading rule

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
prh.yaml Defines dictionary rules for consistent "Typst" capitalization across different contexts
package.json Adds textlint-rule-prh and textlint-filter-rule-allowlist dependencies
.textlintrc.js Configures prh rule integration and adds allowlist filter for code blocks

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@3w36zj6
Copy link
Member Author

3w36zj6 commented Sep 17, 2025

@gomazarashi @kimushun1101 @ultimatile

prhの辞書に追加すべき単語について、意見を頂きたいです。
このPRで追加する単語は「常に表現を統一すべき用語」であり、翻訳後の日本語の文章に対して適用するルールとなります。
辞書に追加する単語のイメージとしては、textlint-rule-preset-JTF-styleに同梱されているものが参考になります。

@ultimatile
Copy link
Contributor

個人的に気になっているのが、すべて/全てとたとえば/例えばの表記揺れです。これは常に表現を統一すべき用語ですかね?

@3w36zj6
Copy link
Member Author

3w36zj6 commented Sep 21, 2025

叩き台として、花輪公雄氏の「原稿を作成する際の表記法・用語法について」を参考に、誤検知の対処が難しいものや技術文章に不要なルールを削除し、既存の文章に合わせてルールを調整した辞書を追加しました。

https://www.gp.tohoku.ac.jp/pol/pol/hanawa/open-siryo/report_manual.pdf

表記ゆれがルールベースで統一できれば、統一する表現自体にこだわりはないので、ご意見をお聞かせください。

@kimushun1101
Copy link
Member

kimushun1101 commented Sep 25, 2025

ご対応いただきありがとうございます。
私自身も詳しくはないので、議論の中で都度、追加や修正ができる枠組みであれば問題ないと思います。

  • 直近でいうと (super/sub)scriptに関する訳語の統一 #228 とか?
  • 「おすすめ」「オススメ」「お勧め」がありました。一つは記事(外部サイト)のタイトルであるため、それは判定しないような仕組みも必要かもしれません。

@3w36zj6 3w36zj6 requested a review from Copilot September 26, 2025 20:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 42 out of 43 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kimushun1101
Copy link
Member

「つねに」→「常に」

他のページでは、「つねに」は漢字で書かれています。

/// この関数は常に[整数値]($int)を返し、結果となる[`float`]や[`decimal`]が64ビット符号付き整数の最大値より大きい、または最小値より小さい場合はエラーとなることに注意してください。

Originally posted by @kimushun1101 in #289 (comment)

冪乗と冪乗(ひらがなも含む)→議論中のためissueに送る?

他の方にもご意見うかがいたいのですが、累乗と冪乗だとひらがなも含めてどのように統一したらよいと思いますか?統一しなくてもよい、もしくは正しく使い分けられているでしょうか?
現在、math/rootやmath/styleにもあります。

Originally posted by @kimushun1101 in #289 (comment)

@3w36zj6
Copy link
Member Author

3w36zj6 commented Sep 27, 2025

@gomazarashi
Copy link
Contributor

個人的には「冪乗」表記のほうが好みです。また、現状「累乗」となっている箇所も「冪乗」に統一しても良いかと思います。

@3w36zj6
Copy link
Member Author

3w36zj6 commented Sep 27, 2025

「累乗根」についてはどうしますか?「冪乗根」ではなく「冪根」がより一般的な表記のようです。

@ultimatile
Copy link
Contributor

個人的には「冪乗」/「冪根」で良いと思います。

@3w36zj6 3w36zj6 force-pushed the feature/add-textlint-rule-prh branch from f91af43 to e7ddb47 Compare September 28, 2025 09:13
@kimushun1101
Copy link
Member

@3w36zj6

変更箇所も多くなってきたため、以下の仕組みができていれば一旦ここらでマージしてもよいかと思いますが、いかがでしょうか?

  • 用語登録の方法:このPRでは変更箇所が多いため追いきれていませんが、つぎの変更のときに別PRで見せてもらえれば私でもマネできそうですかね?
  • 特定の場所は判定を無視する方法:/docs/japanese/articles.mdの「オススメ」は判定しないなど。

その他、懸念点やマージ前に確認しておきたいことなどあればご教示ください。

@3w36zj6
Copy link
Member Author

3w36zj6 commented Oct 1, 2025

辞書ベースのLintの仕組みは既に実現できているので、叩き台として用意した辞書データさえ問題なければマージできるという認識です。

リンク要素については、外部のページのタイトルなどのプロジェクトの制御下にない文章が入る場合がある関係で、ルールの設定でLint対象から外しています1

Footnotes

  1. https://github.com/typst-jp/docs/blob/98d82512807985ea38cc2ddc0501ebc1e1259856/.textlintrc.js#L25

@3w36zj6 3w36zj6 force-pushed the feature/add-textlint-rule-prh branch from 6da9ecd to 3b2373a Compare October 1, 2025 16:43
Copy link
Member

@kimushun1101 kimushun1101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ご回答いただきありがとうございます。リンク要素を除外する形で対応されているとのこと承知いたしました。

一旦は問題ないと思います。

Copy link
Contributor

@gomazarashi gomazarashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ご対応いただきありがとうございました。

@ultimatile
Copy link
Contributor

すみません、統一ルールに個人的に違和感があるものがあって、「原稿を作成する際の表記法・用語法について 」が基準だと思うのですが、その中だと、「表す」を「あらわす」とひらがなにするのは、いまいち根拠がわかりません。

また、「したがって」を「従って」と「原稿を作成する際の表記法・用語法について 」と反するルールになっているのはなぜでしょうか?
個人的にはこれはひらがなの方が好ましいと思っています。

何らかの統一的な方針が作れると良いのですが、漢字の方がLLMなどのトークン消費量を抑えられるため、個人的には、可能な限り漢字表記+当て字系は本来不適切なのでひらがな、というのが好みです。

@3w36zj6
Copy link
Member Author

3w36zj6 commented Oct 5, 2025

公用文の用字用語例によると、「従う」(動詞)、「したがって」(接続詞)、「表す」と統一するのが良さそうですが、これで統一してよろしいでしょうか?

「あらわす」には「現す」や「著す」を使う場面もありますが、Typstの技術文章でこれらの使用場面はなさそうなので、いったん「表す」で統一することにします。

@ultimatile
Copy link
Contributor

ultimatile commented Oct 5, 2025

ありがとうございます。良さそうです。
参考になりそうなものとして公用文作成の考え方(建議) を見てました。p11, p12あたりです。

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.

4 participants