chaffjs 0.51.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/dist/clause-particles.d.ts +10 -2
  2. package/dist/clause-particles.d.ts.map +1 -1
  3. package/dist/clause-particles.js +15 -3
  4. package/dist/clause-particles.js.map +1 -1
  5. package/dist/detectors/address-blank.d.ts +14 -0
  6. package/dist/detectors/address-blank.d.ts.map +1 -0
  7. package/dist/detectors/address-blank.js +41 -0
  8. package/dist/detectors/address-blank.js.map +1 -0
  9. package/dist/detectors/bold-emphasis-form.d.ts +1 -0
  10. package/dist/detectors/bold-emphasis-form.d.ts.map +1 -1
  11. package/dist/detectors/bold-emphasis-form.js +7 -1
  12. package/dist/detectors/bold-emphasis-form.js.map +1 -1
  13. package/dist/detectors/char-shape.d.ts.map +1 -1
  14. package/dist/detectors/char-shape.js +7 -8
  15. package/dist/detectors/char-shape.js.map +1 -1
  16. package/dist/detectors/closing-cliche.d.ts +1 -1
  17. package/dist/detectors/closing-cliche.d.ts.map +1 -1
  18. package/dist/detectors/closing-cliche.js +16 -3
  19. package/dist/detectors/closing-cliche.js.map +1 -1
  20. package/dist/detectors/contraction-mix.d.ts.map +1 -1
  21. package/dist/detectors/contraction-mix.js +3 -1
  22. package/dist/detectors/contraction-mix.js.map +1 -1
  23. package/dist/detectors/currency-notation.d.ts.map +1 -1
  24. package/dist/detectors/currency-notation.js +9 -1
  25. package/dist/detectors/currency-notation.js.map +1 -1
  26. package/dist/detectors/definition-use.d.ts.map +1 -1
  27. package/dist/detectors/definition-use.js +1 -0
  28. package/dist/detectors/definition-use.js.map +1 -1
  29. package/dist/detectors/en-shape.d.ts.map +1 -1
  30. package/dist/detectors/en-shape.js +12 -1
  31. package/dist/detectors/en-shape.js.map +1 -1
  32. package/dist/detectors/gram-ending.d.ts +12 -0
  33. package/dist/detectors/gram-ending.d.ts.map +1 -0
  34. package/dist/detectors/gram-ending.js +27 -0
  35. package/dist/detectors/gram-ending.js.map +1 -0
  36. package/dist/detectors/gram-repetition.d.ts.map +1 -1
  37. package/dist/detectors/gram-repetition.js +19 -3
  38. package/dist/detectors/gram-repetition.js.map +1 -1
  39. package/dist/detectors/inline-item-label.d.ts.map +1 -1
  40. package/dist/detectors/inline-item-label.js +14 -3
  41. package/dist/detectors/inline-item-label.js.map +1 -1
  42. package/dist/detectors/kanji-run-pieces.d.ts +21 -6
  43. package/dist/detectors/kanji-run-pieces.d.ts.map +1 -1
  44. package/dist/detectors/kanji-run-pieces.js +23 -8
  45. package/dist/detectors/kanji-run-pieces.js.map +1 -1
  46. package/dist/detectors/list-item-own.d.ts +11 -0
  47. package/dist/detectors/list-item-own.d.ts.map +1 -0
  48. package/dist/detectors/list-item-own.js +31 -0
  49. package/dist/detectors/list-item-own.js.map +1 -0
  50. package/dist/detectors/list-item-phrase.d.ts +1 -1
  51. package/dist/detectors/list-item-phrase.d.ts.map +1 -1
  52. package/dist/detectors/list-item-phrase.js +18 -7
  53. package/dist/detectors/list-item-phrase.js.map +1 -1
  54. package/dist/detectors/list-joint.d.ts +6 -0
  55. package/dist/detectors/list-joint.d.ts.map +1 -1
  56. package/dist/detectors/list-joint.js +18 -2
  57. package/dist/detectors/list-joint.js.map +1 -1
  58. package/dist/detectors/list-parallel.d.ts +3 -8
  59. package/dist/detectors/list-parallel.d.ts.map +1 -1
  60. package/dist/detectors/list-parallel.js +18 -32
  61. package/dist/detectors/list-parallel.js.map +1 -1
  62. package/dist/detectors/open-end-scope.d.ts.map +1 -1
  63. package/dist/detectors/open-end-scope.js +2 -2
  64. package/dist/detectors/open-end-scope.js.map +1 -1
  65. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  66. package/dist/detectors/oxford-comma.js +2 -1
  67. package/dist/detectors/oxford-comma.js.map +1 -1
  68. package/dist/detectors/pseudo-heading.d.ts +2 -0
  69. package/dist/detectors/pseudo-heading.d.ts.map +1 -1
  70. package/dist/detectors/pseudo-heading.js +63 -2
  71. package/dist/detectors/pseudo-heading.js.map +1 -1
  72. package/dist/detectors/register-label-note.d.ts +8 -0
  73. package/dist/detectors/register-label-note.d.ts.map +1 -0
  74. package/dist/detectors/register-label-note.js +31 -0
  75. package/dist/detectors/register-label-note.js.map +1 -0
  76. package/dist/detectors/run-in-title.d.ts +6 -0
  77. package/dist/detectors/run-in-title.d.ts.map +1 -0
  78. package/dist/detectors/run-in-title.js +32 -0
  79. package/dist/detectors/run-in-title.js.map +1 -0
  80. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  81. package/dist/detectors/sentence-ending.js +5 -1
  82. package/dist/detectors/sentence-ending.js.map +1 -1
  83. package/dist/detectors/sentence-length.d.ts.map +1 -1
  84. package/dist/detectors/sentence-length.js +12 -3
  85. package/dist/detectors/sentence-length.js.map +1 -1
  86. package/dist/detectors/technical-docs.d.ts.map +1 -1
  87. package/dist/detectors/technical-docs.js +25 -6
  88. package/dist/detectors/technical-docs.js.map +1 -1
  89. package/dist/detectors/token-shape.d.ts.map +1 -1
  90. package/dist/detectors/token-shape.js +4 -3
  91. package/dist/detectors/token-shape.js.map +1 -1
  92. package/dist/detectors/unfilled-placeholder.d.ts.map +1 -1
  93. package/dist/detectors/unfilled-placeholder.js +11 -1
  94. package/dist/detectors/unfilled-placeholder.js.map +1 -1
  95. package/dist/structure/definition-use.d.ts +5 -3
  96. package/dist/structure/definition-use.d.ts.map +1 -1
  97. package/dist/structure/definition-use.js +10 -2
  98. package/dist/structure/definition-use.js.map +1 -1
  99. package/dist/structure/forward-reference.d.ts +8 -0
  100. package/dist/structure/forward-reference.d.ts.map +1 -0
  101. package/dist/structure/forward-reference.js +18 -0
  102. package/dist/structure/forward-reference.js.map +1 -0
  103. package/dist/topic-clause.d.ts.map +1 -1
  104. package/dist/topic-clause.js +18 -5
  105. package/dist/topic-clause.js.map +1 -1
  106. package/package.json +3 -3
  107. package/rules/bold-emphasis.yaml +2 -2
  108. package/rules/closing-cliche.yaml +2 -2
  109. package/rules/contraction-consistency.yaml +2 -2
  110. package/rules/expletive-construction.yaml +2 -2
  111. package/rules/internal-jargon.yaml +1 -0
  112. package/rules/list-item-form-mix.yaml +2 -2
  113. package/rules/max-kanji-continuous.yaml +5 -2
  114. package/rules/max-sentence-length.yaml +2 -2
  115. package/rules/ngram-repetition.yaml +2 -2
  116. package/rules/no-doubled-joshi.yaml +2 -2
  117. package/rules/no-mixed-desumasu.yaml +2 -2
  118. package/rules/obligation-without-deadline.yaml +2 -2
  119. package/rules/preferred-term.yaml +1 -0
  120. package/rules/step-statement-mix.yaml +2 -2
  121. package/rules/topic-predicate-distance.yaml +2 -2
  122. package/rules/unfilled-placeholder.yaml +2 -2
  123. package/rules/use-before-definition.yaml +2 -2
  124. package/src/clause-particles.ts +19 -3
  125. package/src/detectors/address-blank.ts +49 -0
  126. package/src/detectors/bold-emphasis-form.ts +10 -1
  127. package/src/detectors/char-shape.ts +10 -11
  128. package/src/detectors/closing-cliche.ts +19 -2
  129. package/src/detectors/contraction-mix.ts +3 -1
  130. package/src/detectors/currency-notation.ts +17 -6
  131. package/src/detectors/definition-use.ts +1 -0
  132. package/src/detectors/en-shape.ts +14 -1
  133. package/src/detectors/gram-ending.ts +40 -0
  134. package/src/detectors/gram-repetition.ts +28 -4
  135. package/src/detectors/inline-item-label.ts +18 -3
  136. package/src/detectors/kanji-run-pieces.ts +35 -8
  137. package/src/detectors/list-item-own.ts +38 -0
  138. package/src/detectors/list-item-phrase.ts +20 -8
  139. package/src/detectors/list-joint.ts +31 -2
  140. package/src/detectors/list-parallel.ts +25 -38
  141. package/src/detectors/open-end-scope.ts +3 -2
  142. package/src/detectors/oxford-comma.ts +2 -1
  143. package/src/detectors/pseudo-heading.ts +75 -3
  144. package/src/detectors/register-label-note.ts +37 -0
  145. package/src/detectors/run-in-title.ts +35 -0
  146. package/src/detectors/sentence-ending.ts +5 -1
  147. package/src/detectors/sentence-length.ts +18 -5
  148. package/src/detectors/technical-docs.ts +31 -6
  149. package/src/detectors/token-shape.ts +4 -3
  150. package/src/detectors/unfilled-placeholder.ts +13 -1
  151. package/src/structure/definition-use.ts +13 -3
  152. package/src/structure/forward-reference.ts +21 -0
  153. package/src/topic-clause.ts +24 -5
@@ -52,8 +52,8 @@ example:
52
52
  We listen to our customers. Regulars try every prototype, and store staff ask shoppers what they thought.
53
53
 
54
54
  not_flagged:
