chaffjs 0.42.0 → 0.43.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.
- package/dist/detectors/bold-label.d.ts +2 -0
- package/dist/detectors/bold-label.d.ts.map +1 -1
- package/dist/detectors/bold-label.js +4 -0
- package/dist/detectors/bold-label.js.map +1 -1
- package/dist/detectors/clause-shape.d.ts +8 -2
- package/dist/detectors/clause-shape.d.ts.map +1 -1
- package/dist/detectors/clause-shape.js +14 -6
- package/dist/detectors/clause-shape.js.map +1 -1
- package/dist/detectors/document-shape.d.ts +6 -1
- package/dist/detectors/document-shape.d.ts.map +1 -1
- package/dist/detectors/document-shape.js +14 -4
- package/dist/detectors/document-shape.js.map +1 -1
- package/dist/detectors/doubled-word.d.ts.map +1 -1
- package/dist/detectors/doubled-word.js +5 -1
- package/dist/detectors/doubled-word.js.map +1 -1
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +12 -1
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/ending-refrain.d.ts +9 -0
- package/dist/detectors/ending-refrain.d.ts.map +1 -0
- package/dist/detectors/ending-refrain.js +52 -0
- package/dist/detectors/ending-refrain.js.map +1 -0
- package/dist/detectors/fact-consistency.d.ts.map +1 -1
- package/dist/detectors/fact-consistency.js +5 -1
- package/dist/detectors/fact-consistency.js.map +1 -1
- package/dist/detectors/gram-predicate.d.ts.map +1 -1
- package/dist/detectors/gram-predicate.js +12 -3
- package/dist/detectors/gram-predicate.js.map +1 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +1 -0
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/lookalike-character.d.ts +2 -0
- package/dist/detectors/lookalike-character.d.ts.map +1 -1
- package/dist/detectors/lookalike-character.js +36 -9
- package/dist/detectors/lookalike-character.js.map +1 -1
- package/dist/detectors/mark-shape.d.ts +1 -1
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +29 -12
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/number-style.d.ts +7 -1
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +21 -1
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/number-unit.d.ts +7 -1
- package/dist/detectors/number-unit.d.ts.map +1 -1
- package/dist/detectors/number-unit.js +20 -6
- package/dist/detectors/number-unit.js.map +1 -1
- package/dist/detectors/particle-run-long-forms.d.ts +7 -0
- package/dist/detectors/particle-run-long-forms.d.ts.map +1 -0
- package/dist/detectors/particle-run-long-forms.js +23 -0
- package/dist/detectors/particle-run-long-forms.js.map +1 -0
- package/dist/detectors/particle-run-quoted-names.d.ts +6 -0
- package/dist/detectors/particle-run-quoted-names.d.ts.map +1 -0
- package/dist/detectors/particle-run-quoted-names.js +18 -0
- package/dist/detectors/particle-run-quoted-names.js.map +1 -0
- package/dist/detectors/register-separate-part.d.ts +9 -1
- package/dist/detectors/register-separate-part.d.ts.map +1 -1
- package/dist/detectors/register-separate-part.js +23 -0
- package/dist/detectors/register-separate-part.js.map +1 -1
- package/dist/detectors/register-voice.d.ts +4 -3
- package/dist/detectors/register-voice.d.ts.map +1 -1
- package/dist/detectors/register-voice.js +11 -4
- package/dist/detectors/register-voice.js.map +1 -1
- package/dist/detectors/register.d.ts.map +1 -1
- package/dist/detectors/register.js +9 -6
- package/dist/detectors/register.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts +1 -0
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +7 -3
- package/dist/detectors/sentence-ending.js.map +1 -1
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +5 -2
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/stacked-hedge.d.ts +4 -2
- package/dist/detectors/stacked-hedge.d.ts.map +1 -1
- package/dist/detectors/stacked-hedge.js +16 -3
- package/dist/detectors/stacked-hedge.js.map +1 -1
- package/dist/detectors/token-shape.d.ts.map +1 -1
- package/dist/detectors/token-shape.js +13 -1
- package/dist/detectors/token-shape.js.map +1 -1
- package/dist/detectors/unknown-word-context.d.ts +5 -0
- package/dist/detectors/unknown-word-context.d.ts.map +1 -1
- package/dist/detectors/unknown-word-context.js +8 -0
- package/dist/detectors/unknown-word-context.js.map +1 -1
- package/dist/detectors/unknown-word.d.ts.map +1 -1
- package/dist/detectors/unknown-word.js +3 -3
- package/dist/detectors/unknown-word.js.map +1 -1
- package/dist/detectors/weasel-word.d.ts.map +1 -1
- package/dist/detectors/weasel-word.js +23 -4
- package/dist/detectors/weasel-word.js.map +1 -1
- package/dist/facts/era-year.d.ts +2 -0
- package/dist/facts/era-year.d.ts.map +1 -0
- package/dist/facts/era-year.js +7 -0
- package/dist/facts/era-year.js.map +1 -0
- package/dist/facts/fact-scope.d.ts +1 -1
- package/dist/facts/fact-scope.d.ts.map +1 -1
- package/dist/facts/fact-scope.js +18 -8
- package/dist/facts/fact-scope.js.map +1 -1
- package/dist/facts/table-facts.d.ts.map +1 -1
- package/dist/facts/table-facts.js +18 -2
- package/dist/facts/table-facts.js.map +1 -1
- package/dist/own-title-quote.d.ts +7 -0
- package/dist/own-title-quote.d.ts.map +1 -0
- package/dist/own-title-quote.js +19 -0
- package/dist/own-title-quote.js.map +1 -0
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +3 -1
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure-shape/features.d.ts.map +1 -1
- package/dist/structure-shape/features.js +15 -2
- package/dist/structure-shape/features.js.map +1 -1
- package/dist/word-use.d.ts.map +1 -1
- package/dist/word-use.js +9 -1
- package/dist/word-use.js.map +1 -1
- package/package.json +3 -3
- package/rules/adverb-overuse.yaml +2 -2
- package/rules/bracket-nesting.yaml +7 -2
- package/rules/bracket-width-consistency.yaml +2 -2
- package/rules/doubled-word.yaml +2 -2
- package/rules/excessive-hedging.yaml +2 -1
- package/rules/fact-conflict.yaml +2 -2
- package/rules/lookalike-character.yaml +2 -2
- package/rules/ngram-repetition.yaml +2 -2
- package/rules/no-doubled-joshi.yaml +2 -2
- package/rules/no-mixed-desumasu.yaml +3 -2
- package/rules/number-style-consistency.yaml +2 -2
- package/rules/number-without-unit.yaml +2 -2
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/repeated-sentence-ending.yaml +2 -2
- package/rules/title-length.yaml +7 -2
- package/rules/undefined-acronym.yaml +2 -2
- package/rules/unknown-word.yaml +2 -2
- package/rules/unused-definition.yaml +4 -2
- package/src/detectors/bold-label.ts +6 -0
- package/src/detectors/clause-shape.ts +14 -12
- package/src/detectors/document-shape.ts +17 -6
- package/src/detectors/doubled-word.ts +9 -1
- package/src/detectors/en-shape.ts +15 -1
- package/src/detectors/ending-refrain.ts +66 -0
- package/src/detectors/fact-consistency.ts +4 -1
- package/src/detectors/gram-predicate.ts +14 -3
- package/src/detectors/lexicon.ts +1 -0
- package/src/detectors/lookalike-character.ts +40 -10
- package/src/detectors/mark-shape.ts +31 -12
- package/src/detectors/number-style.ts +29 -2
- package/src/detectors/number-unit.ts +29 -8
- package/src/detectors/particle-run-long-forms.ts +34 -0
- package/src/detectors/particle-run-quoted-names.ts +27 -0
- package/src/detectors/register-separate-part.ts +32 -1
- package/src/detectors/register-voice.ts +17 -4
- package/src/detectors/register.ts +9 -6
- package/src/detectors/sentence-ending.ts +10 -4
- package/src/detectors/signals.ts +5 -2
- package/src/detectors/stacked-hedge.ts +24 -7
- package/src/detectors/token-shape.ts +14 -1
- package/src/detectors/unknown-word-context.ts +9 -0
- package/src/detectors/unknown-word.ts +4 -2
- package/src/detectors/weasel-word.ts +31 -5
- package/src/facts/era-year.ts +7 -0
- package/src/facts/fact-scope.ts +20 -6
- package/src/facts/table-facts.ts +31 -3
- package/src/own-title-quote.ts +28 -0
- package/src/structure/definition-use.ts +4 -1
- package/src/structure-shape/features.ts +18 -2
- package/src/word-use.ts +10 -1
|
@@ -42,8 +42,8 @@ example:
|
|
|
42
42
|
after: 本社営業部にある第二課の方針を確認しました。
|
|
43
43
|
|
|
44
44
|
not_flagged:
|
|
45
|
-
ja: 読点で区切った並び、=・:・→
|
|
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 law written in the sentence (障害者等の移動等の円滑化の促進に関する法律), and the の before an honorific for a group of people when that form of address goes on with の (国民の皆様の期待, 被災者の方々の暮らし), are not counted. Nor is the の inside a set phrase read as one word (おそれのある, "at risk of", in 絶滅のおそれのある種). 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: 読点で区切った並び、=・:・→ で区切った句、「」や『』の中の題名や引用、行の頭のリンクで引いた外のページの題名、文の中に書いた法律の題名(障害者等の移動等の円滑化の促進に関する法律)、短い呼び名を付けた長い名前(被害者のための相談センター(以下「センター」という。))、文書が一度鉤括弧で引いた名前を括弧なしで書き直したもの(「地域のための共通の指針」と引いた後の、地域のための共通の指針の改定)は数えません。括弧(】や ))は、解析器が次の語とつなげて読んでも連なりを切ります。人の集まりを敬って呼ぶ語の前の「の」も、その呼び方が「の」で次の語に係るとき(国民の皆様の期待、被災者の方々の暮らし)は一つの呼び方の中なので数えません。決まった言い回しの中の「の」(絶滅のおそれのある種の「おそれのある」)も、一語のように読むので数えません。表を一続きの文に平らにしたもの(セルの数字がつながった 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 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 の inside a set phrase read as one word (おそれのある, "at risk of", in 絶滅のおそれのある種). 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
|
|
@@ -14,6 +14,7 @@ extra_word_lists:
|
|
|
14
14
|
set-polite-phrase,
|
|
15
15
|
contact-line-opener,
|
|
16
16
|
declaration-particle,
|
|
17
|
+
declaration-ending,
|
|
17
18
|
takeup-opener,
|
|
18
19
|
quote-label,
|
|
19
20
|
]
|
|
@@ -64,8 +65,8 @@ example:
|
|
|
64
65
|
新しい料金は来月から始まります。請求書の形式も変わります。支払いの期限は月末です。古い料金は三月で終わります。
|
|
65
66
|
|
|
66
67
|
not_flagged:
|
|
67
|
-
ja:
|
|
68
|
-
en: Neither register is called right; only the sentences in the minority are 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). Counted but never pointed at are a greeting or a closing request said only politely (お疲れ様でした。承認をお願いします。), a wish to others (信じてほしい。), a question that gives only a condition (…だったら?), a speaker declaring a resolve without a subject in a speech (戦争の惨禍を、二度と繰り返さない。), a scene-setting opener the next sentence takes up with そんな, こんな or これだけで, a cry that ends in an exclamation mark (わかるかっ!), a note on a line opening with ※, and a table cell set out between runs of lines that do not end as sentences (制限なし。).
|
|
68
|
+
ja: どちらの調子が正しいかは決めません。多いほうに揃っていない、少ないほうの文だけを指します。文書の中で二つの調子が同じ数なら、揃える先の多いほうが無いので、どちらも指しません。本文と箇条書きは別々に数えます。箇条書きの中の少ないほうが文書全体では多いほうなら、その文は指しません。項目や段落の頭の太字の札(「- **速く書ける。** 説明です。」の「速く書ける。」)は見出しと同じく文に数えません。免責や変更の予告を書いた段落(「…ご了承ください。」)が、2 文以上すべて文書の多いほうと違う同じ調子でそろっているときも、本文とは別の決まり文句として数えません。読み手の相談や質問を載せる節(見出しが「【相談事例等】」「ご質問内容」)の文も、尋ねた人の言葉のままなので数えません。文書の最後に掲載先が付けた利用条件の断り書き(ライセンスの名前と条件の URL を書いた短い段落)も数えません。札を付けて引いた言葉(「例:」「Q:」で始まる文、「用例」だけの段落の下の段落)、「■ 調査目的」のような印付きの札の行の下の記入欄の値、〒や「電話:」の行がある問い合わせ先の段落、一つの文の中に「?」で並べて引いた問い(…一覧か?順序付きか?などです。)、一番上の見出し(#)が二つ以上ある文書で、その見出しの下の 2 文以上がみな文書の多いほうと違う同じ調子でそろった部分(通達の後ろに付いた、ページの説明)も数えません。見出しが無くても、文書の多いほうの最後の文より後ろの 2 文以上がみな違う同じ調子でそろい(その調子の文がそれより前に無く)、その間に調子を持たない行(「第1」のようなリンクの並び)を挟むときは、ページの後ろの注記として数えません。数えたうえで指さないのは、丁寧な形でしか言わない挨拶(お疲れ様でした。)と結びの頼み(承認をお願いします。)、相手への願い(信じてほしい。)、条件だけで問う文(…だったら?)、演説で主語を言わずに決意を言い切る文(戦争の惨禍を、二度と繰り返さない。)、演説でこれから成し遂げることを「〜を…ていく。」と言い切る文(現場の気づきを、幹部の皆さんが形にしていく。)、次の文が「そんな」「こんな」「これだけで」で受ける場面や行いの書き出し(PDFが送れない。そんなときは…)、「!」で終わる叫び(わかるかっ!)、※で始まる行の注記、文で終わらない行の塊に前後を挟まれた表のセル(制限なし。)です。
|
|
69
|
+
en: Neither register is called right; only the sentences in the minority are pointed at. 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 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 note on a line opening with ※, and a table cell set out between runs of lines that do not end as sentences (制限なし。).
|
|
69
70
|
level_meaning:
|
|
70
71
|
ja: 少ないほうの調子の文が {limit} 文以下のとき、それを指摘
|
|
71
72
|
en: reported when the minority register has {limit} sentences or fewer
|
|
@@ -67,8 +67,8 @@ example:
|
|
|
67
67
|
We fixed three bugs, closed four issues and merged two pull requests. The release also adds five tests.
|
|
68
68
|
|
|
69
69
|
not_flagged:
|
|
70
|
-
ja: 鉤括弧や引用符の中の数、注や URL を含む文、日本語の中の英文は数えません。「一つ」「一人」のような一だけの漢数字と、「万人」「千人」のような位の字だけの漢数字、「第三回」「統一」のように漢字の後ろの数、日付の日・月・年、英語で名前の一部になった数(Grade 5 students、Room 12)は数えません。位取りは、通貨の記号か数え方の語・単位が付いた大きな数だけを見て、年に見える 4 桁の数(2019 年)、番号(H.R. 5376)、版や電話番号、コミットのハッシュのような 16 進の符号(2704b2d
|
|
71
|
-
en: 'Numbers inside quotation marks, sentences with a note mark or a URL, and text in another language are not counted. A number word that opens a sentence (spelt out by every style), "one", a number before a unit of measure (6 months, 3 miles) and a number that names a group (Grade 5 students, Room 12) are not counts. Grouping is checked only for large numbers with a currency sign or a word after them; a four-digit number that looks like a year, a label number (H.R. 5376, Form 1040), versions, phone numbers and hexadecimal codes such as a commit hash (2704b2d) are left out. Legal, literary and speech genres do not run this rule.'
|
|
70
|
+
ja: 鉤括弧や引用符の中の数、注や URL を含む文、日本語の中の英文は数えません。「一つ」「一人」のような一だけの漢数字と、「万人」「千人」のような位の字だけの漢数字、「第三回」「統一」のように漢字の後ろの数、日付の日・月・年、英語で名前の一部になった数(Grade 5 students、Room 12、§4)は数えません。位取りは、通貨の記号か数え方の語・単位が付いた大きな数だけを見て、年に見える 4 桁の数(2019 年)、番号(H.R. 5376)、版や電話番号、コミットのハッシュのような 16 進の符号(2704b2d)は見ません。数の多くが条の外にある文書の中で条として引いた法令(手引きが根拠に引いた手数料令の「二千四百円」)も、法令の書き方なので数えません。全角と半角の違いは fullwidth-alnum-consistency が見ます。法務・文学・話し言葉のジャンルでは見ません。
|
|
71
|
+
en: 'Numbers inside quotation marks, sentences with a note mark or a URL, and text in another language are not counted. A number word that opens a sentence (spelt out by every style), "one", a number before a unit of measure (6 months, 3 miles, 2 nights) and a number that names a group or a section (Grade 5 students, Room 12, §4) are not counts. Grouping is checked only for large numbers with a currency sign or a word after them; a four-digit number that looks like a year, a label number (H.R. 5376, Form 1040), versions, phone numbers and hexadecimal codes such as a commit hash (2704b2d) are left out. Articles of a law set out in a document whose numbers are mostly outside them (a manual quoting the order its fees rest on) keep the law''s numerals and are not counted. Legal, literary and speech genres do not run this rule.'
|
|
72
72
|
level_meaning:
|
|
73
73
|
ja: 少ないほうの書き方が、その種類の数の {limit}% 以下のとき指摘
|
|
74
74
|
en: reported when the less common style is {limit}% of its kind or less
|
|
@@ -70,8 +70,8 @@ example:
|
|
|
70
70
|
| Taxi | $100 |
|
|
71
71
|
|
|
72
72
|
not_flagged:
|
|
73
|
-
ja: ほかの値に二つ以上、同じ一つの単位が付いているときだけ指します。単位の無い値のほうが多い列、単位が混ざる列(分と時間)、数でない値(未定)は見ません。表の見出しの単位(「金額(円)」)は読みません。数量の列で、ほかの値が借りる期間(4日、2泊)のとき、単位の無い整数(チャイルドシート 1
|
|
74
|
-
en: Reported only when at least two other values carry one and the same unit. A column where bare numbers are the majority, one that mixes units (minutes and hours), and values that are not numbers (TBD) are not checked. A unit written in the header ("Amount ($)") is not read. In a Quantity column whose other values are a hired period (4 days, 2 nights), a bare whole number (Child seat | 1) is a count of pieces and is not reported. In prose, a word of scale is checked only when the document gives it one and the same unit at least five times and has no other bare number with it. A document that states "(in millions of dollars)" and writes "million" alone throughout, one with two units for the word ("$5 million" and "5 million shares"), and one unit serving two numbers ("from $1.1 million to 1.3 million") are not reported.
|
|
73
|
+
ja: ほかの値に二つ以上、同じ一つの単位が付いているときだけ指します。単位の無い値のほうが多い列、単位が混ざる列(分と時間)、数でない値(未定)は見ません。表の見出しの単位(「金額(円)」)は読みません。数量の列で、ほかの値が借りる期間(4日、2泊)のとき、単位の無い整数(チャイルドシート 1)は個数なので指しません。行ごとに違う量を並べた表(来場者の数の行と、満足度の%の行)で、同じ行のほかの列(前期と当期)も単位の無い数なら、その行の数は単位の要らない数として指しません。本文の桁の語は、同じ桁の語に同じ一つの単位を5回以上付けていて、単位の無い数がほかに一つも無いときだけ指します。「(単位:百万円)」と書いて本文でも「百万」だけで書く文書、百万円と百万株のように単位が二つある文書、「100百万〜200百万円」のように後ろの数の単位を前の数にも使う書き方は言いません。万は単位を付けずに書くことが多いので見ません。
|
|
74
|
+
en: Reported only when at least two other values carry one and the same unit. A column where bare numbers are the majority, one that mixes units (minutes and hours), and values that are not numbers (TBD) are not checked. A unit written in the header ("Amount ($)") is not read. In a Quantity column whose other values are a hired period (4 days, 2 nights), a bare whole number (Child seat | 1) is a count of pieces and is not reported. In a table whose rows are different measures (a row of visits, a row of rates in %), a bare number whose row is bare in another column too (Q2 and Q3) is a count that needs no unit, and is not reported. In prose, a word of scale is checked only when the document gives it one and the same unit at least five times and has no other bare number with it. A document that states "(in millions of dollars)" and writes "million" alone throughout, one with two units for the word ("$5 million" and "5 million shares"), and one unit serving two numbers ("from $1.1 million to 1.3 million") are not reported.
|
|
75
75
|
rewrite:
|
|
76
76
|
depth: light
|
|
77
77
|
ja:
|
|
@@ -56,8 +56,8 @@ example:
|
|
|
56
56
|
Send the form by email. We answer every email within a day. Attach the receipt to the email.
|
|
57
57
|
|
|
58
58
|
not_flagged:
|
|
59
|
-
ja: 読みが同じでも漢字の違う語(書く・描く)、補助動詞・形式名詞と本来の使い方の書き分け(見て下さい・資料を下さい)、書き分けが意味の違いになる語(成る・なる、言う・いう。法務のジャンルでは、法令の書き方で書き分ける 時・とき、物・もの、在る・ある も)、名詞と動詞(払込み・払い込む、申出・申し出る。辞書が名詞を動詞と読んでも)、二つの語に読める漢字の書き方(行っ は 行く とも 行う とも読み、「様を」の様は さま)、語末の「ー」だけの違い(katakana-long-vowel が見ます)、鉤括弧や引用符の中(判決が法令を文をまたいで引く一重の引用符も)と、引用した句を地の文でそのまま繰り返した所、行の頭のリンクで引いた外のページの題名、語の直後のふりがなの括弧の中(HTTP(えいちてぃーてぃーぴー))、会社の名前(青葉硝子㈱、株式会社の前後の名前)、施設や組織の名前(こども動物園、〜センター)、番号を付けて引いた法令の題名(愛がん動物用飼料の安全性の確保に関する法律(平成20年法律第83号))、引用のすぐ後ろの括弧の書き下し(「天子有道」(天子に道有らば))、文献一覧と文の形で書いた文献の引用、略語の元の語(Communication Access Realtime Translation (CART))、#を付けたハッシュタグ、chaff.yaml の names に書いた名前は見ません。「でもって」(以て)、「と」の後の「いたす」(議題といたします)、複合動詞の後ろの動詞(貼り付ける の 付ける)は、それだけの動詞(持つ、思いを致す、つける)と別に比べます。一語の副詞や語(ただいま、昨日来)、熟語の頭の一字の漢字(曇雨天の曇)、切られたカタカナの名前(ラオカイ
|
|
60
|
-
en: The case of a word's first letter (Email, email; Long-Term, long-term) is not a spelling, nor is a word in capitals only (emphasis or an acronym), nor a name in capitals with an ending (SENDs, OPENed), nor the letters of an acronym picked out beside it (CLImatology next to CLIPER), nor a word inside a passage written in capitals (eGAIN in a disclaimer), nor a name coined from capitalised pieces that are not words (Medi-Cal beside medical). A name spelled with capitals (HBase) is still compared. In Japanese, words whose kanji and kana forms mean different things (成る and なる) are not compared, 方 and ほう are compared only before が or で (早いほうが), since elsewhere 方 is mostly the person (担当の方に), nor a label opening a sentence (the (答) of a Q&A), a bracketed spelling in a sentence that names other spellings ((くもり)、(曇)とも書く), kana たつ beside 立つ, since たつ is also time passing (経つ), a numeral (the 三 of 三十), kana written onto a pronoun (私みたような) or okurigana cut off a word (誂らえる); the head of a compound verb (出来上る), an adverb opening a sentence as a conjunction (――もっとも) and a katakana spelling that names a sense (モノ for goods) are compared apart from the word on its own (できる, 最も, もの), while the conjunction さらに、 and the adverb 更に are one word and are compared; in the legal genres each justice's separate opinion (裁判官甲の反対意見は次のとおりである。) is compared only within itself; the judging みる (〜とみられる) and いえる (〜とはいえない) are compared apart from looking and saying (資料を見る, 一概には言えない), and in the legal genres neither are 時 and とき, 物 and もの or 在る and ある, which legal drafting writes apart. A noun and a verb (払込み and 払い込む) are different words, even where the analyser reads the noun as the verb. Hyphenated words that are another word (re-sign, resign), part of an address (github.com), anything in quotation marks (single ones too, as an opinion quotes a statute over several sentences) and a phrase the writer repeats word for word from a quotation in the document, the title of an outside page quoted by a link at a line's head, an entry of a reference list and a citation written as a sentence (See Kay and King (2020), Radical Uncertainty …), the words an acronym stands for (Communication Access Realtime Translation (CART), VADER (Valence Aware Dictionary and sEntiment Reasoner)), a hashtag (#vimconf), a surname a roster sets in capitals (MICHAEL T. McCAUL), the hyphens of a capitalised name where the word is otherwise written with or without them (the Interagency Group beside inter-agency), a Japanese reading in brackets right after a word (HTTP(えいちてぃーてぃーぴー)), a Japanese company name written with its form (青葉硝子㈱) and the team's names are not compared. Nothing is reported when the minority is more than a third. The literature preset turns it off, since old spelling belongs to its time. Nor is a kanji spelling that reads as two words (行っ, read as 行く or 行う; 様 before を, read さま) compared with the kana of the reading the tokenizer picked.
|
|
59
|
+
ja: 読みが同じでも漢字の違う語(書く・描く)、補助動詞・形式名詞と本来の使い方の書き分け(見て下さい・資料を下さい)、書き分けが意味の違いになる語(成る・なる、言う・いう。法務のジャンルでは、法令の書き方で書き分ける 時・とき、物・もの、在る・ある も)、名詞と動詞(払込み・払い込む、申出・申し出る。辞書が名詞を動詞と読んでも)、二つの語に読める漢字の書き方(行っ は 行く とも 行う とも読み、「様を」の様は さま)、語末の「ー」だけの違い(katakana-long-vowel が見ます)、鉤括弧や引用符の中(判決が法令を文をまたいで引く一重の引用符も)と、引用した句を地の文でそのまま繰り返した所、行の頭のリンクで引いた外のページの題名、語の直後のふりがなの括弧の中(HTTP(えいちてぃーてぃーぴー))、会社の名前(青葉硝子㈱、株式会社の前後の名前)、施設や組織の名前(こども動物園、〜センター)、番号を付けて引いた法令の題名(愛がん動物用飼料の安全性の確保に関する法律(平成20年法律第83号))、引用のすぐ後ろの括弧の書き下し(「天子有道」(天子に道有らば))、文献一覧と文の形で書いた文献の引用、略語の元の語(Communication Access Realtime Translation (CART))、#を付けたハッシュタグ、chaff.yaml の names に書いた名前は見ません。「でもって」(以て)、「と」の後の「いたす」(議題といたします)、複合動詞の後ろの動詞(貼り付ける の 付ける)は、それだけの動詞(持つ、思いを致す、つける)と別に比べます。一語の副詞や語(ただいま、昨日来)、熟語の頭の一字の漢字(曇雨天の曇)、切られたカタカナの名前(ラオカイ のカイ)も比べません。「方」と「ほう」は「が」「で」の前(早いほうが)だけで比べ、人の「方」の多い所(担当の方に)は比べません。文の頭の丸括弧の印(問答の(答))、別の書き方を言う文の丸括弧の中((くもり)、(曇)とも書く。)、漢数字(三十の三)、代名詞に続けたかな(私みたような)、切られた送りがな(誂らえる)も比べません。かなの「たつ」は、時がたつにも立つにも読めるので「立つ」と比べません。複合動詞の頭(出来上る)、文の頭の接続詞(――もっとも)、意味を変えるカタカナ(品物のモノ)は、それだけの語(できる、最も、もの)と別に比べます。名詞と「や」「と」で並べた語(物やサービス)は、形式名詞(延長するもの)と別に比べます。接続詞の「さらに、」と副詞の「更に」は同じ語として比べます。法務のジャンルでは、判決の裁判官ごとの意見(裁判官甲の反対意見は次のとおりである。)を、その意見の中だけで比べます。名詞に続けて書いたかなの名詞(全員ぶん)と慣用句の動詞(気をつける)、見立ての「みる」(〜とみられる、増加がみられる)と評価を言う「いえる」(〜とはいえない)は、同じ読みの語(文、名札を付ける、資料を見る)と別に比べます。英字は、頭の字の大文字小文字(Email と email)と、大文字だけの語(強調や略語)、大文字の名前に語尾が付いた語(関数名の SENDs)、名簿の大文字の名字(MICHAEL T. McCAUL)、同じ文の略語の字を示した語(CLIPER と並ぶ CLImatology)、大文字で書いた一節の中の語(免責の段落の eGAIN)、大文字で始まる語でないかけらをハイフンでつないだ名前(medical と並ぶ Medi-Cal)、大文字で始まる語を並べた名前の中のハイフン(inter-agency と並ぶ the Interagency Group)を書き方の違いにしません(HBase のような名前の大文字は比べます)。少ないほうが三分の一を超えるときも言いません。文学のジャンルでは既定で止めています(その時代の書き方のため)。
|
|
60
|
+
en: The case of a word's first letter (Email, email; Long-Term, long-term) is not a spelling, nor is a word in capitals only (emphasis or an acronym), nor a name in capitals with an ending (SENDs, OPENed), nor the letters of an acronym picked out beside it (CLImatology next to CLIPER), nor a word inside a passage written in capitals (eGAIN in a disclaimer), nor a name coined from capitalised pieces that are not words (Medi-Cal beside medical). A name spelled with capitals (HBase) is still compared. In Japanese, words whose kanji and kana forms mean different things (成る and なる) are not compared, 方 and ほう are compared only before が or で (早いほうが), since elsewhere 方 is mostly the person (担当の方に), nor a label opening a sentence (the (答) of a Q&A), a bracketed spelling in a sentence that names other spellings ((くもり)、(曇)とも書く), kana たつ beside 立つ, since たつ is also time passing (経つ), a numeral (the 三 of 三十), kana written onto a pronoun (私みたような) or okurigana cut off a word (誂らえる); the head of a compound verb (出来上る), an adverb opening a sentence as a conjunction (――もっとも) and a katakana spelling that names a sense (モノ for goods) are compared apart from the word on its own (できる, 最も, もの), and a noun joined to another by や or と (物やサービス) apart from the dependent noun (延長するもの), while the conjunction さらに、 and the adverb 更に are one word and are compared; in the legal genres each justice's separate opinion (裁判官甲の反対意見は次のとおりである。) is compared only within itself; the judging みる (〜とみられる) and いえる (〜とはいえない) are compared apart from looking and saying (資料を見る, 一概には言えない), and in the legal genres neither are 時 and とき, 物 and もの or 在る and ある, which legal drafting writes apart. A noun and a verb (払込み and 払い込む) are different words, even where the analyser reads the noun as the verb. Hyphenated words that are another word (re-sign, resign), part of an address (github.com), anything in quotation marks (single ones too, as an opinion quotes a statute over several sentences) and a phrase the writer repeats word for word from a quotation in the document, the title of an outside page quoted by a link at a line's head, an entry of a reference list and a citation written as a sentence (See Kay and King (2020), Radical Uncertainty …), the words an acronym stands for (Communication Access Realtime Translation (CART), VADER (Valence Aware Dictionary and sEntiment Reasoner)), a hashtag (#vimconf), a surname a roster sets in capitals (MICHAEL T. McCAUL), the hyphens of a capitalised name where the word is otherwise written with or without them (the Interagency Group beside inter-agency), a Japanese reading in brackets right after a word (HTTP(えいちてぃーてぃーぴー)), a Japanese company name written with its form (青葉硝子㈱) and the team's names are not compared. Nothing is reported when the minority is more than a third. The literature preset turns it off, since old spelling belongs to its time. Nor is a kanji spelling that reads as two words (行っ, read as 行く or 行う; 様 before を, read さま) compared with the kana of the reading the tokenizer picked.
|
|
61
61
|
level_meaning:
|
|
62
62
|
ja: 少ないほうが語の {limit}% 以下のとき指摘
|
|
63
63
|
en: reported when the minority spelling is {limit}% of the word's uses or less
|
|
@@ -43,8 +43,8 @@ example:
|
|
|
43
43
|
この機能は必要で、設定も簡単です。費用はかかりません。
|
|
44
44
|
|
|
45
45
|
not_flagged:
|
|
46
|
-
ja:
|
|
47
|
-
en: Sentences in different paragraphs are not a run. A sentence that does not end with an auxiliary (a noun, a bare verb) is not compared and breaks the run. Different verbs (読みました, 書きました) are different endings. Sentences that each define a different term in the same frame (台風は〜を指します。ハリケーンは〜を指します。) share their ending on purpose and are not reported.
|
|
46
|
+
ja: 段落をまたいだ文は続きと見ません。助動詞で終わらない文(体言止め、言い切りの動詞)は比べず、そこで続きが切れます。動詞が違えば(読みました、書きました)同じ文末とは見ません。述語の前の語まで同じ締めの句を三文以上重ねた繰り返し(いい船でした。…いい船でした。…いい船でした。)は、一つと数えます。一つの文の中に「?」で並べた問い(これはリストか?順序付きか?…などです。)も比べません。違う語を同じ型で定義する文の並び(台風は〜を指します。ハリケーンは〜を指します。)は、型をそろえたものなので指しません。
|
|
47
|
+
en: Sentences in different paragraphs are not a run. A sentence that does not end with an auxiliary (a noun, a bare verb) is not compared and breaks the run. Different verbs (読みました, 書きました) are different endings. Three sentences or more in a row that close on the very same phrase, the word before the predicate included (いい船でした。…いい船でした。…いい船でした。), are a refrain and count once. Questions run together inside one sentence (これはリストか?順序付きか?…などです。) are not compared either. Sentences that each define a different term in the same frame (台風は〜を指します。ハリケーンは〜を指します。) share their ending on purpose and are not reported.
|
|
48
48
|
level_meaning:
|
|
49
49
|
ja: 同じ文末の文が {limit} 文続くまで
|
|
50
50
|
en: up to {limit} sentences in a row with the same ending
|
package/rules/title-length.yaml
CHANGED
|
@@ -3,6 +3,7 @@ layer: L1
|
|
|
3
3
|
status: stable
|
|
4
4
|
how_to_find: title-length
|
|
5
5
|
requires: [markdown]
|
|
6
|
+
uses: [pos]
|
|
6
7
|
severity: info
|
|
7
8
|
|
|
8
9
|
name:
|
|
@@ -68,6 +69,8 @@ example:
|
|
|
68
69
|
config: { genre: blog/tech }
|
|
69
70
|
before: |
|
|
70
71
|
## 2025年度から始まる新しい在庫管理システムへの移行に伴う各店舗での作業手順と注意点について
|
|
72
|
+
|
|
73
|
+
2025年度の移行で各店舗が行う作業と、注意する点をまとめます。
|
|
71
74
|
after: |
|
|
72
75
|
## 在庫システムの移行手順
|
|
73
76
|
|
|
@@ -76,14 +79,16 @@ example:
|
|
|
76
79
|
config: { genre: blog/tech }
|
|
77
80
|
before: |
|
|
78
81
|
## What every store needs to do during the move to the new inventory system in the 2025 financial year
|
|
82
|
+
|
|
83
|
+
What every store does during the move in the 2025 financial year.
|
|
79
84
|
after: |
|
|
80
85
|
## Moving to the new inventory system
|
|
81
86
|
|
|
82
87
|
What every store does during the move in the 2025 financial year.
|
|
83
88
|
|
|
84
89
|
not_flagged:
|
|
85
|
-
ja: "見出しの頭の番号(「第2章」「1.」)は数えません。末尾の括弧の中の番号付きの通し名(「(490: Employee travel)」)も数えず、ほかの文書の題をかぎ括弧で引いた所(「「…の取扱いについて」等の一部改正」)は一つの名前と数えます。英字の語は一語を二文字と数えます。報告書・プレスリリース・議事録・仕様書・論文は上限が高く、法務・文学・話し言葉のジャンルと、見出しが質問の文になる FAQ
|
|
86
|
-
en: "A number label at the head of a heading (Chapter 2, 1.) is not counted. Nor is a numbered series label in brackets at its end (“(490: Employee travel)”), and another document's title quoted in 「」 counts as one name. Reports, press releases, minutes, specifications and papers have a higher limit; legal, literary and speech genres, and FAQs (whose headings are questions), do not run this rule. In any genre, a heading that ends with a question mark is not counted, since its length is the reader's question."
|
|
90
|
+
ja: "見出しの頭の番号(「第2章」「1.」)は数えません。末尾の括弧の中の番号付きの通し名(「(490: Employee travel)」)も数えず、ほかの文書の題をかぎ括弧で引いた所(「「…の取扱いについて」等の一部改正」)は一つの名前と数えます。英字の語は一語を二文字と数えます。報告書・プレスリリース・議事録・仕様書・論文は上限が高く、法務・文学・話し言葉のジャンルと、見出しが質問の文になる FAQ では見ません。ほかのジャンルでも、?や「か」で終わる質問の見出し(…できますか。)は、長さが読み手の問いそのものなので見ません。"
|
|
91
|
+
en: "A number label at the head of a heading (Chapter 2, 1.) is not counted. Nor is a numbered series label in brackets at its end (“(490: Employee travel)”), and another document's title quoted in 「」 counts as one name. Reports, press releases, minutes, specifications and papers have a higher limit; legal, literary and speech genres, and FAQs (whose headings are questions), do not run this rule. In any genre, a heading that ends with a question mark, or with a Japanese question particle (…できますか。), is not counted, since its length is the reader's question."
|
|
87
92
|
level_meaning:
|
|
88
93
|
ja: 題や見出しが {limit} 文字を超えたら指摘
|
|
89
94
|
en: reported when a title or heading runs past {limit} words
|
|
@@ -91,8 +91,8 @@ example:
|
|
|
91
91
|
after: Our key goal indicator (KGI) this term is to reach product-market fit (PMF).
|
|
92
92
|
|
|
93
93
|
not_flagged:
|
|
94
|
-
ja: 誰でも知っている略語(URL、PDF など)と、前後の括弧で説明した略語、会社の名前の中の英字(㈱ADEKA、CO.,LTD.)は指しません。ひな形の名前の置き場所(OOOO、XX 月)と、外のページへのリンクを並べた一覧の題名の中の略語も指しません(題名の略語は数には入れます)。大文字の違うだけの書き方で説明した略語(TCoP と TCOP)、略語を話題にする文で語に書き出した略語(略語の DOB … date of birth)、一覧で語のすぐ下にその語を名指すリンクを入れ子にした語(- GPL の下の GNU General Public License)も指しません。判例の引用の中の当事者と裁判所の名前(Ashwander v. TVA, 297 U.S. 288、MCI Telecomms. Corp. v. AT&T、(SDNY 1952))、引用の中の行政機関の事件番号(NOV/CFA 01-01)も指しません(引用の略語は数には入れます)。判決の頭の MR. JUSTICE も指しません。括弧の中で略語に「or」で別の呼び名を添えたもの(Department of Health and Human Services (HHS or the Department))、ハイフンで繋いだ字まで名前と揃うもの(Agency for Health (ARPA-H))は説明したと読み、メールアドレスの中の英字(OASH-RFI@hhs.gov)は略語と読みません。文書の中に書いた ABNF の文法の規則の名前と値(CRLF、%x0D)、等級の並び(A と AA)、番号で引く官報や判例集(80 FR 66128、2022 WL 4447293)、日付の付いた識別子の前の種類(WD WD-ABC1-20200101)、PO Box の PO も指しません。文献を引いて始まる注(1. See L. Summers (2015), "…," IMF Economic Review)の中の略語は、引いた文献の題名や誌名の書き方なので指しません(数には入れます)。角括弧の見出しで始まる文献の項目([FETCH] WHATWG, …)の中の略語も同じです。2 つ以上の番号で引く続き物の名前(BCP 78 と BCP 14、DR 4339 と DR 4340)、同じ文の前のほうで名前を書き出した略語(U.S. Small Business Administration … SBA)、肩書きの後ろの判事の姓(Lord HOLT、Mr. Justice BULLER)、商標の印の付いた名前(Acrobat DC®)、条で引く法令集(44 USC. 3502、15 USCA § 709)と、編と区分で引く法令集(21 CFR subpart J)も指しません。ショートメッセージで送るキーワード(texting GNPCGS to 333111)、名前のまま書いた製品の版(Adobe Acrobat Reader DC)、頭だけ大文字の語に繋いだ名前の中の大文字(NITE SAFE-Lite)も指しません。同じ文の前のほうで、同じ名詞の前に小文字で書き出した略語(incident response plan … IR plans)と、括弧の中で小文字の語を添えた略語の名前の頭の頭文字が揃うもの(… Partnerships to Stimulate Cybersecurity Education (RAMPS program))は説明したと読みます。貼り付けたチャットの発言(<jinxer-wm> FIRING …)の中の略語は、発言した人やボットの言葉なので指しません(数には入れます)。番地から州と郵便番号まで揃った所在地の中の大文字(1600 Elm Rd. NE, MS K12-3, Springfield, GA 30329 の NE と MS)、SQL のキーワード(VIEW、WHERE)、文の中で頭だけ大文字の語にも書いた名前を大文字で書いたもの(a hotel / Airbnb と書いた文書の AIRBNB)も指しません。行の頭に大文字で書いた接続詞(OR, Skip to …、二つの選択肢の間に一行で置いた OR)も指しません。ファイルの種類の名前としてだけ書いた大文字(the MAP files、MAPファイル、拡張子の “.MAP”)も指しません。辞書が間投詞としてしか知らない 3 文字以上の語を大文字で書いたもの(製品の名前の HEY
|
|
95
|
-
en: Common acronyms (URL, PDF), acronyms spelled out in brackets next to them, and the letters of a company name (㈱ADEKA, CO.,LTD.) are not reported. Neither are a template's placeholders (OOOO, XX 月) or an acronym in the title of a page in a list of links (it still counts towards the limit). Nor are an acronym explained under another capitalisation (TCoP, then TCOP), one a sentence about the abbreviation writes out (the abbreviation DOB … date of birth), or a term in a list whose nested link names it (- GPL above GNU General Public License). Nor are the parties and courts of a case citation (Ashwander v. TVA, 297 U.S. 288; MCI Telecomms. Corp. v. AT&T; (SDNY 1952)), an agency's docket number in a citation (NOV/CFA 01-01); a citation's acronyms still count towards the limit. Nor is the MR. JUSTICE that opens a line of an opinion. An acronym given another name after "or" in its parenthesis (Department of Health and Human Services (HHS or the Department)) or spelled out with its hyphened letter (Agency for Health (ARPA-H)) counts as expanded, and the letters of an email address (OASH-RFI@hhs.gov) are not an acronym. Nor are the rule names and values of an ABNF grammar in the text (CRLF, %x0D), the rungs of a grade ladder (A and AA), a register or reporter cited by number (80 FR 66128, 2022 WL 4447293), the kind written before a dated identifier (WD WD-ABC1-20200101), or the PO of a PO Box. A note that opens with a citation (1. See L. Summers (2015), "…," IMF Economic Review) is written in the cited work's words, and its acronyms are not reported (they still count towards the limit); so is an entry of a reference list keyed by a bracketed label ([FETCH] WHATWG, …). Nor are capitals the document cites by two or more numbers (BCP 78 and BCP 14, DR 4339 and DR 4340), an acronym whose name the same sentence writes out before it (U.S. Small Business Administration … SBA), a judge's surname after his title (Lord HOLT, Mr. Justice BULLER), a name marked as a trademark (Acrobat DC®), a code cited by section (44 USC. 3502, 15 USCA § 709), or a code cited by title and division (21 CFR subpart J). Nor are a keyword to send by text message (texting GNPCGS to 333111), a product's edition written with the product's name (Adobe Acrobat Reader DC), or capitals joined to a capitalised word in a name (NITE SAFE-Lite). An acronym the same sentence writes out in lower case before the same noun (incident response plan … IR plans), and one bracketed with a word in lower case after a name whose head gives its letters (… Partnerships to Stimulate Cybersecurity Education (RAMPS program)), count as expanded. An acronym in a pasted chat line (<jinxer-wm> FIRING …) is the speaker's or the bot's words, and is not reported (it still counts towards the limit). Nor are the capitals inside a postal address that runs from a street number to a state and ZIP code (the NE and MS of 1600 Elm Rd. NE, MS K12-3, Springfield, GA 30329), a keyword of SQL (VIEW, WHERE), or a name in capitals that the document also writes inside a sentence with only its first letter a capital (AIRBNB in a text that writes a hotel / Airbnb). Nor is a conjunction written in capitals at the head of a line (OR, Skip to …; an OR alone between two options). Nor are capitals a document writes only as the name of a kind of file (the MAP files, MAPファイル, the extension “.MAP”). Nor is a word of three letters or more that the dictionary knows only as an interjection, written in capitals (HEY, a product's name).
|
|
94
|
+
ja: 誰でも知っている略語(URL、PDF など)と、前後の括弧で説明した略語、会社の名前の中の英字(㈱ADEKA、CO.,LTD.)は指しません。ひな形の名前の置き場所(OOOO、XX 月)と、外のページへのリンクを並べた一覧の題名の中の略語も指しません(題名の略語は数には入れます)。大文字の違うだけの書き方で説明した略語(TCoP と TCOP)、略語を話題にする文で語に書き出した略語(略語の DOB … date of birth)、一覧で語のすぐ下にその語を名指すリンクを入れ子にした語(- GPL の下の GNU General Public License)も指しません。判例の引用の中の当事者と裁判所の名前(Ashwander v. TVA, 297 U.S. 288、MCI Telecomms. Corp. v. AT&T、(SDNY 1952))、引用の中の行政機関の事件番号(NOV/CFA 01-01)も指しません(引用の略語は数には入れます)。判決の頭の MR. JUSTICE も指しません。括弧の中で略語に「or」で別の呼び名を添えたもの(Department of Health and Human Services (HHS or the Department))、ハイフンで繋いだ字まで名前と揃うもの(Agency for Health (ARPA-H))は説明したと読み、メールアドレスの中の英字(OASH-RFI@hhs.gov)は略語と読みません。文書の中に書いた ABNF の文法の規則の名前と値(CRLF、%x0D)、等級の並び(A と AA)、番号で引く官報や判例集(80 FR 66128、2022 WL 4447293)、日付の付いた識別子の前の種類(WD WD-ABC1-20200101)、PO Box の PO も指しません。文献を引いて始まる注(1. See L. Summers (2015), "…," IMF Economic Review)の中の略語は、引いた文献の題名や誌名の書き方なので指しません(数には入れます)。角括弧の見出しで始まる文献の項目([FETCH] WHATWG, …)の中の略語も同じです。2 つ以上の番号で引く続き物の名前(BCP 78 と BCP 14、DR 4339 と DR 4340)、同じ文の前のほうで名前を書き出した略語(U.S. Small Business Administration … SBA)、肩書きの後ろの判事の姓(Lord HOLT、Mr. Justice BULLER)、商標の印の付いた名前(Acrobat DC®)、条で引く法令集(44 USC. 3502、15 USCA § 709)と、編と区分で引く法令集(21 CFR subpart J)も指しません。ショートメッセージで送るキーワード(texting GNPCGS to 333111)、名前のまま書いた製品の版(Adobe Acrobat Reader DC)、頭だけ大文字の語に繋いだ名前の中の大文字(NITE SAFE-Lite)も指しません。同じ文の前のほうで、同じ名詞の前に小文字で書き出した略語(incident response plan … IR plans)と、括弧の中で小文字の語を添えた略語の名前の頭の頭文字が揃うもの(… Partnerships to Stimulate Cybersecurity Education (RAMPS program))は説明したと読みます。貼り付けたチャットの発言(<jinxer-wm> FIRING …)の中の略語は、発言した人やボットの言葉なので指しません(数には入れます)。番地から州と郵便番号まで揃った所在地の中の大文字(1600 Elm Rd. NE, MS K12-3, Springfield, GA 30329 の NE と MS)、SQL のキーワード(VIEW、WHERE)、文の中で頭だけ大文字の語にも書いた名前を大文字で書いたもの(a hotel / Airbnb と書いた文書の AIRBNB)も指しません。行の頭に大文字で書いた接続詞(OR, Skip to …、二つの選択肢の間に一行で置いた OR)も指しません。ファイルの種類の名前としてだけ書いた大文字(the MAP files、MAPファイル、拡張子の “.MAP”)も指しません。辞書が間投詞としてしか知らない 3 文字以上の語を大文字で書いたもの(製品の名前の HEY)も指しません。どちらも 5 文字以上の大文字の語が 2 つ並んだもの(計画の名前の MIRAI SCHOOL、UNITED STATES)は、大文字で書いた名前や語なので指しません。
|
|
95
|
+
en: Common acronyms (URL, PDF), acronyms spelled out in brackets next to them, and the letters of a company name (㈱ADEKA, CO.,LTD.) are not reported. Neither are a template's placeholders (OOOO, XX 月) or an acronym in the title of a page in a list of links (it still counts towards the limit). Nor are an acronym explained under another capitalisation (TCoP, then TCOP), one a sentence about the abbreviation writes out (the abbreviation DOB … date of birth), or a term in a list whose nested link names it (- GPL above GNU General Public License). Nor are the parties and courts of a case citation (Ashwander v. TVA, 297 U.S. 288; MCI Telecomms. Corp. v. AT&T; (SDNY 1952)), an agency's docket number in a citation (NOV/CFA 01-01); a citation's acronyms still count towards the limit. Nor is the MR. JUSTICE that opens a line of an opinion. An acronym given another name after "or" in its parenthesis (Department of Health and Human Services (HHS or the Department)) or spelled out with its hyphened letter (Agency for Health (ARPA-H)) counts as expanded, and the letters of an email address (OASH-RFI@hhs.gov) are not an acronym. Nor are the rule names and values of an ABNF grammar in the text (CRLF, %x0D), the rungs of a grade ladder (A and AA), a register or reporter cited by number (80 FR 66128, 2022 WL 4447293), the kind written before a dated identifier (WD WD-ABC1-20200101), or the PO of a PO Box. A note that opens with a citation (1. See L. Summers (2015), "…," IMF Economic Review) is written in the cited work's words, and its acronyms are not reported (they still count towards the limit); so is an entry of a reference list keyed by a bracketed label ([FETCH] WHATWG, …). Nor are capitals the document cites by two or more numbers (BCP 78 and BCP 14, DR 4339 and DR 4340), an acronym whose name the same sentence writes out before it (U.S. Small Business Administration … SBA), a judge's surname after his title (Lord HOLT, Mr. Justice BULLER), a name marked as a trademark (Acrobat DC®), a code cited by section (44 USC. 3502, 15 USCA § 709), or a code cited by title and division (21 CFR subpart J). Nor are a keyword to send by text message (texting GNPCGS to 333111), a product's edition written with the product's name (Adobe Acrobat Reader DC), or capitals joined to a capitalised word in a name (NITE SAFE-Lite). An acronym the same sentence writes out in lower case before the same noun (incident response plan … IR plans), and one bracketed with a word in lower case after a name whose head gives its letters (… Partnerships to Stimulate Cybersecurity Education (RAMPS program)), count as expanded. An acronym in a pasted chat line (<jinxer-wm> FIRING …) is the speaker's or the bot's words, and is not reported (it still counts towards the limit). Nor are the capitals inside a postal address that runs from a street number to a state and ZIP code (the NE and MS of 1600 Elm Rd. NE, MS K12-3, Springfield, GA 30329), a keyword of SQL (VIEW, WHERE), or a name in capitals that the document also writes inside a sentence with only its first letter a capital (AIRBNB in a text that writes a hotel / Airbnb). Nor is a conjunction written in capitals at the head of a line (OR, Skip to …; an OR alone between two options). Nor are capitals a document writes only as the name of a kind of file (the MAP files, MAPファイル, the extension “.MAP”). Nor is a word of three letters or more that the dictionary knows only as an interjection, written in capitals (HEY, a product's name). Nor are two words in capitals side by side, each of five letters or more (MIRAI SCHOOL, the name of a plan; UNITED STATES), which are a name or words written in capitals.
|
|
96
96
|
level_meaning:
|
|
97
97
|
ja: 説明のない略語が {limit} 種類あれば指摘。文書が自分で略語を {limit} 個展開していれば、1 つの抜けから指摘
|
|
98
98
|
en: reported once {limit} different acronyms go unexplained, or from the first one when the document itself spells out {limit} others
|
package/rules/unknown-word.yaml
CHANGED
|
@@ -47,8 +47,8 @@ example:
|
|
|
47
47
|
The report is attached to this email.
|
|
48
48
|
|
|
49
49
|
not_flagged:
|
|
50
|
-
ja: 大文字を含む語、四字より短い語、コード・URL・メールアドレスの中の語、強調や角括弧で頭の字を分けた語の残り(**G**lobally の lobally、[e]xpressions の xpressions)、文書で二度以上使う語、一字違いの辞書の語が無い語、chaff.yaml の names に並べた語、語彙表 known-misspelling が別に言う語は指しません。同じ文書がコード(`tidyq check` やコードの区画)にも書いた語も、その文書の名前なので指しません。検索の語の後に * を付けた形(vaccin*)と、それと同じ行に並べた検索の語も、語ではないので指しません。文書がほかの語尾で使う語(rightsize と rightsized)、引用符や括弧の中に一語だけ書いた語("mailto"、(jchaplin))、文書が URL にも書いた語、他の言語の語の隣の語(bête noire)、角括弧や括弧の字を続けた語(handl[e]、neuro(a)typicality)、= の前の変数の名(nboot=2,000)、四字以上の辞書の語二つを続けた語(crowdwork)、薬の国際一般名の語幹で終わる語(paroxetine の -oxetine)、版の番号の前の語(golang 1.21.5)、誌の巻と号の前の語(Biochemia medica 22 (3) の medica)、辞書に無い別の語と一字だけ違う語(pthread と bthread
|
|
51
|
-
en: Words with a capital letter, words shorter than four letters, words in code, URLs and email addresses, the rest of a word whose first letter is set apart by emphasis or brackets (lobally in **G**lobally, xpressions in [e]xpressions), words used twice or more in the document, words with no dictionary word one letter away, words listed under names in chaff.yaml, and the misspellings known-misspelling reports are not reported. Nor is a word the document also writes in code (`tidyq check`, a code block), since it is a name the document uses. Nor is a search stem ending in a wildcard (vaccin*), or any search term on the same line. Nor is a word the document uses with another ending (rightsize and rightsized), a word alone in quotes or brackets ("mailto", (jchaplin)), a word the document also writes in a URL, a word beside a word of another language (bête noire), a word joined to a bracketed letter (handl[e], neuro(a)typicality), a variable name before = (nboot=2,000), two dictionary words of four letters or more written as one (crowdwork), a word ending in the stem of a drug's international name (-oxetine in paroxetine), a word before a release number (golang 1.21.5), a word before a journal's volume and issue (medica in Biochemia medica 22 (3)),
|
|
50
|
+
ja: 大文字を含む語、四字より短い語、コード・URL・メールアドレスの中の語、強調や角括弧で頭の字を分けた語の残り(**G**lobally の lobally、[e]xpressions の xpressions)、文書で二度以上使う語、一字違いの辞書の語が無い語、chaff.yaml の names に並べた語、語彙表 known-misspelling が別に言う語は指しません。同じ文書がコード(`tidyq check` やコードの区画)にも書いた語も、その文書の名前なので指しません。検索の語の後に * を付けた形(vaccin*)と、それと同じ行に並べた検索の語も、語ではないので指しません。文書がほかの語尾で使う語(rightsize と rightsized)、引用符や括弧の中に一語だけ書いた語("mailto"、(jchaplin))、文書が URL にも書いた語、他の言語の語の隣の語(bête noire)、角括弧や括弧の字を続けた語(handl[e]、neuro(a)typicality)、= の前の変数の名(nboot=2,000)、四字以上の辞書の語二つを続けた語(crowdwork)、薬の国際一般名の語幹で終わる語(paroxetine の -oxetine)、版の番号の前の語(golang 1.21.5)、誌の巻と号の前の語(Biochemia medica 22 (3) の medica)、辞書に無い別の語と一字だけ違う語(pthread と bthread、同じ作りの名前)、辞書が -nse と書く語を -nce と書いた古い綴りやイギリスの綴り(recompence、expence)も指しません。
|
|
51
|
+
en: Words with a capital letter, words shorter than four letters, words in code, URLs and email addresses, the rest of a word whose first letter is set apart by emphasis or brackets (lobally in **G**lobally, xpressions in [e]xpressions), words used twice or more in the document, words with no dictionary word one letter away, words listed under names in chaff.yaml, and the misspellings known-misspelling reports are not reported. Nor is a word the document also writes in code (`tidyq check`, a code block), since it is a name the document uses. Nor is a search stem ending in a wildcard (vaccin*), or any search term on the same line. Nor is a word the document uses with another ending (rightsize and rightsized), a word alone in quotes or brackets ("mailto", (jchaplin)), a word the document also writes in a URL, a word beside a word of another language (bête noire), a word joined to a bracketed letter (handl[e], neuro(a)typicality), a variable name before = (nboot=2,000), two dictionary words of four letters or more written as one (crowdwork), a word ending in the stem of a drug's international name (-oxetine in paroxetine), a word before a release number (golang 1.21.5), a word before a journal's volume and issue (medica in Biochemia medica 22 (3)), a word one letter from another word of the document the dictionary does not know either (pthread and bthread, names on one scheme), or an older or British -nce spelling of a word the dictionary spells -nse (recompence, expence).
|
|
52
52
|
rewrite:
|
|
53
53
|
depth: light
|
|
54
54
|
en:
|
|
@@ -30,6 +30,8 @@ placeholders:
|
|
|
30
30
|
levels: { strict: warning, normal: info, relaxed: info }
|
|
31
31
|
|
|
32
32
|
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
33
|
+
off_for:
|
|
34
|
+
docs/glossary: "A glossary defines its terms for other documents to use: a term it never uses again is its purpose, not a leftover."
|
|
33
35
|
|
|
34
36
|
group: structure
|
|
35
37
|
summary:
|
|
@@ -48,8 +50,8 @@ example:
|
|
|
48
50
|
"Service" means the booking website we run. Users may use the Service free of charge.
|
|
49
51
|
|
|
50
52
|
not_flagged:
|
|
51
|
-
ja: 定義の書き方(「X」とは、以下「X」という、規約やポリシーの以下「X」といいます)で書いた語だけを見ます。複数形と所有の形(Services、Seller's
|
|
52
|
-
en: Only terms defined in a recognised form ("X" means, (the "X")) are checked. Plurals and possessives (Services, Seller's) count as uses, and so does the term in a heading. A phrase of a gerund and its object (Exercising your options) is also used where its verb is written in another form (exercise your options). A second definition of the same term is duplicate-definition's to report. A term defined for a unit of a code the document sits in ("For the purpose of this subchapter—") is not checked when the document has no heading for that unit, because the unit's other sections use it.
|
|
53
|
+
ja: 定義の書き方(「X」とは、以下「X」という、規約やポリシーの以下「X」といいます)で書いた語だけを見ます。複数形と所有の形(Services、Seller's)と、見出しの中の語も使用に数えます。語の間が続いた空白や改行で割れた所(Normal Business Hours)も使用です。英語の動名詞と目的語の句(Exercising your options)は、動詞のほかの形で書いた所(exercise your options)も使用に数えます。同じ語の二つ目の定義は duplicate-definition が言います。用語集は、ほかの文書が使う語を定義するので見ません。引用した意味を means の後ろに書いた所("necessary" means "needful")は、語の意味を論じた言い換えで、定義と読みません。法典の一つの条だけの文書で、自分の入っている編・章(「For the purpose of this subchapter」)のために定義した語は、文書にその編・章の見出しが無ければ見ません。その編・章のほかの条が使います。
|
|
54
|
+
en: Only terms defined in a recognised form ("X" means, (the "X")) are checked. Plurals and possessives (Services, Seller's) count as uses, and so does the term in a heading or with its words split by a run of spaces or a line break. A phrase of a gerund and its object (Exercising your options) is also used where its verb is written in another form (exercise your options). A second definition of the same term is duplicate-definition's to report. A glossary is not checked, since it defines terms for other documents. A quoted meaning after means ("necessary" means "needful") glosses a word in an argument about it and is not read as a definition. A term defined for a unit of a code the document sits in ("For the purpose of this subchapter—") is not checked when the document has no heading for that unit, because the unit's other sections use it.
|
|
53
55
|
rewrite:
|
|
54
56
|
depth: light
|
|
55
57
|
ja:
|
|
@@ -26,6 +26,12 @@ export const boldLabelOf = (item: string): string | undefined => {
|
|
|
26
26
|
return label === undefined || isCodeOnly(label) ? undefined : label;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
/** `**Label:**` opening a paragraph, with text after it or standing alone over the list it introduces. */
|
|
30
|
+
const STANDING_LABEL = new RegExp(String.raw`^(\*\*|__)(?!\s)((?:(?!\1)[^\n]){1,${MAX_LABEL_CHARS}}?)(?:\1[ \t]*[::]|[::]\1)`, "u");
|
|
31
|
+
|
|
32
|
+
/** The bold label a paragraph or item opens with, whether text follows it on the line or not. */
|
|
33
|
+
export const standingBoldLabelOf = (text: string): string | undefined => STANDING_LABEL.exec(text.replace(ITEM_MARKER, "").replace(TASK_BOX, ""))?.[2]?.trim();
|
|
34
|
+
|
|
29
35
|
/** Whether an item opens with a bold label of any kind, code-only ones included: bold that labels rather than emphasises. */
|
|
30
36
|
export const opensWithBoldLabel = (item: string): boolean => BOLD_LABEL.test(item.replace(ITEM_MARKER, "").replace(TASK_BOX, ""));
|
|
31
37
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Detector, DetectorOptions, Finding, Lexicon, ProseDocument, Sentence, Token } from "../plugin.ts";
|
|
2
2
|
import { isWithinAny, quotedIn } from "../quoted-span.ts";
|
|
3
3
|
import { definitionWordsOf, isParallelDefinition } from "./parallel-definition.ts";
|
|
4
|
+
import { continuesThrough } from "./register.ts";
|
|
5
|
+
import { beatsOf } from "./ending-refrain.ts";
|
|
4
6
|
|
|
5
7
|
// The shape of a clause read from its words: how it ends, a paired word left alone, an adverb that needs a
|
|
6
8
|
// negation, a particle used where another one belongs. Every word comes from a lexicon; this file knows parts of speech.
|
|
@@ -52,10 +54,13 @@ export const endingOf = (sentence: Sentence): string | undefined => {
|
|
|
52
54
|
|
|
53
55
|
type Ended = { readonly sentence: Sentence; readonly ending: string | undefined };
|
|
54
56
|
|
|
55
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Runs of consecutive sentences with the same ending. A sentence with no ending to compare closes a run, and so does a
|
|
59
|
+
* question run together with the next one inside a single sentence (これはリストか?順序付きか?などです。): it is not the writer's ending.
|
|
60
|
+
*/
|
|
56
61
|
export const endingRuns = (sentences: readonly Sentence[]): Ended[][] =>
|
|
57
62
|
sentences
|
|
58
|
-
.map((sentence) => ({ sentence, ending: endingOf(sentence) }))
|
|
63
|
+
.map((sentence, index) => ({ sentence, ending: continuesThrough(sentences, index) ? undefined : endingOf(sentence) }))
|
|
59
64
|
.reduce<Ended[][]>((runs, ended) => {
|
|
60
65
|
const last = runs.at(-1) ?? [];
|
|
61
66
|
const continues = ended.ending !== undefined && last[0]?.ending === ended.ending;
|
|
@@ -75,20 +80,17 @@ const runFinding = (run: readonly Ended[], limit: number): Finding => {
|
|
|
75
80
|
};
|
|
76
81
|
};
|
|
77
82
|
|
|
78
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* More than limit sentences in a row within one paragraph that end with the same words, unless they define different terms in one
|
|
85
|
+
* frame. A refrain (いい船でした。…いい船でした。) counts once.
|
|
86
|
+
*/
|
|
79
87
|
export const endingRun: Detector = (doc, options): Finding[] => {
|
|
80
88
|
const words = definitionWordsOf(options.lexicon);
|
|
81
89
|
return doc.paragraphs.flatMap((paragraph) =>
|
|
82
90
|
endingRuns(paragraph.sentences)
|
|
83
|
-
.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
!isParallelDefinition(
|
|
87
|
-
run.map(({ sentence }) => sentence),
|
|
88
|
-
words,
|
|
89
|
-
),
|
|
90
|
-
)
|
|
91
|
-
.map((run) => runFinding(run, options.limit)),
|
|
91
|
+
.map((run) => ({ run, sentences: run.map(({ sentence }) => sentence) }))
|
|
92
|
+
.filter(({ sentences }) => beatsOf(sentences, patternsOf(options.lexicon, "being")) > options.limit && !isParallelDefinition(sentences, words))
|
|
93
|
+
.map(({ run }) => runFinding(run, options.limit)),
|
|
92
94
|
);
|
|
93
95
|
};
|
|
94
96
|
|
|
@@ -4,7 +4,7 @@ import { newContentMorphemes } from "./content-morphemes.ts";
|
|
|
4
4
|
import { formValueTokens, isFormBlock } from "./form-line.ts";
|
|
5
5
|
import { trigrams } from "./heading-overlap.ts";
|
|
6
6
|
import { findingAt, writtenHeadings } from "./markup-finding.ts";
|
|
7
|
-
import type { Detector, Finding, LengthUnit, MarkupHeading, Paragraph, ProseDocument, Section } from "../plugin.ts";
|
|
7
|
+
import type { Detector, Finding, LengthUnit, MarkupHeading, Paragraph, ProseDocument, Section, Token } from "../plugin.ts";
|
|
8
8
|
|
|
9
9
|
/** A title shorter than this many character trigrams matches any lead by chance. */
|
|
10
10
|
const MIN_TITLE_GRAMS = 4;
|
|
@@ -99,6 +99,17 @@ const QUESTION_END = /[??]["'”’))」』]*$/u;
|
|
|
99
99
|
|
|
100
100
|
export const isQuestionHeading = (heading: string): boolean => QUESTION_END.test(heading.trim());
|
|
101
101
|
|
|
102
|
+
const TRAILING_MARKS: ReadonlySet<string> = new Set(["PUNCT", "SYM"]);
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A heading that ends on a particle closing a question (…補正することはできますか。): it asks as one ending in ? does. The
|
|
106
|
+
* particles come from the language's question-particle word list; a language without one has none.
|
|
107
|
+
*/
|
|
108
|
+
export const endsWithQuestionParticle = (tokens: readonly Token[], particles: ReadonlySet<string>): boolean => {
|
|
109
|
+
const last = tokens.findLast((token) => !TRAILING_MARKS.has(token.pos));
|
|
110
|
+
return last?.pos === "PART" && particles.has(last.surface);
|
|
111
|
+
};
|
|
112
|
+
|
|
102
113
|
/** A series label in brackets at a heading's end, a number and a colon opening it ("(490: Employee travel)"): the manual's reference. */
|
|
103
114
|
const SERIES_LABEL_END = /[((]\p{N}+[::][^()()]*[))]$/u;
|
|
104
115
|
const QUOTED = /「[^「」]*」/gu;
|
|
@@ -140,18 +151,18 @@ const variantOf = (heading: MarkupHeading, title: MarkupHeading | undefined): st
|
|
|
140
151
|
return heading === title ? "title" : undefined;
|
|
141
152
|
};
|
|
142
153
|
|
|
143
|
-
|
|
144
|
-
const unlabeledOf = (doc: ProseDocument, heading: MarkupHeading): string =>
|
|
145
|
-
doc.sections.find((section) => section.span.start === heading.end)?.unlabeledHeading ?? heading.text;
|
|
154
|
+
const sectionOf = (doc: ProseDocument, heading: MarkupHeading): Section | undefined => doc.sections.find((section) => section.span.start === heading.end);
|
|
146
155
|
|
|
147
156
|
/** Each title or heading longer than the limit. The first top-level heading is the title; every other is a heading. */
|
|
148
157
|
export const titleLength: Detector = (doc, options): Finding[] => {
|
|
149
158
|
const headings = writtenHeadings(doc);
|
|
150
159
|
const title = headings.find((heading) => heading.depth === 1);
|
|
151
160
|
const citedTitleActions = (doc.lexicons["cited-title-action"] ?? []).map((entry) => entry.pattern);
|
|
161
|
+
const questionParticles = new Set((doc.lexicons["question-particle"] ?? []).map((entry) => entry.pattern));
|
|
152
162
|
return headings
|
|
153
|
-
.map((heading) => ({ heading,
|
|
154
|
-
.
|
|
163
|
+
.map((heading) => ({ heading, section: sectionOf(doc, heading) }))
|
|
164
|
+
.map(({ heading, section }) => ({ heading, words: section?.unlabeledHeading ?? heading.text, tokens: section?.headingTokens ?? [] }))
|
|
165
|
+
.filter(({ words, tokens }) => !isParagraphHeading(words) && !isQuestionHeading(words) && !endsWithQuestionParticle(tokens, questionParticles))
|
|
155
166
|
.map(({ heading, words }) => ({ heading, count: headingLength(ownWordsOf(words, citedTitleActions), doc.lengthUnit) }))
|
|
156
167
|
.filter(({ count }) => count > options.limit)
|
|
157
168
|
.map(({ heading, count }) => ({
|
|
@@ -2,6 +2,7 @@ import type { Detector, Finding, Lexicon, Sentence, Span, Token } from "../plugi
|
|
|
2
2
|
import { citedNamesOf, endsCitedName } from "./cited-name.ts";
|
|
3
3
|
import { doubledAcrossAside } from "./doubled-across-aside.ts";
|
|
4
4
|
import { furiganaSpans } from "../furigana.ts";
|
|
5
|
+
import { isFlattenedTable } from "./sentence-parts.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* 語を書き損じて二度書いた(the the / 資料をを)。消し忘れと、書き換えの途中で残った語(our the platform)の二つ。
|
|
@@ -170,6 +171,9 @@ const FIXED_PHRASE = "fixed-phrase";
|
|
|
170
171
|
const inReading = (sentence: Sentence, readings: readonly Span[], doubled: Doubled): boolean =>
|
|
171
172
|
readings.some((span) => sentence.span.start + span.start <= doubled.first.span.start && doubled.second.span.end <= sentence.span.start + span.end);
|
|
172
173
|
|
|
174
|
+
/** 変換で潰れた表の文では、名詞の重なりは隣り合った二つのセル(株主資本|資本金)。付属語の重なり(をを)は書き損じのまま。 */
|
|
175
|
+
const isCellBoundary = (tableLike: boolean, doubled: Doubled): boolean => tableLike && doubled.first.pos === "NOUN" && doubled.second.pos === "NOUN";
|
|
176
|
+
|
|
173
177
|
export const doubledWord: Detector = (doc, options): Finding[] => {
|
|
174
178
|
const spaced = doc.lengthUnit === "word";
|
|
175
179
|
const allowed = options.lexicon ?? [];
|
|
@@ -179,8 +183,12 @@ export const doubledWord: Detector = (doc, options): Finding[] => {
|
|
|
179
183
|
return doc.sentences.flatMap((sentence) => {
|
|
180
184
|
// The readings are found once per sentence: once per doubled pair costs the pairs times the sentence's length.
|
|
181
185
|
const readings = furiganaSpans(sentence.text);
|
|
186
|
+
const tableLike = isFlattenedTable(sentence.text);
|
|
182
187
|
return [...doubledIn(doc.source, sentence.tokens ?? [], spaced, allowed, phrases), ...(spaced ? [] : doubledAcrossAside(doc.source, sentence.tokens ?? []))]
|
|
183
|
-
.filter(
|
|
188
|
+
.filter(
|
|
189
|
+
(doubled) =>
|
|
190
|
+
!endsCitedName(doubled.first, doubled.second, cited, kinds) && !inReading(sentence, readings, doubled) && !isCellBoundary(tableLike, doubled),
|
|
191
|
+
)
|
|
184
192
|
.map((doubled) => findingOf(sentence, doubled, spaced));
|
|
185
193
|
});
|
|
186
194
|
};
|
|
@@ -15,13 +15,27 @@ const wordsIn = (doc: ProseDocument): number => doc.sentences.reduce((sum, sente
|
|
|
15
15
|
|
|
16
16
|
const isLyAdverb = (token: Token): boolean => token.pos === "ADV" && token.surface.toLowerCase().endsWith("ly");
|
|
17
17
|
|
|
18
|
+
/** 頭だけ大文字の語。全部大文字(ONLY)は強調で、副詞のまま。 */
|
|
19
|
+
const CAPITALISED = /^\p{Lu}\p{Ll}/u;
|
|
20
|
+
|
|
21
|
+
const LETTER = /\p{L}/u;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 文の途中の頭だけ大文字の -ly の語は、解析器が語尾で副詞と当てた名前(July、Kelly)か、題の語(Frequently Asked Questions)。
|
|
25
|
+
* どちらも動詞に畳める副詞ではない。
|
|
26
|
+
*/
|
|
27
|
+
const lyAdverbsOf = (tokens: readonly Token[]): Token[] => {
|
|
28
|
+
const first = tokens.findIndex((token) => LETTER.test(token.surface));
|
|
29
|
+
return tokens.filter((token, at) => isLyAdverb(token) && !(at > first && CAPITALISED.test(token.surface)));
|
|
30
|
+
};
|
|
31
|
+
|
|
18
32
|
/**
|
|
19
33
|
* -ly 副詞は、動詞が弱いことの目印になる。「walked quickly」より「hurried」。
|
|
20
34
|
* 1 つずつは正しいので、件数ではなく密度で見る(bold-density と同じ)。
|
|
21
35
|
*/
|
|
22
36
|
export const adverbDensity: Detector = (doc, options): Finding[] => {
|
|
23
37
|
const words = wordsIn(doc);
|
|
24
|
-
const hits = doc.sentences.flatMap((sentence) => (sentence.tokens ?? []).
|
|
38
|
+
const hits = doc.sentences.flatMap((sentence) => lyAdverbsOf(sentence.tokens ?? []).map((token) => ({ sentence, token })));
|
|
25
39
|
const density = words === 0 ? 0 : Math.round((hits.length / words) * PER);
|
|
26
40
|
const first = hits[0];
|
|
27
41
|
if (words < MIN_WORDS || first === undefined || density <= options.limit) return [];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Sentence, Token } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
// A refrain: sentences in a row that end with the very same words, the word before the predicate included
|
|
4
|
+
// (いい船でした。…いい船でした。, …隊員がいます。…隊員がいます。). A speaker repeats a whole closing phrase on purpose;
|
|
5
|
+
// it is one figure, not the same ending said again and again (必要です。重要です。, Aが必要です。Bも必要です。). The predicate is a
|
|
6
|
+
// noun or an adjective with its copula, or a verb of being (verbs: いる, ある from the rule's word list); a definition said three
|
|
7
|
+
// times (…風を指します。…風を指します。) stays a run. Pure.
|
|
8
|
+
|
|
9
|
+
const TRAILING_POS: ReadonlySet<string> = new Set(["PUNCT", "SYM"]);
|
|
10
|
+
const TAIL_POS: ReadonlySet<string> = new Set(["AUX", "PART"]);
|
|
11
|
+
const CONTENT_POS: ReadonlySet<string> = new Set(["NOUN", "PROPN", "ADJ"]);
|
|
12
|
+
const VERB = "VERB";
|
|
13
|
+
|
|
14
|
+
const isSpace = (token: Token): boolean => token.surface.trim() === "";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A word that names a thing on its own: not a bound or dependent word (法 in 定額法, こと, の) and not a noun of an act (補助, 支援,
|
|
18
|
+
* 被害). A report repeats an act on purpose of record (…経費の補助を行った。…経費の補助を行った。), and that is the monotone run.
|
|
19
|
+
*/
|
|
20
|
+
const isFree = (token: Token | undefined): token is Token =>
|
|
21
|
+
token !== undefined && token.features?.["Bound"] !== "Yes" && token.features?.["NounType"] !== "Dependent" && token.features?.["VerbForm"] !== "Vnoun";
|
|
22
|
+
|
|
23
|
+
/** A noun or adjective said with its copula (船でした), or a verb of being (隊員がいます). */
|
|
24
|
+
const isPredicate = (token: Token | undefined, verbs: ReadonlySet<string>): boolean =>
|
|
25
|
+
isFree(token) && (CONTENT_POS.has(token.pos) || (token.pos === VERB && verbs.has(token.lemma ?? token.surface)));
|
|
26
|
+
|
|
27
|
+
/** Where the content word before the predicate stands: right before it, or before one particle (隊員|が|います). */
|
|
28
|
+
const argumentAt = (tokens: readonly Token[], head: number): number => {
|
|
29
|
+
const at = tokens[head - 1]?.pos === "ADP" ? head - 2 : head - 1;
|
|
30
|
+
const token = tokens[at];
|
|
31
|
+
return isFree(token) && CONTENT_POS.has(token.pos) ? at : -1;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The closing words of a sentence from the content word before its predicate: いい船でした for …いい船でした。, 隊員がいます for
|
|
36
|
+
* …隊員がいます。. A predicate after a て-form or a bound word (採用しております, こともできます, ないのです) has no such word.
|
|
37
|
+
*/
|
|
38
|
+
export const closingPhraseOf = (sentence: Sentence, verbs: ReadonlySet<string>): string | undefined => {
|
|
39
|
+
const tokens = (sentence.tokens ?? []).filter((token) => !isSpace(token));
|
|
40
|
+
const last = tokens.findLastIndex((token) => !TRAILING_POS.has(token.pos));
|
|
41
|
+
const head = tokens.slice(0, last + 1).findLastIndex((token) => !TAIL_POS.has(token.pos));
|
|
42
|
+
if (head <= 0 || head === last || !isPredicate(tokens[head], verbs)) return undefined;
|
|
43
|
+
const from = argumentAt(tokens, head);
|
|
44
|
+
if (from < 0) return undefined;
|
|
45
|
+
return tokens
|
|
46
|
+
.slice(from, last + 1)
|
|
47
|
+
.map((token) => token.surface)
|
|
48
|
+
.join("");
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** The fewest sentences that make a refrain. Two alike (…の被害もあります。…の被害もあります。) is the same ending said twice. */
|
|
52
|
+
const REFRAIN_MIN = 3;
|
|
53
|
+
|
|
54
|
+
type Block = { readonly phrase: string | undefined; readonly size: number };
|
|
55
|
+
|
|
56
|
+
const blocksOf = (phrases: readonly (string | undefined)[]): Block[] =>
|
|
57
|
+
phrases.reduce<Block[]>((blocks, phrase) => {
|
|
58
|
+
const last = blocks.at(-1);
|
|
59
|
+
return last !== undefined && phrase !== undefined && last.phrase === phrase
|
|
60
|
+
? [...blocks.slice(0, -1), { phrase, size: last.size + 1 }]
|
|
61
|
+
: [...blocks, { phrase, size: 1 }];
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
64
|
+
/** How many beats a run of sentences holds: a refrain (REFRAIN_MIN sentences or more in a row with the same closing phrase) is one. */
|
|
65
|
+
export const beatsOf = (sentences: readonly Sentence[], verbs: ReadonlySet<string>): number =>
|
|
66
|
+
blocksOf(sentences.map((sentence) => closingPhraseOf(sentence, verbs))).reduce((beats, block) => beats + (block.size >= REFRAIN_MIN ? 1 : block.size), 0);
|
|
@@ -11,6 +11,7 @@ import { partsAt, scopedFacts, type ScopedFact } from "../facts/fact-scope.ts";
|
|
|
11
11
|
import { conditionPairConflicts, type ChangeSentence, type ChangeWords, type ConditionWord, type PairConflict, type WordAt } from "../facts/condition-pairs.ts";
|
|
12
12
|
import { scopeConflicts, summaryConflicts, type FactConflict } from "../facts/fact-conflicts.ts";
|
|
13
13
|
import { eventDateConflicts, type EventDateConflict, type EventWord } from "../facts/event-dates.ts";
|
|
14
|
+
import { followsEra } from "../facts/era-year.ts";
|
|
14
15
|
import { retentionConflicts, type LengthMark, type RetentionLength, type RetentionVerb, type RetentionWords } from "../facts/retention-periods.ts";
|
|
15
16
|
import type { DurationUnit } from "../derived/date-arithmetic.ts";
|
|
16
17
|
import { DURATION_LEXICONS, quantitiesOf, type Quantity } from "./derived-numbers.ts";
|
|
@@ -187,10 +188,12 @@ const endWithLongerUnit = (doc: ProseDocument, quantity: Quantity): number => {
|
|
|
187
188
|
return unitStart + longer;
|
|
188
189
|
};
|
|
189
190
|
|
|
191
|
+
/** 元号の年(平成29年法律第51号 の 29年)は暦の年で、保存期間ではない。 */
|
|
190
192
|
const retentionLengthsOf = (doc: ProseDocument, tree: StructureNode): RetentionLength[] =>
|
|
191
193
|
quantitiesOf(tree, doc.source).flatMap((quantity) => {
|
|
192
194
|
const unit = retentionUnitOf(doc, quantity.unit);
|
|
193
|
-
|
|
195
|
+
if (unit === undefined || followsEra(doc.source, quantity.start, patternsOf(doc, "calendar-era"))) return [];
|
|
196
|
+
return [{ start: quantity.start, end: endWithLongerUnit(doc, quantity), amount: quantity.amount, unit }];
|
|
194
197
|
});
|
|
195
198
|
|
|
196
199
|
const retentionVerbsOf = (doc: ProseDocument): RetentionVerb[] =>
|
|
@@ -108,11 +108,11 @@ const OBJECT_START = new Set(["DET", "PRON", "NUM"]);
|
|
|
108
108
|
* 読み違い(the federal funds rate の rate、small business subcontracting)。窓の中に機能語があれば言い回し(your contract says)。
|
|
109
109
|
*/
|
|
110
110
|
/** 窓の最後の語が index で、その前が名詞と形容詞だけの用語(先頭の冠詞は許す)か。 */
|
|
111
|
-
const closesTerm = (tokens: readonly Token[], index: number, window: Span): boolean => {
|
|
111
|
+
const closesTerm = (tokens: readonly Token[], index: number, window: Span, minWords: number = MIN_COMPOUND_WORDS): boolean => {
|
|
112
112
|
const touched = tokens.flatMap((token, at) => (overlaps(token, window) ? [at] : []));
|
|
113
113
|
if (touched.at(-1) !== index) return false;
|
|
114
114
|
const before = touched.slice(0, -1).filter((at, order) => !(order === 0 && tokens[at]?.pos === "DET"));
|
|
115
|
-
return before.length >=
|
|
115
|
+
return before.length >= minWords && before.every((at) => COMPOUND_POS.has(tokens[at]?.pos ?? ""));
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
const endsNounCompound = (tokens: readonly Token[], index: number, window: Span, unit: LengthUnit): boolean => {
|
|
@@ -145,11 +145,22 @@ const opensNounSlot = (token: Token | undefined): boolean =>
|
|
|
145
145
|
const gerundAsNoun = (tokens: readonly Token[], index: number, unit: LengthUnit): boolean =>
|
|
146
146
|
unit === "word" && tokens[index]?.features?.["VerbForm"] === "Ger" && opensNounSlot(tokens[index - 1]);
|
|
147
147
|
|
|
148
|
+
const MODALS = new Set(["can", "could", "may", "might", "must", "shall", "should", "will", "would"]);
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 英語で、名詞の主語のすぐ後ろの助動詞 should や must で窓が終わる(the Manager should)。窓にあるのは誰がするかだけで、何をするかは
|
|
152
|
+
* 窓の外で出てくるたびに違う。手順書は手順ごとに役割を名指しし、名指しを繰り返すから誰の務めかが正確に読める。代名詞の主語(you should)は外さない。
|
|
153
|
+
*/
|
|
154
|
+
const modalAfterSubject = (tokens: readonly Token[], index: number, window: Span, unit: LengthUnit): boolean => {
|
|
155
|
+
const token = tokens[index];
|
|
156
|
+
return unit === "word" && token?.pos === "AUX" && MODALS.has(token.lemma ?? token.surface.toLowerCase()) && closesTerm(tokens, index, window, 1);
|
|
157
|
+
};
|
|
158
|
+
|
|
148
159
|
const countsAsPredicate = (tokens: readonly Token[], index: number, window: Span, unit: LengthUnit): boolean => {
|
|
149
160
|
const token = tokens[index];
|
|
150
161
|
if (token === undefined || !PREDICATE_POS.has(token.pos) || !overlaps(token, window)) return false;
|
|
151
162
|
if (modifiesNoun(tokens, index, unit) || namePartAt(tokens, index, unit) || endsNounCompound(tokens, index, window, unit)) return false;
|
|
152
|
-
if (gerundAsNoun(tokens, index, unit) || copulaAfterTerm(tokens, index, window, unit)) return false;
|
|
163
|
+
if (gerundAsNoun(tokens, index, unit) || copulaAfterTerm(tokens, index, window, unit) || modalAfterSubject(tokens, index, window, unit)) return false;
|
|
153
164
|
return !isCut(token, window) || !onlyNamesBeside(tokens, index, window, unit);
|
|
154
165
|
};
|
|
155
166
|
|