55
- ja: 一覧の飾り(各項目に付くタグやリンクの文字)、欄の名前(Cited by:)、かぎ括弧で引いた題や言葉、文書が定義した語と、名前にかかる語句は数えません。英語の、名詞と形容詞と略語だけが並ぶ用語(the federal funds rate、extended AI assistant)は言い回しではないので数えません。一つの文の中の繰り返しは 1 回と数えます。文書の題と見出しにある言い回しは主題なので数えません。よくある質問の答えは、問いの見出しごとに別々に数えます。節の最初の文にある言い回し(節ごとのひな形の書き出し)、番号を振った項目の見出し((1)…に係る規定に関する改正)、参照の項目の説明の段落(`max-age` の節、定義の並び)、句点の無い名詞で終わる一行(表の欄)に出たぶんは数えません。項目ごとの決まった結び(〜ものとすること。原案のとおり決定する。が表示されます。を記載してください。表の前の次のとおりであります。)も、文の終わりにあれば数えません。文書が引いた題の後ろで決まって使う短い結び(詳しくは「…」を確認してください。)、文書の部分を指す名前(Section 3.1、表2)にかかる語句、表の欄が 2 つ続いた後ろの一行の文(表の行の最後の欄)も数えません。枠ごとにまったく同じ形で付けるコロンで終わる一行の札(The following rule has the force of law:)、平文の仕様書の定義の並びの項目(行の頭の短い名前とコロンのあとに空白を 2 つ置いて書く定義)、リンクのすぐ後ろで決まって使う結び([…](…)を参照してください。)、数字だけを入れ替えた報告の行(There are currently 17 committers …)も、書き手の言い回しではないので数えません。英語で、名詞の入る所の -ing 形の句(what occupying the anticipatory mode requires)と、用語の後ろの be(the anticipatory mode is)は用語で、言い回しではありません。手順書が手順ごとに役割を名指しする、名詞の主語と助動詞だけの語句(the manager should)も、何をするかが毎回違うので数えません。長い文書の中で何千語も離れて使う語句(報告が測る出来事の名前 adopted a budget resolution)は、前の出現を覚えているうちに次が来ないので数えません。見出しが名付けた句に前後の語が 1 つ付いただけの語句(見出し Create a ConfigMap の下の to create a ConfigMap、見出し 旧氏を併記した場合 の下の 旧氏を併記した氏名)も主題で、数えません。角括弧でくくった画面の部品の名前に付いた語句([許可]をクリックすると、[ブックマーク]をクリックすると)は、手順ごとに違う部品を指す書き方で、数えません。中黒で並べた名詞を飾る節(育成すべき資質・能力)も、文書の決まった用語で、言い回しではありません。短い文書は測りません。見出しが一つの複合語に書いた主題を、本文が助詞を入れて書いた語句(見出しの「旧氏併記」に対する「旧氏を併記した氏」)も、主題なので数えません。数を入れた短い括弧の注に触れる語句(売上高は307,814千円(前期比99.6%)となりました。の)となりました。)も、報告が数ごとに添える書式で、数えません。
56
- en: Tags, link text and symbols that a listing repeats on every entry, field labels (Cited by:), titles and words quoted in Japanese brackets, terms the document defines, and the words around a repeated name are not counted. A term made only of nouns, adjectives and acronyms ("the federal funds rate", "extended AI assistant") is not a phrasing and is not counted. A phrase repeated inside one sentence counts once, and one in the document's title or headings is its subject and is not counted. The answers in a FAQ are counted one question at a time. Uses in the first sentence of sections (each section's template opening), in numbered item titles ((1) ... amendment of the provision on ...), in the first paragraph of a reference entry (a section headed `max-age`, a definition list) and in a line without a full stop that ends in a noun (a table cell) are not counted, nor a fixed closing line repeated per item at the end of a Japanese sentence (〜ものとすること。, 原案のとおり決定する。, が表示されます。, を記載してください。, 次のとおりであります。 before a table). Nor are the short closing a document uses mostly right after a quoted title (詳しくは「…」を確認してください。), the words around a reference to a numbered part (set out in Section 3.1, 表2), or a one-line sentence after two table cells (the last cell of a table run into lines). Nor are a one-line label ending in a colon repeated verbatim before each box (The following rule has the force of law:), an entry of a plain-text definition list (a short name, a colon and two spaces, then the definition), the short closing a document uses mostly right after a link ([…](…)を参照してください。), or a report line filled in with different numbers (There are currently 17 committers …). In English, an -ing phrase in a noun's place (what occupying the anticipatory mode requires) and a term followed by be (the anticipatory mode is) are terms, not phrasing. Nor is a noun subject followed only by a modal (the manager should), the way a process manual names the role for each step, since what the role must do follows and differs each time. A phrase whose uses lie thousands of words apart in a long document (the event a report times, adopted a budget resolution) is not counted, since the reader has forgotten one use before the next comes. A phrase that is a heading's phrase with a word attached (to create a ConfigMap under the heading Create a ConfigMap, 旧氏を併記した氏名 under 旧氏を併記した場合) is the subject too, and is not counted. In Japanese, the words attached to a bracketed screen label ([許可]をクリックすると) are the step wording of a screen manual, each naming a different button, and are not counted. In Japanese, a clause modifying nouns joined by a nakaguro (育成すべき資質・能力) is part of one fixed term, not phrasing. Short documents are not measured. Nor is a Japanese phrase that spells out with particles a compound a heading names (旧氏を併記した氏 under a heading holding 旧氏併記), since it is the subject. Nor are the words touching a short Japanese aside holding a figure (the )となりました。 of 売上高は307,814千円(前期比99.6%)となりました。), the frame a report puts around each number.
55
+ ja: 一覧の飾り(各項目に付くタグやリンクの文字)、欄の名前(Cited by:)、かぎ括弧で引いた題や言葉、文書が定義した語と、名前にかかる語句は数えません。英語の、名詞と形容詞と略語だけが並ぶ用語(the federal funds rate、extended AI assistant)は言い回しではないので数えません。一つの文の中の繰り返しは 1 回と数えます。文書の題と見出しにある言い回しは主題なので数えません。よくある質問の答えは、問いの見出しごとに別々に数えます。節の最初の文にある言い回し(節ごとのひな形の書き出し)、番号を振った項目の見出し((1)…に係る規定に関する改正)、参照の項目の説明の段落(`max-age` の節、定義の並び)、句点の無い名詞で終わる一行(表の欄)に出たぶんは数えません。項目ごとの決まった結び(〜ものとすること。原案のとおり決定する。が表示されます。を記載してください。表の前の次のとおりであります。)も、文の終わりにあれば数えません。文書が引いた題の後ろで決まって使う短い結び(詳しくは「…」を確認してください。)、文書の部分を指す名前(Section 3.1、表2)にかかる語句、表の欄が 2 つ続いた後ろの一行の文(表の行の最後の欄)も数えません。枠ごとにまったく同じ形で付けるコロンで終わる一行の札(The following rule has the force of law:)、平文の仕様書の定義の並びの項目(行の頭の短い名前とコロンのあとに空白を 2 つ置いて書く定義)、リンクのすぐ後ろで決まって使う結び([…](…)を参照してください。)、数字だけを入れ替えた報告の行(There are currently 17 committers …)も、書き手の言い回しではないので数えません。英語で、名詞の入る所の -ing 形の句(what occupying the anticipatory mode requires)と、用語の後ろの be(the anticipatory mode is)は用語で、言い回しではありません。手順書が手順ごとに役割を名指しする、名詞の主語と助動詞だけの語句(the manager should)も、何をするかが毎回違うので数えません。長い文書の中で何千語も離れて使う語句(報告が測る出来事の名前 adopted a budget resolution)は、前の出現を覚えているうちに次が来ないので数えません。見出しが名付けた句に前後の語が 1 つ付いただけの語句(見出し Create a ConfigMap の下の to create a ConfigMap、見出し 旧氏を併記した場合 の下の 旧氏を併記した氏名)も主題で、数えません。角括弧でくくった画面の部品の名前に付いた語句([許可]をクリックすると、[ブックマーク]をクリックすると)は、手順ごとに違う部品を指す書き方で、数えません。中黒で並べた名詞を飾る節(育成すべき資質・能力)も、文書の決まった用語で、言い回しではありません。短い文書は測りません。見出しが一つの複合語に書いた主題を、本文が助詞を入れて書いた語句(見出しの「旧氏併記」に対する「旧氏を併記した氏」)も、主題なので数えません。数を入れた短い括弧の注に触れる語句(売上高は307,814千円(前期比99.6%)となりました。の)となりました。)も、報告が数ごとに添える書式で、数えません。同じ形で終わる文が続く所の、文の結びだけの語句(〜を強化してまいります。の してまいります。)も数えません。並んだ結びの繰り返しは repeated-sentence-ending が見ます。離れた所で何度も出る結びと、中身の動詞が入る結び(取り組んでまいります。)は言い回しとして数えます。
56
+ en: Tags, link text and symbols that a listing repeats on every entry, field labels (Cited by:), titles and words quoted in Japanese brackets, terms the document defines, and the words around a repeated name are not counted. A term made only of nouns, adjectives and acronyms ("the federal funds rate", "extended AI assistant") is not a phrasing and is not counted. A phrase repeated inside one sentence counts once, and one in the document's title or headings is its subject and is not counted. The answers in a FAQ are counted one question at a time. Uses in the first sentence of sections (each section's template opening), in numbered item titles ((1) ... amendment of the provision on ...), in the first paragraph of a reference entry (a section headed `max-age`, a definition list) and in a line without a full stop that ends in a noun (a table cell) are not counted, nor a fixed closing line repeated per item at the end of a Japanese sentence (〜ものとすること。, 原案のとおり決定する。, が表示されます。, を記載してください。, 次のとおりであります。 before a table). Nor are the short closing a document uses mostly right after a quoted title (詳しくは「…」を確認してください。), the words around a reference to a numbered part (set out in Section 3.1, 表2), or a one-line sentence after two table cells (the last cell of a table run into lines). Nor are a one-line label ending in a colon repeated verbatim before each box (The following rule has the force of law:), an entry of a plain-text definition list (a short name, a colon and two spaces, then the definition), the short closing a document uses mostly right after a link ([…](…)を参照してください。), or a report line filled in with different numbers (There are currently 17 committers …). In English, an -ing phrase in a noun's place (what occupying the anticipatory mode requires) and a term followed by be (the anticipatory mode is) are terms, not phrasing. Nor is a noun subject followed only by a modal (the manager should), the way a process manual names the role for each step, since what the role must do follows and differs each time. A phrase whose uses lie thousands of words apart in a long document (the event a report times, adopted a budget resolution) is not counted, since the reader has forgotten one use before the next comes. A phrase that is a heading's phrase with a word attached (to create a ConfigMap under the heading Create a ConfigMap, 旧氏を併記した氏名 under 旧氏を併記した場合) is the subject too, and is not counted. In Japanese, the words attached to a bracketed screen label ([許可]をクリックすると) are the step wording of a screen manual, each naming a different button, and are not counted. In Japanese, a clause modifying nouns joined by a nakaguro (育成すべき資質・能力) is part of one fixed term, not phrasing. Short documents are not measured. Nor is a Japanese phrase that spells out with particles a compound a heading names (旧氏を併記した氏 under a heading holding 旧氏併記), since it is the subject. Nor are the words touching a short Japanese aside holding a figure (the )となりました。 of 売上高は307,814千円(前期比99.6%)となりました。), the frame a report puts around each number. Nor is a Japanese phrase made only of a sentence ending (the してまいります。 of 〜を強化してまいります。) where sentences in a row end the same way, since repeated-sentence-ending reports that run; the same ending scattered through a document, or an ending that holds a verb with content (取り組んでまいります。), is still a phrasing.
57
57
  level_meaning:
58
58
  ja: 同じ言い回し {limit} 回まで
59
59
  en: up to {limit} {limit|use|uses} of the same phrase
@@ -42,8 +42,8 @@ example:
42
42
  after: 本社営業部にある第二課の方針を確認しました。
43
43
 
44
44
  not_flagged:
45
- ja: 読点で区切った並び、=・:・→ で区切った句、「」や『』の中の題名や引用、行の頭のリンクで引いた外のページの題名、参考文献や References の見出しの下の文献一覧に写した著作の題(- [1] 中村由美. 在宅勤務の日の時間の使い方. 2023.)、文の中に書いた法律の題名(障害者等の移動等の円滑化の促進に関する法律)、短い呼び名を付けた長い名前(被害者のための相談センター(以下「センター」という。))、文書が一度鉤括弧で引いた名前を括弧なしで書き直したもの(「地域のための共通の指針」と引いた後の、地域のための共通の指針の改定)は数えません。括弧(】や ))は、解析器が次の語とつなげて読んでも連なりを切ります。人の集まりを敬って呼ぶ語の前の「の」も、その呼び方が「の」で次の語に係るとき(国民の皆様の期待、被災者の方々の暮らし)は一つの呼び方の中なので数えません。置き場所を前の語との関係で言う語(下、上、横、裏)の前の「の」も、その場所が「の」で次の語に係るとき(ラックの下の段)は一つの場所の名前の中なので数えません。決まった言い回しの中の「の」(絶滅のおそれのある種の「おそれのある」、AとBとの間の「との間」、共有のような現代の機能の「のような」)も、一語のように読むので数えません。「他の」の「の」も、名詞を名詞の中に入れず絞るだけなので数えません。「の」が節の主語を示すとき(番号のついた版の部品)は、節の前と後ろを別の句として数え、どちらかが上限を超えるときだけ言います。表を一続きの文に平らにしたもの(セルの数字がつながった 8,45795.7 や、見出しのセルが単位の括弧で閉じる 割合(%)被所有割合(%)…)は、セルの切れ目が見えないので数えません。
46
- en: Items separated by commas, phrases separated by =, a colon or an arrow, titles or quotations inside 「」 or 『』, the title of an outside page quoted by a link at a line's head, the title of a cited work in a reference list under a heading such as 参考文献 or References, the title of a law written in the sentence (障害者等の移動等の円滑化の促進に関する法律), a long name given a short one (被害者のための相談センター(以下「センター」という。)), a name the document quotes once and writes again without brackets, and the の before an honorific for a group of people when that form of address goes on with の (国民の皆様の期待, 被災者の方々の暮らし), are not counted. Nor is the の before a word that places something against another (下, 上, 横, 裏) when the place goes on with の (ラックの下の段, the shelf under the rack). Nor is the の inside a set phrase read as one word (おそれのある, "at risk of", in 絶滅のおそれのある種; との間, "between", in AとBとの間; のような, "like", in 共有のような現代の機能), nor the の of 他の ("other"), which narrows the noun rather than nesting it. When の marks the subject of a clause (番号のついた版の部品, the part of the version that has a number), the phrases before and after the clause are counted apart, and the run is reported only when one of them goes over the limit. Nor is a table flattened into one run of text (numbers of two cells run together, 8,45795.7, or header cells each closed by a unit in brackets, 割合(%)被所有割合(%)…), whose cell boundaries cannot be seen. A bracket (】 or ")") ends the run even when the parser joins it to the next word.
45
+ ja: 読点で区切った並び、=・:・→ で区切った句、「」や『』の中の題名や引用、行の頭のリンクで引いた外のページの題名、参考文献や References の見出しの下の文献一覧に写した著作の題(- [1] 中村由美. 在宅勤務の日の時間の使い方. 2023.)、文の中に書いた法律の題名(障害者等の移動等の円滑化の促進に関する法律)、短い呼び名を付けた長い名前(被害者のための相談センター(以下「センター」という。))、文書が一度鉤括弧で引いた名前を括弧なしで書き直したもの(「地域のための共通の指針」と引いた後の、地域のための共通の指針の改定)は数えません。括弧(】や ))は、解析器が次の語とつなげて読んでも連なりを切ります。人の集まりを敬って呼ぶ語の前の「の」も、その呼び方が「の」で次の語に係るとき(国民の皆様の期待、被災者の方々の暮らし)は一つの呼び方の中なので数えません。置き場所を前の語との関係で言う語(下、上、横、裏)の前の「の」も、その場所が「の」で次の語に係るとき(ラックの下の段)は一つの場所の名前の中なので数えません。決まった言い回しの中の「の」(絶滅のおそれのある種の「おそれのある」、AとBとの間の「との間」、共有のような現代の機能の「のような」)も、一語のように読むので数えません。「他の」の「の」も、名詞を名詞の中に入れず絞るだけなので数えません。「の」が節の主語を示すとき(番号のついた版の部品)や、「の」一つで次の名詞が何かを言う「である」の節(当社の子会社である東西商事の株式)は、節の前と後ろを別の句として数え、どちらかが上限を超えるときだけ言います。節の中でも「の」が続くとき(県の対策の責任者である保健部の部長)は、連なり全体を数えます。表を一続きの文に平らにしたもの(セルの数字がつながった 8,45795.7 や、見出しのセルが単位の括弧で閉じる 割合(%)被所有割合(%)…)は、セルの切れ目が見えないので数えません。
46
+ en: Items separated by commas, phrases separated by =, a colon or an arrow, titles or quotations inside 「」 or 『』, the title of an outside page quoted by a link at a line's head, the title of a cited work in a reference list under a heading such as 参考文献 or References, the title of a law written in the sentence (障害者等の移動等の円滑化の促進に関する法律), a long name given a short one (被害者のための相談センター(以下「センター」という。)), a name the document quotes once and writes again without brackets, and the の before an honorific for a group of people when that form of address goes on with の (国民の皆様の期待, 被災者の方々の暮らし), are not counted. Nor is the の before a word that places something against another (下, 上, 横, 裏) when the place goes on with の (ラックの下の段, the shelf under the rack). Nor is the の inside a set phrase read as one word (おそれのある, "at risk of", in 絶滅のおそれのある種; との間, "between", in AとBとの間; のような, "like", in 共有のような現代の機能), nor the の of 他の ("other"), which narrows the noun rather than nesting it. When の marks the subject of a clause (番号のついた版の部品, the part of the version that has a number), or a clause ending in である with a single の says what the next noun is (当社の子会社である東西商事の株式, the shares of Tozai, a subsidiary of ours), the phrases before and after the clause are counted apart, and the run is reported only when one of them goes over the limit. A である clause that itself repeats の (県の対策の責任者である保健部の部長) is counted with the whole run. Nor is a table flattened into one run of text (numbers of two cells run together, 8,45795.7, or header cells each closed by a unit in brackets, 割合(%)被所有割合(%)…), whose cell boundaries cannot be seen. A bracket (】 or ")") ends the run even when the parser joins it to the next word.
47
47
  level_meaning:
48
48
  ja: 同じ助詞の連続 {limit} 回まで
49
49
  en: up to {limit} of the same particle in a row
@@ -127,8 +127,8 @@ example:
127
127
  新しい料金は来月から始まります。請求書の形式も変わります。支払いの期限は月末です。古い料金は三月で終わります。
128
128
 
129
129
  not_flagged:
130
- ja: どちらの調子が正しいかは決めません。多いほうに揃っていない、少ないほうの文だけを指します。チームが chaff.yaml の options で本文・箇条書き・見出しの調子を決めたときだけ、そのまとまりでは混ざっていなくても決めた調子と違う文を指し、そのまとまりがそろっているかは見ません。文書の中で二つの調子が同じ数なら、揃える先の多いほうが無いので、どちらも指しません。本文と箇条書きは別々に数えます。箇条書きの中の少ないほうが文書全体では多いほうなら、その文は指しません。項目や段落の頭の太字の札(「- **速く書ける。** 説明です。」の「速く書ける。」)は見出しと同じく文に数えません。免責や変更の予告を書いた段落(「…ご了承ください。」)が、2 文以上すべて文書の多いほうと違う同じ調子でそろっているときも、本文とは別の決まり文句として数えません。読み手の相談や質問を載せる節(見出しが「【相談事例等】」「ご質問内容」)の文も、尋ねた人の言葉のままなので数えません。文書の最後に掲載先が付けた利用条件の断り書き(ライセンスの名前と条件の URL を書いた短い段落)も数えません。札を付けて引いた言葉(「例:」「Q:」で始まる文、「用例」だけの段落の下の段落)、「■ 調査目的」のような印付きの札の行の下の記入欄の値、〒や「電話:」の行がある問い合わせ先の段落、一つの文の中に「?」で並べて引いた問い(…一覧か?順序付きか?などです。)、一番上の見出し(#)が二つ以上ある文書で、その見出しの下の 2 文以上がみな文書の多いほうと違う同じ調子でそろった部分(通達の後ろに付いた、ページの説明)も数えません。見出しが無くても、文書の多いほうの最後の文より後ろの 2 文以上がみな違う同じ調子でそろい(その調子の文がそれより前に無く)、その間に調子を持たない行(「第1」のようなリンクの並び)を挟むときは、ページの後ろの注記として数えません。数えたうえで指さないのは、丁寧な形でしか言わない挨拶(お疲れ様でした。)と結びの頼み(承認をお願いします。)、見出しの下にその一文だけを置いて、ページの読み手に詳しい所を示す丁寧な案内(## 概要 の下の「本検討会の概要は、…をご覧ください。」)、相手への願い(信じてほしい。)、条件だけで問う文(…だったら?)、演説で主語を言わずに決意を言い切る文(戦争の惨禍を、二度と繰り返さない。)、演説でこれから成し遂げることを「〜を…ていく。」と言い切る文(現場の気づきを、幹部の皆さんが形にしていく。)、次の文が「そんな」「こんな」「これだけで」で受ける場面や行いの書き出し(PDFが送れない。そんなときは…)、「!」で終わる叫び(わかるかっ!)、読み手に呼びかける終助詞「よ」「ね」「かな」で終わる文(…含まれているよ。…のかな?)、ブログで書き手が気持ちを漏らす文(形容詞で言い切る「まだよかった。」や、「〜し、」で並べてこぼす「画面は止まるし、音も途切れる。」)、※や*で始まる行の注記、文で終わらない行の塊に前後を挟まれた表のセル(制限なし。)、インタビュー(見出しの節の半分以上が聞き手の「――」の問いで始まる文書)の答えの段落の文です。答えは話した言葉を書き起こしたもので、話し手は丁寧な文と常体の文を混ぜて話します。動画の題(末尾に再生時間を括弧で書いた見出し)の下の説明も、動画の言葉のままなので数えません。
131
- en: Neither register is called right; only the sentences in the minority are pointed at. Only where a team names in chaff.yaml's options the register its body, lists or headings require is a sentence in the other register pointed at with no mix, and that region is then not checked for consistency. When the document holds as many sentences in one register as in the other, there is no majority to match and neither side is pointed at. The body and each list are counted apart, and a sentence in a list's minority is left alone when its register is the document's majority. A bold label that opens an item or a paragraph and is followed by more text on its line is a heading, not a sentence. A paragraph of disclaimer or notice wording (…ご了承ください。) whose two or more sentences all share the register the rest of the document does not use is boilerplate in its own voice and is not counted. Nor are the sentences of a section whose heading names what a reader asked (【相談事例等】, ご質問内容), since they quote the asker in their own words. Nor is a licence notice the publisher appends at the end (a short closing paragraph that names a licence and links to its terms). Nor are words quoted under a label (a sentence opening with 例: or Q:, the paragraph under a lone 用例), the value under a marked field label (■ 調査目的), a contact block (a paragraph with a 〒 or 電話: line), questions run together inside one sentence (…一覧か?順序付きか?などです。), or, in a document with two top-level (#) headings or more, a part under one of them whose two or more sentences all share the register the rest of the document does not use (a page's note about the directive it carries). Nor, without such a heading, are the two or more sentences after the last one in the document's register when they all share the other register, used nowhere before them, and a line without a register (links such as 第1) sits among them (a page's note under the text it carries). Counted but never pointed at are a greeting or a closing request said only politely (お疲れ様でした。承認をお願いします。), a polite pointer the page gives its reader to where more is said, as the only sentence under its heading (本検討会の概要は、…をご覧ください。 under ## 概要),a wish to others (信じてほしい。), a question that gives only a condition (…だったら?), a speaker declaring a resolve without a subject in a speech (戦争の惨禍を、二度と繰り返さない。), a speaker stating in a speech what is to be carried out, ending in 〜ていく with an object (現場の気づきを、幹部の皆さんが形にしていく。), a scene-setting opener the next sentence takes up with そんな, こんな or これだけで, a cry that ends in an exclamation mark (わかるかっ!), a sentence that closes with a particle addressing the reader, よ, ね or かな (…含まれているよ。…のかな?), a blog writer's aside of feeling, ending on an adjective (まだよかった。) or running complaints together with 〜し、 (画面は止まるし、音も途切れる。),a note on a line opening with ※ or *, a table cell set out between runs of lines that do not end as sentences (制限なし。), and the sentences of an interview's answers (in a document where at least half of the headed sections open with the interviewer's ―― question), since an answer is speech set down and a speaker mixes polite and plain sentences. Nor is the caption under a video's title (a heading ending with its running time in brackets), which is in the video's own words.
130
+ ja: どちらの調子が正しいかは決めません。多いほうに揃っていない、少ないほうの文だけを指します。チームが chaff.yaml の options で本文・箇条書き・見出しの調子を決めたときだけ、そのまとまりでは混ざっていなくても決めた調子と違う文を指し、そのまとまりがそろっているかは見ません。文書の中で二つの調子が同じ数なら、揃える先の多いほうが無いので、どちらも指しません。本文と箇条書きは別々に数えます。箇条書きの中の少ないほうが文書全体では多いほうなら、その文は指しません。項目や段落の頭の太字の札(「- **速く書ける。** 説明です。」の「速く書ける。」)は見出しと同じく文に数えません。項目の頭の太字の札とコロンの直後の注記が、同じ項目の続きの文と違う調子のとき(「- **HDDが見つからない**:マウントされていない。差し直すと直ります。」の「マウントされていない。」)も、欄の値のような短い書き方なので指しません。免責や変更の予告を書いた段落(「…ご了承ください。」)が、2 文以上すべて文書の多いほうと違う同じ調子でそろっているときも、本文とは別の決まり文句として数えません。読み手の相談や質問を載せる節(見出しが「【相談事例等】」「ご質問内容」)の文も、尋ねた人の言葉のままなので数えません。文書の最後に掲載先が付けた利用条件の断り書き(ライセンスの名前と条件の URL を書いた短い段落)も数えません。札を付けて引いた言葉(「例:」「Q:」で始まる文、「用例」だけの段落の下の段落)、「■ 調査目的」のような印付きの札の行の下の記入欄の値、〒や「電話:」の行がある問い合わせ先の段落、一つの文の中に「?」で並べて引いた問い(…一覧か?順序付きか?などです。)、一番上の見出し(#)が二つ以上ある文書で、その見出しの下の 2 文以上がみな文書の多いほうと違う同じ調子でそろった部分(通達の後ろに付いた、ページの説明)も数えません。見出しが無くても、文書の多いほうの最後の文より後ろの 2 文以上がみな違う同じ調子でそろい(その調子の文がそれより前に無く)、その間に調子を持たない行(「第1」のようなリンクの並び)を挟むときは、ページの後ろの注記として数えません。数えたうえで指さないのは、丁寧な形でしか言わない挨拶(お疲れ様でした。)と結びの頼み(承認をお願いします。)、見出しの下にその一文だけを置いて、ページの読み手に詳しい所を示す丁寧な案内(## 概要 の下の「本検討会の概要は、…をご覧ください。」)、相手への願い(信じてほしい。)、条件だけで問う文(…だったら?)、演説で主語を言わずに決意を言い切る文(戦争の惨禍を、二度と繰り返さない。)、演説でこれから成し遂げることを「〜を…ていく。」と言い切る文(現場の気づきを、幹部の皆さんが形にしていく。)、次の文が「そんな」「こんな」「これだけで」で受ける場面や行いの書き出し(PDFが送れない。そんなときは…)、「!」で終わる叫び(わかるかっ!)、読み手に呼びかける終助詞「よ」「ね」「かな」で終わる文(…含まれているよ。…のかな?)、ブログで書き手が気持ちを漏らす文(形容詞で言い切る「まだよかった。」や、「〜し、」で並べてこぼす「画面は止まるし、音も途切れる。」)、※や*で始まる行の注記、文で終わらない行の塊に前後を挟まれた表のセル(制限なし。)、インタビュー(見出しの節の半分以上が聞き手の「――」の問いで始まる文書)の答えの段落の文です。答えは話した言葉を書き起こしたもので、話し手は丁寧な文と常体の文を混ぜて話します。動画の題(末尾に再生時間を括弧で書いた見出し)の下の説明も、動画の言葉のままなので数えません。
131
+ en: Neither register is called right; only the sentences in the minority are pointed at. Only where a team names in chaff.yaml's options the register its body, lists or headings require is a sentence in the other register pointed at with no mix, and that region is then not checked for consistency. When the document holds as many sentences in one register as in the other, there is no majority to match and neither side is pointed at. The body and each list are counted apart, and a sentence in a list's minority is left alone when its register is the document's majority. A bold label that opens an item or a paragraph and is followed by more text on its line is a heading, not a sentence. The note right after a list item's bold label and colon is not pointed at either when the item goes on in the other register (- **HDDが見つからない**:マウントされていない。差し直すと直ります。), since it is written as a field's value. A paragraph of disclaimer or notice wording (…ご了承ください。) whose two or more sentences all share the register the rest of the document does not use is boilerplate in its own voice and is not counted. Nor are the sentences of a section whose heading names what a reader asked (【相談事例等】, ご質問内容), since they quote the asker in their own words. Nor is a licence notice the publisher appends at the end (a short closing paragraph that names a licence and links to its terms). Nor are words quoted under a label (a sentence opening with 例: or Q:, the paragraph under a lone 用例), the value under a marked field label (■ 調査目的), a contact block (a paragraph with a 〒 or 電話: line), questions run together inside one sentence (…一覧か?順序付きか?などです。), or, in a document with two top-level (#) headings or more, a part under one of them whose two or more sentences all share the register the rest of the document does not use (a page's note about the directive it carries). Nor, without such a heading, are the two or more sentences after the last one in the document's register when they all share the other register, used nowhere before them, and a line without a register (links such as 第1) sits among them (a page's note under the text it carries). Counted but never pointed at are a greeting or a closing request said only politely (お疲れ様でした。承認をお願いします。), a polite pointer the page gives its reader to where more is said, as the only sentence under its heading (本検討会の概要は、…をご覧ください。 under ## 概要),a wish to others (信じてほしい。), a question that gives only a condition (…だったら?), a speaker declaring a resolve without a subject in a speech (戦争の惨禍を、二度と繰り返さない。), a speaker stating in a speech what is to be carried out, ending in 〜ていく with an object (現場の気づきを、幹部の皆さんが形にしていく。), a scene-setting opener the next sentence takes up with そんな, こんな or これだけで, a cry that ends in an exclamation mark (わかるかっ!), a sentence that closes with a particle addressing the reader, よ, ね or かな (…含まれているよ。…のかな?), a blog writer's aside of feeling, ending on an adjective (まだよかった。) or running complaints together with 〜し、 (画面は止まるし、音も途切れる。),a note on a line opening with ※ or *, a table cell set out between runs of lines that do not end as sentences (制限なし。), and the sentences of an interview's answers (in a document where at least half of the headed sections open with the interviewer's ―― question), since an answer is speech set down and a speaker mixes polite and plain sentences. Nor is the caption under a video's title (a heading ending with its running time in brackets), which is in the video's own words.
132
132
  level_meaning:
133
133
  ja: 少ないほうの調子の文が {limit} 文以下のとき、それを指摘
134
134
  en: reported when the minority register has {limit} {limit|sentence|sentences} or fewer
@@ -67,8 +67,8 @@ example:
67
67
  3. On termination, the Supplier shall return all Confidential Information to the Customer within ten days.
68
68
 
69
69
  not_flagged:
70
- ja: 期限を書いた文が、期限の無い義務の文より多くない文書では、書き手がそう書くと決めたとみなして指しません。同じ文に期限(7日以内、毎月末日までに、直ちに、事前に)があれば指しません。「速やかに」「遅滞なく」だけの期限は vague-deadline が見ます。権利を定める文(「返還を請求することができる」)と、金額を書いた文(「月額150,000円を支払う」は値段を決める文で、いつ払うかは別の条が決めます)は見ません。義務は文の終わりの述語で読み、条件の中の語(「通知したときは」)は見ません。法令・判決・特許は見ません。契約書・規約のジャンルで見ます。義務と同じ条(条が無ければ同じ箇条書きか段落)が、その行いの日付を名指す期限(支払う義務なら支払期日、納入なら納期)を書いていれば、その日が義務の時なので指しません。同じ条のほかの項が同じ行いに期限を書き、どちらかがもう一方を指していれば(第1項で何を払うかを書き、第3項が「本条1項に定める対価」をいつまでに払うかを書く条。「前項の対価を振込みで支払う」も同じ)、その期限が義務の時なので指しません。「2か月を目途に」も期限です。英語の文書では、支払の予定表(according to the Payment Schedule)や確定した判決の額(damages finally awarded)に時を任せる義務と、事前の承認を求めて出す義務(submit samples for prior approval)も指しません。
71
- en: 'A document where sentences stating a limit are not more than those holding a duty with none is taken to write its duties that way on purpose, and is not reported. A sentence that states a limit (within seven days, by the fifth business day, immediately) is not reported; one with "promptly" alone is vague-deadline''s. A sentence that grants a right (may) or states an amount (shall pay a monthly fee of $9,000, which sets the price; another clause says when) is not read. "by email" says how, not when, and is not a limit. Statutes, court decisions and patents are not read; the contract genre runs this rule. A duty whose article (else its list or paragraph) names the dated deadline of its act (the Due Date for a duty to pay, the Delivery Date for one to deliver) is timed by it, and is not reported. Nor is a duty whose article states a limit for the same act in another paragraph, when one of the two points at the other (the first paragraph says what is paid; the third pays "the fee in paragraph 1 of this Article" within ten days). Nor is a duty whose time a payment schedule (according to the Payment Schedule) or a court''s final award (damages finally awarded) sets, or one done for prior approval (submit samples for prior approval), which comes before the use it must precede.'
70
+ ja: 期限を書いた文が、期限の無い義務の文より多くない文書では、書き手がそう書くと決めたとみなして指しません。同じ文に期限(7日以内、毎月末日までに、直ちに、事前に)があれば指しません。「速やかに」「遅滞なく」だけの期限は vague-deadline が見ます。権利を定める文(「返還を請求することができる」)と、金額を書いた文(「月額150,000円を支払う」は値段を決める文で、いつ払うかは別の条が決めます)は見ません。義務は文の終わりの述語で読み、条件の中の語(「通知したときは」)は見ません。法令・判決・特許は見ません。契約書・規約のジャンルで見ます。義務と同じ条(条が無ければ同じ箇条書きか段落)が、その行いの日付を名指す期限(支払う義務なら支払期日、納入なら納期)を書いていれば、その日が義務の時なので指しません。同じ条のほかの項が同じ行いに期限を書き、どちらかがもう一方を指していれば(第1項で何を払うかを書き、第3項が「本条1項に定める対価」をいつまでに払うかを書く条。「前項の対価を振込みで支払う」も同じ)、その期限が義務の時なので指しません。「2か月を目途に」も期限です。英語の文書では、支払の予定表(according to the Payment Schedule)や確定した判決の額(damages finally awarded)に時を任せる義務と、事前の承認を求めて出す義務(submit samples for prior approval)、相手の返品の承認(return material authorization)を得て返す義務も指しません。返品は相手が開く手続きに沿って行うからです。
71
+ en: 'A document where sentences stating a limit are not more than those holding a duty with none is taken to write its duties that way on purpose, and is not reported. A sentence that states a limit (within seven days, by the fifth business day, immediately) is not reported; one with "promptly" alone is vague-deadline''s. A sentence that grants a right (may) or states an amount (shall pay a monthly fee of $9,000, which sets the price; another clause says when) is not read. "by email" says how, not when, and is not a limit. Statutes, court decisions and patents are not read; the contract genre runs this rule. A duty whose article (else its list or paragraph) names the dated deadline of its act (the Due Date for a duty to pay, the Delivery Date for one to deliver) is timed by it, and is not reported. Nor is a duty whose article states a limit for the same act in another paragraph, when one of the two points at the other (the first paragraph says what is paid; the third pays "the fee in paragraph 1 of this Article" within ten days). Nor is a duty whose time a payment schedule (according to the Payment Schedule) or a court''s final award (damages finally awarded) sets, or one done for prior approval (submit samples for prior approval), which comes before the use it must precede. Nor is a return made under the other party''s return authorization (return Products after obtaining a return material authorization number), which follows the claim process that party opens.'
72
72
  rewrite:
73
73
  depth: light
74
74
  ja:
@@ -3,6 +3,7 @@ layer: L2
3
3
  status: stable
4
4
  how_to_find: preferred-term
5
5
  word_list: preferred-term
6
+ uses: [pos]
6
7
  severity: warning
7
8
 
8
9
  name:
@@ -54,8 +54,8 @@ example:
54
54
  4. Restart the computer when it finishes.
55
55
 
56
56
  not_flagged:
57
- ja: "番号の無い箇条書き、三つに満たない手順、指示が半分に満たない番号付きの箇条書き(用語と説明の一覧、「Faults caused by a drop」のように場合を並べた保証の対象外の一覧など)、短い項目(「Setup」)、動詞の前に札や前置きのある項目(「Guests: …」「On the left bar, select …」)、主語で始まる項目が {limit} 個を超えるか指示より多い手順は見ません。項目の最初の行の最初の文だけを見ます。"
58
- en: 'Bulleted lists, procedures of fewer than three steps, numbered lists where instructions are half or fewer (a list of terms, or of cases such as a warranty''s exclusions: "Faults caused by a drop"), short items ("Setup"), items with a label or an opening phrase before the verb ("Guests: …", "On the left bar, select …"), and procedures where statements are more than {limit} or not fewer than the instructions are not reported. Only the first sentence on each item''s own line is read.'
57
+ ja: "番号の無い箇条書き、三つに満たない手順、指示が半分に満たない番号付きの箇条書き(用語と説明の一覧、「Faults caused by a drop」のように場合を並べた保証の対象外の一覧など)、短い項目(「Setup」)、動詞の前に札や前置きのある項目(「Guests: …」「On the left bar, select …」)、主語で始まる項目が {limit} 個を超えるか指示より多い手順は見ません。項目の最初の行の最初の文だけを見ます。ただし、機械のすることを述べたあと、同じ行の後ろの文で指示する項目(「The printer feeds a blank label. Throw that label away.」)は指示として数えます。"
58
+ en: 'Bulleted lists, procedures of fewer than three steps, numbered lists where instructions are half or fewer (a list of terms, or of cases such as a warranty''s exclusions: "Faults caused by a drop"), short items ("Setup"), items with a label or an opening phrase before the verb ("Guests: …", "On the left bar, select …"), and procedures where statements are more than {limit} or not fewer than the instructions are not reported. Only the first sentence on each item''s own line is read, except that an item which states what the machine does and then gives the order in a later sentence on the same line ("The printer feeds a blank label. Throw that label away.") counts as an instruction.'
59
59
  level_meaning:
60
60
  ja: 説明の項目が {limit} 個以下で、指示の項目より少ないとき指摘
61
61
  en: reported when {limit} or fewer steps are statements and they are fewer than the instructions
@@ -45,8 +45,8 @@ example:
45
45
  来週は、新しい担当者の紹介、先月から続く予算の見直し、春の本社移転の準備、秋の採用計画の確認、年末の懇親会の段取りを話し合います。そのため定例会議は二時間に延長します。
46
46
 
47
47
  not_flagged:
48
- ja: 主題(名詞+は)の無い文、鉤括弧で引いたものの中、上限までの距離は見ません。主題の述語が先の節で閉じる文(「この計画は簡単ではありませんが、…」「〜であって、…」、後ろの節に別の主語がある「〜ではなく、」「〜であるため、」「〜の想定のため、」「〜であり、」(主題との間に別の主題(〜は)が無く、文末がまた繋辞か「〜がある」でないとき。後ろの主語は節を名詞にしたもの(〜することが求められている)でもよく、文末の名詞に「が」の主語が付くとき(〜を図ることが必要である)は繋辞で終わっても)、読点を挟まない「〜は〜で、」「〜であるならば、」「〜にあるところ、」「〜ており、」、受け身で伝える引用「〜だと言われているが」、主題と「〜ますが、」「〜ましたが、」(打ち消しの「〜ませんが、」「〜ませんでしたが、」も)の間に別の主語が無く、その後ろが別の主語(〜が)の節を経て新しい主題(〜は、〜には)に移る文か、直後に名前の新しい主題(〜ましたが、赤澤大臣は…)が立って文末まで続く文、主題が行いを名詞にしたもの(〜することは差し控えますが、…)、主題からそこまでに別の主語が無い「〜ことから、」「〜つつ、」「〜としても、」「〜こととし、」(語は語彙表 topic-clause-close)、述語の後ろに丸数字の番号(③)が来て一行に詰まった箇条の次の項目が始まるところ、「〜のは」の主題が「という」で名詞に掛かる節の中で繋辞の述語を得て、その名詞句が読点で終わるところ(〜来てほしいのは日本であったという調査の結果、…))は、その節の終わりまでを数えます。後ろの節の主語には「〜のほとんどは」も数えます。副詞になる「は」(最後は=結局のところ。語は語彙表 topic-adverb)は主題と読みません。前に名詞や「の」が付けば(交渉の最後は)主題です。時や場面を言う「は」(今夜は、当日は、〜ときは)の後ろに別の主題があれば、その主題から数えます。時や場面を言う主題(決定後は、普及以前は)は、「〜ますが、」「〜でしたが、」の後ろに別の主語があれば、間に別の主語があってもそこまでを数えます。法令でも契約でもない文書が条文をそのまま載せた文(「第7条 …」、形は語彙表 statute-article-opener)は、書き手が直せる文ではないので数えません。英語の文書には使いません。
49
- en: Sentences with no topic (noun + は), quotations in 「」, and distances up to the limit are not counted. When the topic gets its own predicate in an earlier clause (〜ではありませんが, 〜であって; 〜ではなく, 〜であるため, 〜の想定のため, 〜であり (when no other topic stands between and the sentence does not end on a copula or 〜がある again; the later subject may be a clause made a noun, 〜することが求められている, and when the final noun has a subject of its own with が, 〜を図ることが必要である, the sentence may end on a copula), 〜は〜で with no comma between, 〜であるならば, 〜にあるところ or 〜ており followed by a clause with its own subject; a passive report 〜だと言われているが; 〜ますが or 〜ましたが (or the negative 〜ませんが, 〜ませんでしたが) with no other subject between the topic and it, followed by a clause with a subject of its own (〜が) and then a new topic (〜は, 〜には), or straight away by a name as a new topic that runs to the end (〜ましたが、赤澤大臣は…), or always when the topic is an act made a noun (〜することは差し控えますが、…); 〜ことから, 〜つつ, 〜としても or 〜こととし with no other subject between the topic and it, from the topic-clause-close word list; a circled number (③) after a predicate, where a list run into one line starts its next item; a 〜のは topic that gets its copula inside a clause という makes a noun's content, when that noun phrase ends at a comma, as in 〜来てほしいのは日本であったという調査の結果、…), the count stops at that clause's end. A later clause's subject may be a part, as in 〜のほとんどは. A は that makes an adverb of the noun before it (最後は, in the end; the words are in the topic-adverb word list) is not a topic; with a noun or の before it (交渉の最後は) it is. When a は that sets the time or the case (今夜は, 当日は, 〜ときは) is followed by another topic, the count starts from that topic. A topic that sets the time or the case (決定後は, 普及以前は) ends at 〜ますが or 〜でしたが when a subject of its own follows, even with another subject between. An article of a statute that a document of another kind quotes as it stands (第7条 …, the forms in the statute-article-opener word list) is not the writer's sentence and is not counted. Not used on English documents.
48
+ ja: 主題(名詞+は)の無い文、鉤括弧で引いたものの中、上限までの距離は見ません。主題の述語が先の節で閉じる文(「この計画は簡単ではありませんが、…」「〜であって、…」、後ろの節に別の主語がある「〜ではなく、」「〜であるため、」「〜の想定のため、」(後ろが話し手の頼み(〜していただけると、〜いただきたい)でもよい)「〜であり、」(主題との間に別の主題(〜は)が無く、文末がまた繋辞か「〜がある」でないとき。後ろの主語は節を名詞にしたもの(〜することが求められている)でもよく、文末の名詞に「が」の主語が付くとき(〜を図ることが必要である)は繋辞で終わっても)、読点を挟まない「〜は〜で、」「〜であるならば、」「〜にあるところ、」「〜ており、」、受け身で伝える引用「〜だと言われているが」、主題と「〜ますが、」「〜ましたが、」(打ち消しの「〜ませんが、」「〜ませんでしたが、」も)の間に別の主語が無く、その後ろが別の主語(〜が)の節を経て新しい主題(〜は、〜には)に移る文か、直後に名詞の新しい主題(〜ましたが、赤澤大臣は…、〜ておりますが、本事業は、…)が立って文末まで続く文、主題が行いを名詞にしたもの(〜することは差し控えますが、…)、主題からそこまでに別の主語が無い「〜ことから、」「〜つつ、」「〜としても、」「〜こととし、」(語は語彙表 topic-clause-close)、述語の後ろに丸数字の番号(③)が来て一行に詰まった箇条の次の項目が始まるところ、「〜のは」の主題が「という」で名詞に掛かる節の中で繋辞の述語を得て、その名詞句が読点で終わるところ(〜来てほしいのは日本であったという調査の結果、…))は、その節の終わりまでを数えます。後ろの節の主語には「〜のほとんどは」も数えます。副詞になる「は」(最後は=結局のところ。語は語彙表 topic-adverb)は主題と読みません。前に名詞や「の」が付けば(交渉の最後は)主題です。時や場面を言う「は」(今夜は、当日は、〜ときは)の後ろに別の主題があれば、その主題から数えます。時や場面を言う主題(決定後は、普及以前は)は、「〜ますが、」「〜でしたが、」の後ろに別の主語があれば、間に別の主語があってもそこまでを数えます。法令でも契約でもない文書が条文をそのまま載せた文(「第7条 …」、形は語彙表 statute-article-opener)は、書き手が直せる文ではないので数えません。英語の文書には使いません。
49
+ en: Sentences with no topic (noun + は), quotations in 「」, and distances up to the limit are not counted. When the topic gets its own predicate in an earlier clause (〜ではありませんが, 〜であって; 〜ではなく, 〜であるため, 〜の想定のため (or followed by the speaker asking a favour, as in 〜していただけると, 〜いただきたい), 〜であり (when no other topic stands between and the sentence does not end on a copula or 〜がある again; the later subject may be a clause made a noun, 〜することが求められている, and when the final noun has a subject of its own with が, 〜を図ることが必要である, the sentence may end on a copula), 〜は〜で with no comma between, 〜であるならば, 〜にあるところ or 〜ており followed by a clause with its own subject; a passive report 〜だと言われているが; 〜ますが or 〜ましたが (or the negative 〜ませんが, 〜ませんでしたが) with no other subject between the topic and it, followed by a clause with a subject of its own (〜が) and then a new topic (〜は, 〜には), or straight away by a noun as a new topic that runs to the end (〜ましたが、赤澤大臣は…, 〜ておりますが、本事業は、…), or always when the topic is an act made a noun (〜することは差し控えますが、…); 〜ことから, 〜つつ, 〜としても or 〜こととし with no other subject between the topic and it, from the topic-clause-close word list; a circled number (③) after a predicate, where a list run into one line starts its next item; a 〜のは topic that gets its copula inside a clause という makes a noun's content, when that noun phrase ends at a comma, as in 〜来てほしいのは日本であったという調査の結果、…), the count stops at that clause's end. A later clause's subject may be a part, as in 〜のほとんどは. A は that makes an adverb of the noun before it (最後は, in the end; the words are in the topic-adverb word list) is not a topic; with a noun or の before it (交渉の最後は) it is. When a は that sets the time or the case (今夜は, 当日は, 〜ときは) is followed by another topic, the count starts from that topic. A topic that sets the time or the case (決定後は, 普及以前は) ends at 〜ますが or 〜でしたが when a subject of its own follows, even with another subject between. An article of a statute that a document of another kind quotes as it stands (第7条 …, the forms in the statute-article-opener word list) is not the writer's sentence and is not counted. Not used on English documents.
50
50
  level_meaning:
51
51
  ja: 主題から述語まで {limit} 字まで
52
52
  en: up to {limit} {limit|character|characters} between the topic and the predicate
@@ -10,8 +10,8 @@ name:
10
10
  en: Unfilled placeholder
11
11
 
12
12
  why:
13
- ja: "「【会社名】」「[Your Name]」「[Candidate Name]」「(ここに会社名を書く)」は、雛形や生成した下書きに残る空欄です。値に「TODO: …」「未定」とだけ書いたものも、後で埋めるつもりの空欄です。英語の雛形の指示の行(OPTIONAL: General conclusions …)が、埋めた報告書に残ったものも同じです。文体の好みではなく、埋め忘れです。ビジネス文書の宛名・署名・金額・日付・住所・電話番号の位置に残った「〇〇様」「株式会社〇〇」「〇万円」「氏名:〇〇」「03-〇〇〇〇」「東京都品川区〇〇」も同じ空欄です。メールアドレスの中の空欄(hello@[yourcompany].com)も数えます。表の升に残った空欄も数えます。文の中で例として置いた「○○」は正しい書き方なので数えません。"
14
- en: '"[Your Name]", "[Insert Date]" and "[Candidate Name]" are the blanks a template or a generated draft leaves. A value that only says "TODO: …" or "TBD" is a blank too, left to fill in later, and so is an instruction line from the template left in a filled report ("OPTIONAL: General conclusions …"). This is not a matter of style: the blank was never filled. In a Japanese business document, the blank marks (〇〇) left where a name, a sum, a date, an address or a phone number belongs (〇〇様, 株式会社〇〇, 〇万円, 氏名:〇〇, 03-〇〇〇〇, 東京都品川区〇〇) are blanks too, and so is a blank inside a mail or web address (hello@[yourcompany].com). A blank left in a table cell counts as well.'
13
+ ja: "「【会社名】」「[Your Name]」「[Candidate Name]」「(ここに会社名を書く)」は、雛形や生成した下書きに残る空欄です。値に「TODO: …」「未定」とだけ書いたものも、後で埋めるつもりの空欄です。英語の雛形の指示の行(OPTIONAL: General conclusions …)が、埋めた報告書に残ったものも同じです。文体の好みではなく、埋め忘れです。ビジネス文書の宛名・署名・金額・日付・住所・電話番号の位置に残った「〇〇様」「株式会社〇〇」「〇万円」「氏名:〇〇」「03-〇〇〇〇」「東京都品川区〇〇」も同じ空欄です。メールアドレスの中の空欄(hello@[yourcompany].com)も数えます。URL に雛形の名前が残ったもの(git clone https://github.com/yourname/tool.git)は、コードの中でも数えます。表の升に残った空欄も数えます。文の中で例として置いた「○○」は正しい書き方なので数えません。"
14
+ en: '"[Your Name]", "[Insert Date]" and "[Candidate Name]" are the blanks a template or a generated draft leaves. A value that only says "TODO: …" or "TBD" is a blank too, left to fill in later, and so is an instruction line from the template left in a filled report ("OPTIONAL: General conclusions …"). This is not a matter of style: the blank was never filled. In a Japanese business document, the blank marks (〇〇) left where a name, a sum, a date, an address or a phone number belongs (〇〇様, 株式会社〇〇, 〇万円, 氏名:〇〇, 03-〇〇〇〇, 東京都品川区〇〇) are blanks too, and so is a blank inside a mail or web address (hello@[yourcompany].com), and a template''s name left as part of a web address, code included (git clone https://github.com/yourname/tool.git). A blank left in a table cell counts as well.'
15
15
 
16
16
  message:
17
17
  ja: 「{matched}」が埋まっていません
@@ -50,8 +50,8 @@ example:
50
50
  This agreement is between Harbour Ltd (the "Seller") and Hill Ltd (the "Buyer"). The Seller ships within five days.
51
51
 
52
52
  not_flagged:
53
- ja: 定義の条(「X」とは…をいう)で定義した語は、前で使っても言いません。定義の条は文書の頭にも終わりにも置く書き方があるためです。規約やポリシーの丁寧な形(以下「X」といいます)も、法令の形と同じに読みます。見出しの行(章・節の行、条の前の「(買主の義務)」のような見出し)の語と、漢字で終わる語にさらに漢字が続く長い語(「監査委員会」の「監査委員」)と、定義の括弧の前の長い名前をそのまま書いた所(「…作成の手引き(以下「手引き」という。)」より前の「…作成の手引き」)は、使った所に数えません。最初の一か所だけを指します。別の語を定義する括弧の前の名前の中(This Services Agreement (this "Agreement") の Services、本サービス利用契約(以下「本契約」という。)の本サービス)も、使った所に数えません。目次・索引の行(目次の見出しの下の項目、一行に詰めた目次、定義した語と条の番地の一覧)と、条の番号の後ろの題(Section 1.1 Closing.)と、番号と語の終わりに条の番地の括弧を添えただけの札((1)文化芸術推進基本計画(第7条関係))と、語を含むもっと長い名前(定義の括弧の前の名前を前で写した株式会社みなと、もっと長い定義した語、Navistar Financial Corporation)も数えません。文書自身の名前と定義した語に同じ頭を付けた所(この就業規則(以下「規則」)より前の「この規則」)と、すぐ後ろの括弧に定義の長い名前を書き添えた所は、読み手に分かるので言いません。要約の節(「要旨」「裁判要旨」「Summary」のような見出しの下)で、定義がその節の外にある語と、番号と題だけの項目の行((2)本件仮換地の指定等)は、本文を縮めたり名前を付けたりした所なので数えません。番地や法令の名前に続けて語の意味の出どころを書いた所(69条の3所定の小規模宅地等)も数えません。「はじめに」「序論」の節は後の本文が定義することを先に名指す所なので、要約の節と同じに読みます。他の法令を引き写した節(見出しがその法令の名前で、文書がほかでその法令を引いている)の条の中の定義は、その法令の定義で、この文書の語の定義としては読みません。英語の語を大文字の長い名前の終わりに書いた所(The National Security Act of 1947)より後ろの the Act は、その名前を指すので数えません。一字の漢字の語は、当事者の呼び名(甲・乙・丙・丁)だけを探します。「法」「令」のような一字の語はふつうの語としても書くためです。GitHub の注記(> [!NOTE])は掲載元が本文の外に添えた断りなので、その中の語は数えません。英語で文書を普通の名詞で呼んで定義した名前(this document (the "Terms"))も、文書自身の名前なので this を付ければ前で書いても言いません。
54
- en: Terms defined in a definitions clause ("X" means ...) are not checked, since a definitions clause may come first or last. A heading line (a chapter or section line, or the caption above an article) does not count as a use, nor does a longer word that runs on in kanji past a term ending in kanji, nor an earlier copy of the long name written just before the definition's bracket. The polite Japanese form (以下「X」といいます) is read like the statute form. Only the first early use is pointed at. A word inside the name written right before another term's defining bracket (Services in This Services Agreement (this "Agreement")) is not a use either. Nor are contents and index lines (the items under a contents heading, a table of contents or a list of defined terms and section numbers packed on one line), a caption after a section number (Section 1.1 Closing.), a label of a number and the term ending in a bracketed section reference ((a) Seller (Section 2)), or a longer name that holds the term, such as an earlier copy of the name before the bracket (Board of Directors before our Board of Directors ("Board")), a longer defined term, a capitalised name ending in it (Navistar Financial Corporation). The document naming itself (this Agreement before (this "Agreement")) and a use followed by the long name in brackets are clear to the reader and not pointed at. A use in a summary section (under a heading such as Summary, Syllabus or 裁判要旨) of a term defined outside it, and a numbered line that only names the section below ((2) Interim Land Designation) summarise or name the body, so they are not uses either. An introduction (a heading that is the whole of Introduction, Preface or Foreword) names ahead what the body defines and is read like a summary. A definition inside an article copied from another statute (under a heading that names a document the text cites elsewhere) is that statute's, not this document's. After a longer capitalised name ending in the term (The National Security Act of 1947), "the Act" points back to that name and is not an early use. A Japanese term of a single kanji is checked only when it is a party's short name (甲, 乙, 丙, 丁); other single-kanji words such as 法 are also written in their everyday sense. A GitHub alert (> [!NOTE]) is the publisher's note beside the text, so a word in it is not a use. A name defined for the document in passing (this document (the "Terms")) may be written with this before the definition (this Terms agreement).
53
+ ja: 定義の条(「X」とは…をいう)で定義した語は、前で使っても言いません。定義の条は文書の頭にも終わりにも置く書き方があるためです。規約やポリシーの丁寧な形(以下「X」といいます)も、法令の形と同じに読みます。見出しの行(章・節の行、条の前の「(買主の義務)」のような見出し)の語と、漢字で終わる語にさらに漢字が続く長い語(「監査委員会」の「監査委員」)と、定義の括弧の前の長い名前をそのまま書いた所(「…作成の手引き(以下「手引き」という。)」より前の「…作成の手引き」)は、使った所に数えません。最初の一か所だけを指します。別の語を定義する括弧の前の名前の中(This Services Agreement (this "Agreement") の Services、本サービス利用契約(以下「本契約」という。)の本サービス)も、使った所に数えません。目次・索引の行(目次の見出しの下の項目、一行に詰めた目次、定義した語と条の番地の一覧)と、条の番号の後ろの題(Section 1.1 Closing.)と、番号と語の終わりに条の番地の括弧を添えただけの札((1)文化芸術推進基本計画(第7条関係))と、語を含むもっと長い名前(定義の括弧の前の名前を前で写した株式会社みなと、もっと長い定義した語、Navistar Financial Corporation)も数えません。文書自身の名前と定義した語に同じ頭を付けた所(この就業規則(以下「規則」)より前の「この規則」)と、すぐ後ろの括弧に定義の長い名前を書き添えた所は、読み手に分かるので言いません。要約の節(「要旨」「裁判要旨」「Summary」のような見出しの下)で、定義がその節の外にある語と、番号と題だけの項目の行((2)本件仮換地の指定等)は、本文を縮めたり名前を付けたりした所なので数えません。番地や法令の名前に続けて語の意味の出どころを書いた所(69条の3所定の小規模宅地等)も数えません。後ろで定義することを先に断った所(下記パブリック・ライセンス、後述の利用条件)と、それより後ろで同じ語を使った所も、読み手は定義が来ると知っているので数えません。「はじめに」「序論」の節は後の本文が定義することを先に名指す所なので、要約の節と同じに読みます。他の法令を引き写した節(見出しがその法令の名前で、文書がほかでその法令を引いている)の条の中の定義は、その法令の定義で、この文書の語の定義としては読みません。英語の語を大文字の長い名前の終わりに書いた所(The National Security Act of 1947)より後ろの the Act は、その名前を指すので数えません。一字の漢字の語は、当事者の呼び名(甲・乙・丙・丁)だけを探します。「法」「令」のような一字の語はふつうの語としても書くためです。GitHub の注記(> [!NOTE])は掲載元が本文の外に添えた断りなので、その中の語は数えません。英語で文書を普通の名詞で呼んで定義した名前(this document (the "Terms"))も、文書自身の名前なので this を付ければ前で書いても言いません。
54
+ en: Terms defined in a definitions clause ("X" means ...) are not checked, since a definitions clause may come first or last. A heading line (a chapter or section line, or the caption above an article) does not count as a use, nor does a longer word that runs on in kanji past a term ending in kanji, nor an earlier copy of the long name written just before the definition's bracket. The polite Japanese form (以下「X」といいます) is read like the statute form. Only the first early use is pointed at. A word inside the name written right before another term's defining bracket (Services in This Services Agreement (this "Agreement")) is not a use either. Nor are contents and index lines (the items under a contents heading, a table of contents or a list of defined terms and section numbers packed on one line), a caption after a section number (Section 1.1 Closing.), a label of a number and the term ending in a bracketed section reference ((a) Seller (Section 2)), or a longer name that holds the term, such as an earlier copy of the name before the bracket (Board of Directors before our Board of Directors ("Board")), a longer defined term, a capitalised name ending in it (Navistar Financial Corporation). The document naming itself (this Agreement before (this "Agreement")) and a use followed by the long name in brackets are clear to the reader and not pointed at. A use that points the reader ahead to its definition (the following Licence, the Licence below, 下記パブリック・ライセンス), and any later use of the term before its definition, is not an early use either, since the reader has been told the definition is coming. A use in a summary section (under a heading such as Summary, Syllabus or 裁判要旨) of a term defined outside it, and a numbered line that only names the section below ((2) Interim Land Designation) summarise or name the body, so they are not uses either. An introduction (a heading that is the whole of Introduction, Preface or Foreword) names ahead what the body defines and is read like a summary. A definition inside an article copied from another statute (under a heading that names a document the text cites elsewhere) is that statute's, not this document's. After a longer capitalised name ending in the term (The National Security Act of 1947), "the Act" points back to that name and is not an early use. A Japanese term of a single kanji is checked only when it is a party's short name (甲, 乙, 丙, 丁); other single-kanji words such as 法 are also written in their everyday sense. A GitHub alert (> [!NOTE]) is the publisher's note beside the text, so a word in it is not a use. A name defined for the document in passing (this document (the "Terms")) may be written with this before the definition (this Terms agreement).
55
55
  rewrite:
56
56
  depth: structure
57
57
  ja:
@@ -20,15 +20,31 @@ export const clauseEnds = (tokens: readonly Token[], particles: readonly string[
20
20
  tokens.filter((token, at) => endsClause(token, tokens[at + 1]) && particles.includes(tokens[at - 1]?.surface ?? "") && touches(tokens[at - 1], token)),
21
21
  );
22
22
 
23
+ /**
24
+ * The ある of a copula である (子会社である法人): the clause before it says what the next noun is. It ends a phrase only
25
+ * when the clause holds a single particle (当社の子会社である): a clause that nests itself (県の対策のトップである) is read with the run.
26
+ */
27
+ export const copulaEnds = (tokens: readonly Token[]): ReadonlySet<Token> =>
28
+ new Set(
29
+ tokens.filter((token, at) => {
30
+ const before = tokens[at - 1];
31
+ return token.pos === "AUX" && token.surface === "ある" && before?.pos === "AUX" && before.surface === "で" && touches(before, token);
32
+ }),
33
+ );
34
+
23
35
  const endsBetween = (left: Token, right: Token, ends: ReadonlySet<Token>): boolean =>
24
36
  [...ends].some((verb) => verb.span.start >= left.span.end && verb.span.end <= right.span.start);
25
37
 
26
- /** The most particles of a run (in order) that no clause end (ends) falls between: 2 for 特定の番号の|ついた版の. 0 for none. */
27
- export const longestClausePart = (run: readonly Token[], ends: ReadonlySet<Token>): number =>
38
+ /**
39
+ * The most particles of a run (in order) that no clause end (ends) falls between: 2 for 特定の番号の|ついた版の. 0 for none.
40
+ * A copula end (copulas) falls between only after a part of one particle: 2 for 当社の|子会社である東西商事の株式の, 3 for 県の対策のトップである部の.
41
+ */
42
+ export const longestClausePart = (run: readonly Token[], ends: ReadonlySet<Token>, copulas: ReadonlySet<Token> = new Set()): number =>
28
43
  run.reduce<{ readonly current: number; readonly longest: number }>(
29
44
  (acc, token, at) => {
30
45
  const previous = run[at - 1];
31
- const current = previous !== undefined && endsBetween(previous, token, ends) ? 1 : acc.current + 1;
46
+ const breaks = previous !== undefined && (endsBetween(previous, token, ends) || (acc.current === 1 && endsBetween(previous, token, copulas)));
47
+ const current = breaks ? 1 : acc.current + 1;
32
48
  return { current, longest: Math.max(acc.longest, current) };
33
49
  },
34
50
  { current: 0, longest: 0 },
@@ -0,0 +1,49 @@
1
+ import type { Lexicon } from "../plugin.ts";
2
+ import { escapeRegExp } from "../orthography.ts";
3
+
4
+ type Span = { readonly start: number; readonly end: number };
5
+
6
+ /** Lexicon group of placeholder-word: a path segment of a web address a template leaves to fill (example.com/yourname/tool). */
7
+ export const ADDRESS_BLANK = "address-blank";
8
+
9
+ /** A web address, code included: a clone command in a fenced block keeps the template's user name as often as prose does. */
10
+ const WEB_ADDRESS = /https?:\/\/[^\s/<>()[\]`"']+(?:\/[^\s/<>()[\]`"']*)*/gu;
11
+ /** What may end a segment besides the next slash: a file extension (.git) or a closing stop. */
12
+ const SEGMENT_END = /[.,;:!?]/u;
13
+
14
+ const segmentsOf = (address: string, start: number): Span[] => {
15
+ const host = address.indexOf("/", address.indexOf("//") + 2);
16
+ if (host < 0) return [];
17
+ return address
18
+ .slice(host + 1)
19
+ .split("/")
20
+ .reduce<{ spans: Span[]; at: number }>(
21
+ (state, segment) => {
22
+ const cut = segment.search(SEGMENT_END);
23
+ const word = cut < 0 ? segment : segment.slice(0, cut);
24
+ return { spans: [...state.spans, { start: state.at, end: state.at + word.length }], at: state.at + segment.length + 1 };
25
+ },
26
+ { spans: [], at: start + host + 1 },
27
+ ).spans;
28
+ };
29
+
30
+ /** Whether the word stands in the text outside web addresses, in any case. */
31
+ const mentionedOutside = (text: string, word: string): boolean => {
32
+ const bare = text.replace(WEB_ADDRESS, " ").toLowerCase();
33
+ return new RegExp(`(?<![\\p{L}\\p{N}_-])${escapeRegExp(word)}(?![\\p{L}\\p{N}_-])`, "u").test(bare);
34
+ };
35
+
36
+ /**
37
+ * Path segments of web addresses that are a template's blank word whole (github.com/yourname/tool.git, YOUR_USERNAME).
38
+ * A word the text also names outside any address (replace yourname with your account) is one the writer explains, and is meant.
39
+ */
40
+ export const addressBlankSpans = (text: string, words: Lexicon): Span[] => {
41
+ const blanks = new Set(words.filter((word) => word.group === ADDRESS_BLANK).map((word) => word.pattern.toLowerCase()));
42
+ if (blanks.size === 0) return [];
43
+ return [...text.matchAll(WEB_ADDRESS)]
44
+ .flatMap((match) => segmentsOf(match[0], match.index))
45
+ .filter((span) => {
46
+ const word = text.slice(span.start, span.end).toLowerCase();
47
+ return blanks.has(word) && !mentionedOutside(text, word);
48
+ });
49
+ };
@@ -54,5 +54,14 @@ const startsASentence = (before: string): boolean => {
54
54
  export const isNameMidSentence = (source: string, span: Span): boolean =>
55
55
  CAPITALISED.test(source.slice(span.start, span.end)) && !startsASentence(source.slice(Math.max(0, span.start - LOOK_BACK), span.start));
56
56
 
57
+ /**
58
+ * A bold holding only a code: digits, with capitals, hyphens, slashes or dots between them and no word (date code **2602**,
59
+ * lot **A-114**). It names a value the reader looks for on a label. A figure with a unit or a sign (**50%**, **$129**) is not one.
60
+ */
61
+ const CODE_ONLY = /^(?:\*\*|__)(?=[^*_]*\p{Nd})[\p{Lu}\p{Nd}][\p{Lu}\p{Nd}\-/.]*(?:\*\*|__)$/u;
62
+
63
+ export const isCodeValue = (source: string, span: Span): boolean => CODE_ONLY.test(source.slice(span.start, span.end));
64
+
57
65
  /** Whether a bold span emphasises words in running text, rather than labelling, heading or naming something. */
58
- export const isEmphasisBold = (source: string, span: Span): boolean => !opensItsBlock(source, span) && !isNameMidSentence(source, span);
66
+ export const isEmphasisBold = (source: string, span: Span): boolean =>
67
+ !opensItsBlock(source, span) && !isNameMidSentence(source, span) && !isCodeValue(source, span);
@@ -28,7 +28,7 @@ import { maskSpans } from "../mask.ts";
28
28
  import { quotedSpans } from "../quoted-span.ts";
29
29
  import { nameSpans } from "../team-names.ts";
30
30
  import { isIn } from "../lexicon-genres.ts";
31
- import { holdsKnown, isInnerSuffix, isTitledPerson, standaloneNames, unknownPieces } from "./kanji-run-pieces.ts";
31
+ import { type BreakMarks, holdsKnown, isBreakMark, isTitledPerson, standaloneNames, surfaceWithin, unknownPieces } from "./kanji-run-pieces.ts";
32
32
  import { isBibliographyEntry } from "./bibliography-entry.ts";
33
33
  import { isNamedByContext } from "./named-by-context.ts";
34
34
 
@@ -157,6 +157,8 @@ type NameWords = {
157
157
  readonly designations: readonly string[];
158
158
  /** お知らせやメールの題を閉じる語(お知らせ、ご案内)。 */
159
159
  readonly noticeEndings: readonly string[];
160
+ /** 漢数字の後ろで街区を言う単位(丁目)。漢数字と合わせた番地は、連なりの中でも切れ目を見せる。 */
161
+ readonly blockUnits: readonly string[];
160
162
  };
161
163
 
162
164
  type Tail = AddresseeSuffix;
@@ -169,7 +171,7 @@ type RunContext = {
169
171
  readonly titled: readonly string[];
170
172
  /** 文書の文の中に二度以上出る連なり(repeatedRuns)。題を閉じる語で終われば、書き手が名前として使い回している。 */
171
173
  readonly repeated: ReadonlySet<string>;
172
- /** 文書がほかで単独の連なりとして使う組織の名前(standaloneNames: 安全保障理事会)と法令の名前とその名の元の語(statuteTerms)。 */
174
+ /** 文書がほかで単独の連なりとして使う組織や題の名前(standaloneNames: 安全保障理事会、提供依頼申出書)と法令の名前とその名の元の語(statuteTerms)。 */
173
175
  readonly terms: ReadonlySet<string>;
174
176
  /** 文書のどこかで、括弧の中身がまるごとその連なりである名前(「署名用電子証明書確認画面」)。 */
175
177
  readonly presented: ReadonlySet<string>;
@@ -275,25 +277,21 @@ const measuredRun = (tokens: readonly Token[] | undefined, run: KanjiRun, contex
275
277
  return longestUnknown(tokens, rest, keptHead, context);
276
278
  };
277
279
 
278
- /** 語の、範囲(span)の中の字。連なりの頭や尻で外した語にまたがる語は、範囲の中だけ。 */
279
- const surfaceWithin = (token: Token, span: Span): string =>
280
- token.surface.slice(Math.max(0, span.start - token.span.start), Math.max(0, span.end - token.span.start));
281
-
282
280
  /**
283
281
  * 連なりの、知っている語(文書がほかで単独で使う組織の名前と法令の名前、連なりを閉じる決まった語、職名の前後の人の名前)を外した残りのうち、最も長いもの。
284
282
  * 安全保障理事会常任理事国は(安全保障理事会を単独で使う文書なら)「常任理事国」、日本国内閣総理大臣は「日本国」を数える。
285
- * 名前に普通の語が続く連なり(日本弁護士連合会臨時総会決議)は、名前がその文書で単独で使われていなければ、まるごと数える。連なりの中ほどの、並べた物の後ろに付く語(高齢運転者等専用駐車区間の「等」)は語の終わりを、前を指す語(事業当連結会計年度の「当」)は語の頭を見せるので、その前後を別に数える。
283
+ * 名前に普通の語が続く連なり(日本弁護士連合会臨時総会決議)は、名前がその文書で単独で使われていなければ、まるごと数える。連なりの中ほどの、並べた物の後ろに付く語(高齢運転者等専用駐車区間の「等」)は語の終わりを、前を指す語(事業当連結会計年度の「当」)は語の頭を、漢数字の番地(二丁目)は算用数字と同じく切れ目を見せるので、その前後を別に数える。
286
284
  */
287
285
  const longestUnknown = (tokens: readonly Token[], rest: Span, keptHead: string, context: RunContext): string => {
288
286
  const runTokens = coveringOf(tokens, rest).flatMap((index) => tokens.slice(index, index + 1));
289
287
  const words = runTokens.map((token) => surfaceWithin(token, rest));
290
- const breaks = [...context.words.listSuffixes, ...context.words.references];
288
+ const marks: BreakMarks = { suffixes: [...context.words.listSuffixes, ...context.words.references], blockUnits: context.words.blockUnits };
291
289
  // A run as long as the text holds no known word; reading it word by word would take a pass per word.
292
- if (!holdsKnown(words, [...context.terms, ...context.words.knownWords], breaks)) return keptHead + words.join("");
290
+ if (!holdsKnown(runTokens, words, [...context.terms, ...context.words.knownWords], marks)) return keptHead + words.join("");
293
291
  const isKnown = (start: number, end: number): boolean => {
294
292
  const piece = words.slice(start, end).join("");
295
293
  return (
296
- (end === start + 1 && isInnerSuffix(words, start, breaks)) ||
294
+ isBreakMark(runTokens, words, { start, end }, marks) ||
297
295
  context.terms.has(piece) ||
298
296
  (end === words.length && context.words.knownWords.has(piece)) ||
299
297
  isTitledPerson(runTokens, words, { start, end }, context.words.knownWords, context.maxKnownWords)
@@ -374,6 +372,7 @@ const nameWordsOf = (doc: ProseDocument): NameWords => {
374
372
  addressees: { prefixes: patterns("addressee-prefix"), titles: patterns("addressee-title"), endings: organisation.units, forms: organisation.closingForms },
375
373
  references: patterns("reference-prefix"),
376
374
  listSuffixes: [...patterns("list-suffix"), ...patterns("range-suffix")],
375
+ blockUnits: patterns("address-block-unit"),
377
376
  knownWords: new Set(patterns("kanji-known-word")),
378
377
  designations: patterns("designation-phrase"),
379
378
  noticeEndings: patterns("notice-title-ending"),
@@ -392,7 +391,7 @@ const contextOf = (doc: ProseDocument, options: DetectorOptions): RunContext =>
392
391
  titled: titledNames(doc, runs),
393
392
  repeated: repeatedRuns(inSentences),
394
393
  terms: new Set([
395
- ...standaloneNames([...inSentences, ...headingRuns(doc)], MIN_TERM_LENGTH, options.limit, words.organisation.units),
394
+ ...standaloneNames([...inSentences, ...headingRuns(doc)], MIN_TERM_LENGTH, options.limit, [...words.organisation.units, ...words.title.endings]),
396
395
  ...statuteTerms(runs, words.fixedName, options.limit),
397
396
  ...labelNames(runs),
398
397
  ]),
@@ -38,6 +38,22 @@ const lastParagraphSentences = (sentences: readonly Sentence[], paragraphs: read
38
38
  return paragraph === undefined ? [final] : sentences.filter((sentence) => sentence.span.start >= paragraph.span.start);
39
39
  };
40
40
 
41
+ /** 段落全体が斜体(*…* か _…_)。本文の後ろに添える但し書き(*This article is not tax advice.*)の形。 */
42
+ const ITALIC_PARAGRAPH = /^([*_])(?!\1)[\s\S]*[^\s*_]\1$/u;
43
+
44
+ const isItalicNote = (source: string, paragraph: Paragraph): boolean => ITALIC_PARAGRAPH.test(source.slice(paragraph.span.start, paragraph.span.end).trim());
45
+
46
+ /**
47
+ * 最後の段落の文に、後ろに続く斜体の但し書きを除いた最後の段落の文も加える。但し書きは書き手の結びではないので、
48
+ * その前の段落が最後の一行として読まれる。
49
+ */
50
+ const lastLineSentences = (sentences: readonly Sentence[], paragraphs: readonly Paragraph[], source: string): readonly Sentence[] => {
51
+ const notes = new Set(paragraphs.filter((paragraph) => isItalicNote(source, paragraph)));
52
+ const inNote = (sentence: Sentence): boolean => [...notes].some((note) => note.span.start <= sentence.span.start && sentence.span.start < note.span.end);
53
+ const beforeNotes = sentences.slice(0, sentences.findLastIndex((sentence) => !inNote(sentence)) + 1);
54
+ return [...lastParagraphSentences(sentences, paragraphs), ...lastParagraphSentences(beforeNotes, paragraphs)];
55
+ };
56
+
41
57
  type Words = {
42
58
  readonly closing: ReturnType<typeof exhortationWords>;
43
59
  readonly last: readonly LexiconEntry[];
@@ -53,8 +69,8 @@ const lastIn = (sentence: Sentence, words: Words): string | undefined =>
53
69
  type Hit = { readonly sentence: Sentence; readonly matched: string };
54
70
 
55
71
  /** 結びの、定型の言い回しのある文。一文に一つ。stacked の語は、ほかの定型が結びにあるときだけ数える。 */
56
- export const closingClicheHits = (sentences: readonly Sentence[], paragraphs: readonly Paragraph[], words: Words): Hit[] => {
57
- const last = new Set(lastParagraphSentences(sentences, paragraphs));
72
+ export const closingClicheHits = (sentences: readonly Sentence[], paragraphs: readonly Paragraph[], words: Words, source = ""): Hit[] => {
73
+ const last = new Set(lastLineSentences(sentences, paragraphs, source));
58
74
  const stock = new Map<Sentence, string>(
59
75
  sentences.flatMap((sentence): [Sentence, string][] => {
60
76
  const matched = exhortationIn(sentence, words.closing) ?? (last.has(sentence) ? lastIn(sentence, words) : undefined);
@@ -82,6 +98,7 @@ export const closingCliche: Detector = (doc, options): Finding[] => {
82
98
  closingSentences(doc.sections, doc.paragraphs),
83
99
  doc.paragraphs,
84
100
  closingClicheWords(entriesForGenre(options.lexicon ?? [], options.genre)),
101
+ doc.source,
85
102
  );
86
103
  if (hits.length < options.limit) return [];
87
104
  return hits.map((hit) => ({
@@ -95,10 +95,12 @@ export const contractionMix: Detector = (doc, options): Finding[] => {
95
95
  const pair = entry.instead_of === undefined ? undefined : mixedPair(texts, { short: entry.pattern.toLowerCase(), long: entry.instead_of.toLowerCase() });
96
96
  return pair === undefined || pair.count > options.limit ? [] : [pair];
97
97
  });
98
+ // A plain register set apart beside the clauses makes the clauses the formal one: a full form there is its own form, not a slip.
99
+ const pointedAt = summaries.size > 0 ? mixed.filter((candidate) => candidate.side === "short") : mixed;
98
100
  const hits = doc.sentences.flatMap((sentence) => {
99
101
  if (!isWriters(sentence) || warnings.has(sentence) || summaries.has(sentence)) return [];
100
102
  const pointable = pointableText(sentence, stressed);
101
- const pair = mixed.find((candidate) => usesMinority(pointable, candidate));
103
+ const pair = pointedAt.find((candidate) => usesMinority(pointable, candidate));
102
104
  return pair === undefined ? [] : [{ sentence, pair }];
103
105
  });
104
106
  return hits.map(({ sentence, pair }) => ({
@@ -34,6 +34,15 @@ const amountPattern = (form: CurrencyForm, multipliers: readonly string[]): RegE
34
34
  : new RegExp(`(?<![\\w.,,0-9])${AMOUNT}${multiplier}\\s?${mark}${latinEdge(form.pattern, "end")}`, "gu");
35
35
  };
36
36
 
37
+ // 前の読点を探す幅。改行と空行(段落の切れ目)をまたいでも届く長さ。
38
+ const APPOSITIVE_LOOKBEHIND_CHARS = 8;
39
+
40
+ /** 通貨コードに一桁だけを続けて読点のあとに置いた語(a coin, USD1.)は、ステーブルコインのような名前で、金額ではない。 */
41
+ const isCodeName = (text: string, offset: number, written: string): boolean =>
42
+ /^[A-Za-z]+\d$/u.test(written) &&
43
+ /,\s*$/u.test(text.slice(Math.max(0, offset - APPOSITIVE_LOOKBEHIND_CHARS), offset)) &&
44
+ /^(?:[.,;:!?)]|$)/u.test(text.charAt(offset + written.length));
45
+
37
46
  const overlaps = (left: WrittenAmount, right: WrittenAmount): boolean =>
38
47
  left.offset < right.offset + right.written.length && right.offset < left.offset + left.written.length;
39
48
 
@@ -42,12 +51,14 @@ export const amountsIn = (text: string, forms: readonly CurrencyForm[], multipli
42
51
  forms
43
52
  .toSorted((left, right) => right.pattern.length - left.pattern.length)
44
53
  .flatMap((form) =>
45
- [...text.matchAll(amountPattern(form, multipliers))].map((match) => ({
46
- offset: match.index,
47
- written: match[0],
48
- form: `${form.position}:${form.pattern}`,
49
- currency: form.currency,
50
- })),
54
+ [...text.matchAll(amountPattern(form, multipliers))]
55
+ .filter((match) => !isCodeName(text, match.index, match[0]))
56
+ .map((match) => ({
57
+ offset: match.index,
58
+ written: match[0],
59
+ form: `${form.position}:${form.pattern}`,
60
+ currency: form.currency,
61
+ })),
51
62
  )
52
63
  .reduce<WrittenAmount[]>((kept, amount) => (kept.some((other) => overlaps(other, amount)) ? kept : [...kept, amount]), [])
53
64
  .toSorted((left, right) => left.offset - right.offset);
@@ -89,6 +89,7 @@ export const useBeforeDefinition: Detector = (doc): Finding[] =>
89
89
  : usesBeforeDefinition(ownDefinitions(doc.structure), bodyOf(doc), mentionedIn(doc), titleIn(doc), {
90
90
  selfPrefixes: patternsOf(doc, "self-prefix"),
91
91
  sourceMarkers: patternsOf(doc, "term-source-marker"),
92
+ forwardReferences: doc.lexicons["forward-reference"] ?? [],
92
93
  singleKanjiNames: new Set(patternsOf(doc, "party-short-name")),
93
94
  }).map((use) => findingAt(doc, use.offset, { term: use.term.term, defined: use.term.line }));
94
95
 
@@ -113,6 +113,19 @@ const beAfter = (tokens: readonly Token[], head: Token): Token | undefined => {
113
113
  /** The sentence's opening, from There / It through its be: the finding names the form this sentence uses (There were, It was). */
114
114
  type Opening = { readonly head: Token; readonly be: Token };
115
115
 
116
+ /**
117
+ * It + be + a past participle + to ("It is designed to give the public a clear sense …") is a passive whose it names the
118
+ * thing before it: the that later in the sentence (", and that understanding is …") belongs to another clause. A be
119
+ * before an adjective (It is important to, It's tempting to, which the tagger may call a verb) stays the empty it.
120
+ */
121
+ const isPassiveOfThing = (tokens: readonly Token[], be: Token): boolean => {
122
+ const after = tokens.filter((token) => token.span.start >= be.span.end && token.pos !== "ADV");
123
+ const verb = after[0];
124
+ return verb?.pos === "VERB" && !verb.surface.toLowerCase().endsWith("ing") && after[1]?.surface.toLowerCase() === "to";
125
+ };
126
+
127
+ const hasThat = (tokens: readonly Token[]): boolean => tokens.some((token) => token.surface.toLowerCase() === "that");
128
+
116
129
  const expletiveAt = (tokens: readonly Token[]): Opening | undefined => {
117
130
  const head = tokens.find((token) => token.pos !== "PUNCT");
118
131
  if (head === undefined) return undefined;
@@ -121,7 +134,7 @@ const expletiveAt = (tokens: readonly Token[]): Opening | undefined => {
121
134
  const be = beAfter(tokens, head);
122
135
  if (be === undefined) return undefined;
123
136
  // "it is" は "it is raining" のような正当な用法があるので、that 節を伴うときだけ数える。
124
- if (lead === "it" && !beforeConcession(tokens).some((token) => token.surface.toLowerCase() === "that")) return undefined;
137
+ if (lead === "it" && (!hasThat(beforeConcession(tokens)) || isPassiveOfThing(tokens, be))) return undefined;
125
138
  return { head, be };
126
139
  };
127
140