chaffjs 0.41.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/ai-score/human-shares.d.ts.map +1 -1
- package/dist/ai-score/human-shares.js +1 -0
- package/dist/ai-score/human-shares.js.map +1 -1
- package/dist/detectors/acronym-file-type.d.ts +14 -0
- package/dist/detectors/acronym-file-type.d.ts.map +1 -0
- package/dist/detectors/acronym-file-type.js +26 -0
- package/dist/detectors/acronym-file-type.js.map +1 -0
- package/dist/detectors/ai-structure.d.ts +2 -1
- package/dist/detectors/ai-structure.d.ts.map +1 -1
- package/dist/detectors/ai-structure.js +17 -6
- package/dist/detectors/ai-structure.js.map +1 -1
- package/dist/detectors/bibliography-entry.d.ts +3 -0
- package/dist/detectors/bibliography-entry.d.ts.map +1 -0
- package/dist/detectors/bibliography-entry.js +15 -0
- package/dist/detectors/bibliography-entry.js.map +1 -0
- 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/char-shape.d.ts +1 -0
- package/dist/detectors/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +13 -8
- package/dist/detectors/char-shape.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/closing-cliche.d.ts.map +1 -1
- package/dist/detectors/closing-cliche.js +2 -1
- package/dist/detectors/closing-cliche.js.map +1 -1
- package/dist/detectors/contraction-mention.d.ts +2 -0
- package/dist/detectors/contraction-mention.d.ts.map +1 -1
- package/dist/detectors/contraction-mention.js +5 -2
- package/dist/detectors/contraction-mention.js.map +1 -1
- package/dist/detectors/contraction-mix.d.ts.map +1 -1
- package/dist/detectors/contraction-mix.js +4 -3
- package/dist/detectors/contraction-mix.js.map +1 -1
- package/dist/detectors/counter-edge.d.ts +11 -0
- package/dist/detectors/counter-edge.d.ts.map +1 -1
- package/dist/detectors/counter-edge.js +29 -0
- package/dist/detectors/counter-edge.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-furniture.d.ts +1 -0
- package/dist/detectors/gram-furniture.d.ts.map +1 -1
- package/dist/detectors/gram-furniture.js +7 -0
- package/dist/detectors/gram-furniture.js.map +1 -1
- package/dist/detectors/gram-heading.d.ts +9 -0
- package/dist/detectors/gram-heading.d.ts.map +1 -0
- package/dist/detectors/gram-heading.js +20 -0
- package/dist/detectors/gram-heading.js.map +1 -0
- package/dist/detectors/gram-predicate.d.ts.map +1 -1
- package/dist/detectors/gram-predicate.js +31 -4
- package/dist/detectors/gram-predicate.js.map +1 -1
- package/dist/detectors/gram-repetition.d.ts.map +1 -1
- package/dist/detectors/gram-repetition.js +18 -3
- package/dist/detectors/gram-repetition.js.map +1 -1
- package/dist/detectors/gram-spread.d.ts +6 -0
- package/dist/detectors/gram-spread.d.ts.map +1 -0
- package/dist/detectors/gram-spread.js +18 -0
- package/dist/detectors/gram-spread.js.map +1 -0
- package/dist/detectors/kanji-run-pieces.d.ts +4 -0
- package/dist/detectors/kanji-run-pieces.d.ts.map +1 -1
- package/dist/detectors/kanji-run-pieces.js +7 -0
- package/dist/detectors/kanji-run-pieces.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/list-lead-in.d.ts +2 -2
- package/dist/detectors/list-lead-in.d.ts.map +1 -1
- package/dist/detectors/list-lead-in.js +28 -3
- package/dist/detectors/list-lead-in.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 +21 -6
- 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/rule-of-three.d.ts +5 -1
- package/dist/rule-of-three.d.ts.map +1 -1
- package/dist/rule-of-three.js +11 -2
- package/dist/rule-of-three.js.map +1 -1
- 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/structure-shape/template-outline.d.ts +7 -0
- package/dist/structure-shape/template-outline.d.ts.map +1 -1
- package/dist/structure-shape/template-outline.js +10 -0
- package/dist/structure-shape/template-outline.js.map +1 -1
- package/dist/topic-clause.d.ts.map +1 -1
- package/dist/topic-clause.js +23 -1
- package/dist/topic-clause.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/ai-structure.yaml +2 -2
- package/rules/bracket-nesting.yaml +7 -2
- package/rules/bracket-width-consistency.yaml +2 -2
- package/rules/closing-cliche.yaml +3 -3
- package/rules/colon-lead-in.yaml +3 -2
- package/rules/contraction-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/max-kanji-continuous.yaml +4 -3
- 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/rule-of-three.yaml +2 -2
- package/rules/title-length.yaml +7 -2
- package/rules/topic-predicate-distance.yaml +2 -2
- package/rules/undefined-acronym.yaml +3 -2
- package/rules/unknown-word.yaml +2 -2
- package/rules/unused-definition.yaml +4 -2
- package/src/ai-score/human-shares.ts +1 -0
- package/src/detectors/acronym-file-type.ts +33 -0
- package/src/detectors/ai-structure.ts +18 -10
- package/src/detectors/bibliography-entry.ts +18 -0
- package/src/detectors/bold-label.ts +6 -0
- package/src/detectors/char-shape.ts +12 -7
- package/src/detectors/clause-shape.ts +14 -12
- package/src/detectors/closing-cliche.ts +6 -1
- package/src/detectors/contraction-mention.ts +6 -2
- package/src/detectors/contraction-mix.ts +5 -3
- package/src/detectors/counter-edge.ts +35 -0
- 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-furniture.ts +9 -0
- package/src/detectors/gram-heading.ts +27 -0
- package/src/detectors/gram-predicate.ts +38 -4
- package/src/detectors/gram-repetition.ts +23 -2
- package/src/detectors/gram-spread.ts +19 -0
- package/src/detectors/kanji-run-pieces.ts +10 -0
- package/src/detectors/lexicon.ts +1 -0
- package/src/detectors/list-lead-in.ts +36 -3
- 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 +24 -6
- 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/rule-of-three.ts +16 -2
- package/src/structure/definition-use.ts +4 -1
- package/src/structure-shape/features.ts +18 -2
- package/src/structure-shape/template-outline.ts +12 -0
- package/src/topic-clause.ts +25 -1
- package/src/word-use.ts +10 -1
|
@@ -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/rule-of-three.yaml
CHANGED
|
@@ -122,8 +122,8 @@ example:
|
|
|
122
122
|
- No review
|
|
123
123
|
|
|
124
124
|
not_flagged:
|
|
125
|
-
ja: 箇条書きが
|
|
126
|
-
en: "Documents with
|
|
125
|
+
ja: 箇条書きが 1 つしかない文書は見ません。5 つより少なければ、1 つで割合が大きく動くので、全部が 3 項目のときだけ指摘します。本文の最初の文より前の箇条書き(題と日付のすぐ下の要点の箱)は、項目の数をサイトの型が決めているので数えません。すぐ下の行が「など」で始まる箇条書きは、書いた 3 つのほかにもあると言っているので、3 項目とは数えません。仕様書(technical/spec)のジャンルでは見ません。文の中に並べた 3 つの語(「速く、安く、確実に」)は数えません。人の文書のほうが多く書くからです。
|
|
126
|
+
en: "Documents with a single list are not checked. With fewer than five, one list moves the share a long way, so only a document whose every list has three items is reported. A list above the first sentence of the body (a box of key points under the title and date) is not counted, since the site's template sets its length. A list followed by a line opening with etc. or and so on says there are more than the three written, and is not counted as three. Specification (technical/spec) genres do not run this rule. Three words listed inside a sentence (fast, cheap and reliable) are not counted, since human documents write them more often."
|
|
127
127
|
level_meaning:
|
|
128
128
|
ja: 3 項目の箇条書きの割合 {limit}% まで
|
|
129
129
|
en: up to {limit}% of lists with exactly three items
|
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
|
|
@@ -45,8 +45,8 @@ example:
|
|
|
45
45
|
来週は、新しい担当者の紹介、先月から続く予算の見直し、春の本社移転の準備、秋の採用計画の確認、年末の懇親会の段取りを話し合います。そのため定例会議は二時間に延長します。
|
|
46
46
|
|
|
47
47
|
not_flagged:
|
|
48
|
-
ja: 主題(名詞+は)の無い文、鉤括弧で引いたものの中、上限までの距離は見ません。主題の述語が先の節で閉じる文(「この計画は簡単ではありませんが、…」「〜であって、…」、後ろの節に別の主語がある「〜ではなく、」「〜であるため、」、読点を挟まない「〜は〜で、」「〜であるならば、」「〜にあるところ、」「〜ており、」、受け身で伝える引用「〜だと言われているが」、主題と「〜ますが、」「〜ましたが、」の間に別の主語が無く、その後ろが別の主語(〜が)の節を経て新しい主題に移る文か、直後に名前の新しい主題(〜ましたが、赤澤大臣は…)が立って文末まで続く文、主題からそこまでに別の主語が無い「〜ことから、」「〜つつ、」「〜としても、」「〜こととし、」(語は語彙表 topic-clause-close
|
|
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 (〜ではありませんが, 〜であって; 〜ではなく, 〜であるため, 〜は〜で with no comma between, 〜であるならば, 〜にあるところ or 〜ており followed by a clause with its own subject; a passive report 〜だと言われているが; 〜ますが or 〜ましたが 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 〜こととし 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), the count stops at that clause's end. A later clause's subject may be a part, as in 〜のほとんどは. When a は that sets the time or the case (今夜は, 当日は, 〜ときは) is followed by another topic, the count starts from that topic. 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)、述語の後ろに丸数字の番号(③)が来て一行に詰まった箇条の次の項目が始まるところ、「〜のは」の主題が「という」で名詞に掛かる節の中で繋辞の述語を得て、その名詞句が読点で終わるところ(〜来てほしいのは日本であったという調査の結果、…))は、その節の終わりまでを数えます。後ろの節の主語には「〜のほとんどは」も数えます。時や場面を言う「は」(今夜は、当日は、〜ときは)の後ろに別の主題があれば、その主題から数えます。法令でも契約でもない文書が条文をそのまま載せた文(「第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 (〜ではありませんが, 〜であって; 〜ではなく, 〜であるため, 〜は〜で with no comma between, 〜であるならば, 〜にあるところ or 〜ており followed by a clause with its own subject; a passive report 〜だと言われているが; 〜ますが or 〜ましたが 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 〜こととし 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 〜のほとんどは. When a は that sets the time or the case (今夜は, 当日は, 〜ときは) is followed by another topic, the count starts from that topic. 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} characters between the topic and the predicate
|
|
@@ -38,6 +38,7 @@ extra_word_lists:
|
|
|
38
38
|
opening-conjunction,
|
|
39
39
|
product-name,
|
|
40
40
|
phone-label,
|
|
41
|
+
file-noun,
|
|
41
42
|
]
|
|
42
43
|
uses: [pos]
|
|
43
44
|
severity: info
|
|
@@ -90,8 +91,8 @@ example:
|
|
|
90
91
|
after: Our key goal indicator (KGI) this term is to reach product-market fit (PMF).
|
|
91
92
|
|
|
92
93
|
not_flagged:
|
|
93
|
-
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
|
|
94
|
-
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).
|
|
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.
|
|
95
96
|
level_meaning:
|
|
96
97
|
ja: 説明のない略語が {limit} 種類あれば指摘。文書が自分で略語を {limit} 個展開していれば、1 つの抜けから指摘
|
|
97
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:
|
|
@@ -76,6 +76,7 @@ export const HUMAN_SHARES: HumanShares = {
|
|
|
76
76
|
"closing-cliche": {
|
|
77
77
|
academic: { documents: 10, fired: 0 },
|
|
78
78
|
blog: { documents: 23, fired: 0 },
|
|
79
|
+
business: { documents: 11, fired: 0 },
|
|
79
80
|
docs: { documents: 21, fired: 0 },
|
|
80
81
|
legal: { documents: 35, fired: 1 },
|
|
81
82
|
literature: { documents: 13, fired: 0 },
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Capitals a document writes only as the name of a kind of file (the MAP files, each MAP file, MAPファイル): the file type,
|
|
2
|
+
// named by its extension, not an acronym the reader needs spelled out. Pure; the file nouns come from the file-noun lexicon.
|
|
3
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
4
|
+
|
|
5
|
+
/** One place an acronym stands: the text right before and after it, and the part of speech of the word after it when the language reads one. */
|
|
6
|
+
export type AcronymUse = { readonly word: string; readonly preceding: string; readonly following: string; readonly nextPos?: string | undefined };
|
|
7
|
+
|
|
8
|
+
/** The extension itself (“.MAP”): a dot that does not end a word or a number (U.S.MAP, 1.MAP). */
|
|
9
|
+
const EXTENSION_DOT = /(?:^|[^\p{L}\p{N}_.])\.$/u;
|
|
10
|
+
|
|
11
|
+
/** A file noun ends where no Latin letter or digit follows: MAPファイルを reads ファイル, the MAP filesystem does not read file. */
|
|
12
|
+
const fileNounAhead = (fileNouns: readonly string[]): RegExp =>
|
|
13
|
+
new RegExp(String.raw`^[ \t]?(?:${fileNouns.map(escapeRegExp).join("|")})(?![\p{Script=Latin}\p{N}_])`, "iu");
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The acronyms every use of which is followed by a file noun, or is the extension itself (“.MAP”). One use elsewhere (the WAL
|
|
17
|
+
* receiver beside a WAL file) shows the capitals name more than the file. At least one file noun must not be read as a verb
|
|
18
|
+
* (the SEC files a suit): the tagger misreads a few nouns (the MAP files themselves), so one noun reading is enough.
|
|
19
|
+
*/
|
|
20
|
+
export const fileTypeNames = (uses: readonly AcronymUse[], fileNouns: readonly string[]): Set<string> => {
|
|
21
|
+
if (fileNouns.length === 0) return new Set();
|
|
22
|
+
const ahead = fileNounAhead(fileNouns);
|
|
23
|
+
const isExtension = (use: AcronymUse): boolean => EXTENSION_DOT.test(use.preceding);
|
|
24
|
+
const isFileUse = (use: AcronymUse): boolean => isExtension(use) || ahead.test(use.following);
|
|
25
|
+
const isNounUse = (use: AcronymUse): boolean => isExtension(use) || use.nextPos !== "VERB";
|
|
26
|
+
const words = new Set(uses.map((use) => use.word));
|
|
27
|
+
return new Set(
|
|
28
|
+
[...words].filter((word) => {
|
|
29
|
+
const own = uses.filter((use) => use.word === word);
|
|
30
|
+
return own.every(isFileUse) && own.some(isNounUse);
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -4,35 +4,43 @@ import { STRUCTURE_TEXT } from "../outline/structure-text.ts";
|
|
|
4
4
|
import { structureOf } from "../structure-shape/of-document.ts";
|
|
5
5
|
import { headedSections } from "../structure-shape/features.ts";
|
|
6
6
|
import { headingWords } from "../structure-shape/heading-words.ts";
|
|
7
|
-
import { isTemplateOutline, templateSectionsOf } from "../structure-shape/template-outline.ts";
|
|
7
|
+
import { isTemplateOutline, isWholeTemplateOutline, templateSectionsOf } from "../structure-shape/template-outline.ts";
|
|
8
8
|
import { SAME_SHAPE } from "../ai-score/signals.ts";
|
|
9
9
|
import { SAME_SHAPE_VALUE } from "../composite-signals.ts";
|
|
10
10
|
|
|
11
11
|
/** The template outline's name in the message, beside the structure measures past the human articles. */
|
|
12
12
|
const TEMPLATE_NAME: Texts<string> = { ja: "提案書・報告書の定型の見出し", en: "the textbook proposal or report headings" };
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
/** The name of the second count a template outline gives when it is the whole outline. */
|
|
15
|
+
const WHOLE_TEMPLATE_NAME: Texts<string> = { ja: "見出しのほとんどが定型", en: "almost no heading outside that outline" };
|
|
16
|
+
|
|
17
|
+
const headingWordsOf = (doc: ProseDocument): string[] => headedSections(doc.sections).map((section) => headingWords(section.heading));
|
|
18
|
+
|
|
19
|
+
/** The template names the outline earns: one for the textbook sections, one more when they are nearly all its headings. */
|
|
20
|
+
const templateNames = (doc: ProseDocument): Array<Texts<string>> => {
|
|
21
|
+
const headings = headingWordsOf(doc);
|
|
22
|
+
const lexicon = doc.lexicons["template-heading"] ?? [];
|
|
23
|
+
if (!isTemplateOutline(templateSectionsOf(headings, lexicon))) return [];
|
|
24
|
+
return isWholeTemplateOutline(headings, lexicon) ? [TEMPLATE_NAME, WHOLE_TEMPLATE_NAME] : [TEMPLATE_NAME];
|
|
25
|
+
};
|
|
19
26
|
|
|
20
27
|
/**
|
|
21
28
|
* The document's outline is past the human articles on several structure measures at once (chaff outline's structure
|
|
22
29
|
* block): many headings, three-way splits, bold labels, uniform sections. One alone is ordinary; the limit is how many.
|
|
23
|
-
* A textbook outline (Summary, Current Situation, Proposed Solution, Expected Benefits…) counts as one more
|
|
30
|
+
* A textbook outline (Summary, Current Situation, Proposed Solution, Expected Benefits…) counts as one more, and as one
|
|
31
|
+
* more again when it is nearly the whole outline; even then it needs a measure past the human articles to reach the limit.
|
|
24
32
|
*/
|
|
25
33
|
export const aiStructure: Detector = (doc, options): Finding[] => {
|
|
26
34
|
const scored = structureOf(doc);
|
|
27
|
-
const template =
|
|
28
|
-
const count = scored.score +
|
|
35
|
+
const template = templateNames(doc);
|
|
36
|
+
const count = scored.score + template.length;
|
|
29
37
|
if (count < options.limit) return [];
|
|
30
38
|
const language = uiLanguageOf(doc.language);
|
|
31
39
|
const text = STRUCTURE_TEXT[language];
|
|
32
40
|
const beyond = scored.placements.filter((placement) => placement.beyond).map((placement) => placement.feature.id);
|
|
33
41
|
const measures = beyond.map((id) => text.features[id].name);
|
|
34
42
|
const sameShape = beyond.flatMap((id) => SAME_SHAPE[id] ?? []);
|
|
35
|
-
const names =
|
|
43
|
+
const names = [...measures, ...template.map((name) => name[language])];
|
|
36
44
|
const heading = (doc.markup?.headings ?? []).find((entry) => entry.depth > 1) ?? doc.markup?.headings[0];
|
|
37
45
|
return [
|
|
38
46
|
{
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// A bibliographic entry written as a line of a note, as Japanese papers print them (SIST 02): fields closed by a period,
|
|
2
|
+
// "著者. 題. 出版者, 2025, p. 369." The words of the entry are the cited work's, not the writer's. Pure.
|
|
3
|
+
|
|
4
|
+
/** A period that closes a field: a full-width one, or an ASCII one after a letter that is not ASCII, a closing quote or bracket, followed by a space. */
|
|
5
|
+
const FIELD_END = /.(?=\S)|(?<=\P{ASCII})\.(?=\s)/gu;
|
|
6
|
+
|
|
7
|
+
/** What a reference carries and a sentence of prose does not: a year, a quoted title in “”, a link, or a page. */
|
|
8
|
+
const PUBLICATION_MARKS: readonly RegExp[] = [/(?<!\d)(?:1[89]|20)\d{2}(?!\d)/u, /“[^”]/u, /https?:\/\//u, /\bpp?\. ?\d/u];
|
|
9
|
+
|
|
10
|
+
/** Fields closed before the end of the text that it takes to be an entry and not one sentence: author, title, then the rest. */
|
|
11
|
+
const MIN_FIELD_ENDS = 2;
|
|
12
|
+
|
|
13
|
+
/** Whether the text is a bibliographic entry: two fields or more closed by a period inside it, and a mark only a reference carries. */
|
|
14
|
+
export const isBibliographyEntry = (text: string): boolean => {
|
|
15
|
+
const body = text.trim();
|
|
16
|
+
const fieldEnds = [...body.matchAll(FIELD_END)].filter((match) => match.index + match[0].length < body.length);
|
|
17
|
+
return fieldEnds.length >= MIN_FIELD_ENDS && PUBLICATION_MARKS.some((mark) => mark.test(body));
|
|
18
|
+
};
|
|
@@ -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,6 @@
|
|
|
1
1
|
import type { Detector, DetectorOptions, DocumentProfile, Finding, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
2
2
|
import { compacted } from "./gram-place.ts";
|
|
3
|
-
import { leadingCounter, trailingPrefix } from "./counter-edge.ts";
|
|
3
|
+
import { leadingCounter, trailingOrdinals, trailingPrefix } from "./counter-edge.ts";
|
|
4
4
|
import { trailingAddressee, type AddresseeSuffix } from "./addressee-edge.ts";
|
|
5
5
|
import { leadingPrefix, trailingTitle, type AddresseeWords } from "./addressee-title-edge.ts";
|
|
6
6
|
import {
|
|
@@ -26,7 +26,8 @@ import { maskSpans } from "../mask.ts";
|
|
|
26
26
|
import { quotedSpans } from "../quoted-span.ts";
|
|
27
27
|
import { nameSpans } from "../team-names.ts";
|
|
28
28
|
import { isIn } from "../lexicon-genres.ts";
|
|
29
|
-
import { isTitledPerson, standaloneNames, unknownPieces } from "./kanji-run-pieces.ts";
|
|
29
|
+
import { holdsKnown, isInnerSuffix, isTitledPerson, standaloneNames, unknownPieces } from "./kanji-run-pieces.ts";
|
|
30
|
+
import { isBibliographyEntry } from "./bibliography-entry.ts";
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* 文字の並びを見る検出。漢字の連なりが住所か名前かだけは、形態素解析の固有名詞と数で決める。
|
|
@@ -207,12 +208,13 @@ const isAddresseeLine = (run: KanjiRun, words: NameWords): boolean => {
|
|
|
207
208
|
/** 宛名の行か、名前の並びの 1 項目。どちらも役職を付けた名前を 1 つずつ並べたもので、尻の役職は名前の外。 */
|
|
208
209
|
const isNamedEntry = (run: KanjiRun, words: NameWords): boolean => run.listItem || isAddresseeLine(run, words);
|
|
209
210
|
|
|
210
|
-
/** 尻の外す語:
|
|
211
|
+
/** 尻の外す語: 数に付く接頭の語か条や項の番号か宛先に付く語と、宛名の行ならその前の役職(日本博物館協会会長殿の「会長殿」)。 */
|
|
211
212
|
const tailOf = (tokens: readonly Token[], run: KanjiRun, span: Span, words: NameWords): Tail | undefined => {
|
|
212
213
|
const prefix = trailingPrefix(tokens, span.end, run.text);
|
|
213
214
|
const suffix =
|
|
214
215
|
prefix === undefined
|
|
215
|
-
? (
|
|
216
|
+
? (trailingOrdinals(tokens, span, run.text) ??
|
|
217
|
+
trailingConjunction(tokens, span.start, span.end, run.text) ??
|
|
216
218
|
trailingAddressee(tokens, span.end, run.text, words.addressee) ??
|
|
217
219
|
trailingAddressee(tokens, span.end, run.text, words.listSuffixes))
|
|
218
220
|
: { surface: prefix.surface, start: prefix.span.start };
|
|
@@ -270,16 +272,18 @@ const surfaceWithin = (token: Token, span: Span): string =>
|
|
|
270
272
|
* 連なりの、知っている語(文書がほかで単独で使う組織の名前と法令の名前、連なりを閉じる決まった語、職名の前後の人の名前)を外した残りのうち、最も長いもの。
|
|
271
273
|
* 安全保障理事会常任理事国は(安全保障理事会を単独で使う文書なら)「常任理事国」、日本国内閣総理大臣は「日本国」を数える。
|
|
272
274
|
* 名前に普通の語が続く連なり(日本弁護士連合会臨時総会決議)は、名前がその文書で単独で使われていなければ、まるごと数える。
|
|
275
|
+
* 連なりの中ほどの、並べた物の後ろに付く語(高齢運転者等専用駐車区間の「等」)は、語の終わりを見せるので、その前後を別に数える。
|
|
273
276
|
*/
|
|
274
277
|
const longestUnknown = (tokens: readonly Token[], rest: Span, keptHead: string, context: RunContext): string => {
|
|
275
278
|
const runTokens = coveringOf(tokens, rest).flatMap((index) => tokens.slice(index, index + 1));
|
|
276
279
|
const words = runTokens.map((token) => surfaceWithin(token, rest));
|
|
277
280
|
const whole = words.join("");
|
|
278
281
|
// A run as long as the text holds no known word; reading it word by word would take a pass per word.
|
|
279
|
-
if (![...context.terms, ...context.words.knownWords]
|
|
282
|
+
if (!holdsKnown(words, [...context.terms, ...context.words.knownWords], context.words.listSuffixes)) return keptHead + whole;
|
|
280
283
|
const isKnown = (start: number, end: number): boolean => {
|
|
281
284
|
const piece = words.slice(start, end).join("");
|
|
282
285
|
return (
|
|
286
|
+
(end === start + 1 && isInnerSuffix(words, start, context.words.listSuffixes)) ||
|
|
283
287
|
context.terms.has(piece) ||
|
|
284
288
|
(end === words.length && context.words.knownWords.has(piece)) ||
|
|
285
289
|
isTitledPerson(runTokens, words, { start, end }, context.words.knownWords, context.maxKnownWords)
|
|
@@ -346,7 +350,7 @@ const nameWordsOf = (doc: ProseDocument): NameWords => {
|
|
|
346
350
|
closingForms: (doc.lexicons["organisation-form"] ?? []).filter((entry) => entry.position !== "before").map((entry) => entry.pattern),
|
|
347
351
|
units: patterns("organisation-unit"),
|
|
348
352
|
};
|
|
349
|
-
|
|
353
|
+
return {
|
|
350
354
|
topUnits: new Set(patterns("prefecture-unit")),
|
|
351
355
|
organisation,
|
|
352
356
|
title: { endings: patterns("title-ending") },
|
|
@@ -358,7 +362,6 @@ const nameWordsOf = (doc: ProseDocument): NameWords => {
|
|
|
358
362
|
listSuffixes: patterns("list-suffix"),
|
|
359
363
|
knownWords: new Set(patterns("kanji-known-word")),
|
|
360
364
|
};
|
|
361
|
-
return words;
|
|
362
365
|
};
|
|
363
366
|
|
|
364
367
|
const contextOf = (doc: ProseDocument, options: DetectorOptions): RunContext => {
|
|
@@ -385,10 +388,12 @@ const contextOf = (doc: ProseDocument, options: DetectorOptions): RunContext =>
|
|
|
385
388
|
/**
|
|
386
389
|
* 漢字が続くと、どこで語が切れるのか読み手が探すことになる。
|
|
387
390
|
* 「情報処理推進機構認定試験」は 12 字。ひらがなを 1 つ挟むだけで読める。
|
|
391
|
+
* 文献の記述(著者. 題. 出版者, 2025.)の連なりは、引いた文献の題や名前で、書き手が割れないので数えない。
|
|
388
392
|
*/
|
|
389
393
|
export const kanjiRun: Detector = (doc, options): Finding[] => {
|
|
390
394
|
const context = contextOf(doc, options);
|
|
391
395
|
return doc.sentences
|
|
396
|
+
.filter((sentence) => !isBibliographyEntry(sentence.text))
|
|
392
397
|
.map((sentence) => ({ sentence, run: longestKanji(sentence, context) }))
|
|
393
398
|
.filter(({ run }) => run.length > options.limit)
|
|
394
399
|
.map(({ sentence, run }) => ({
|
|
@@ -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
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Detector, Finding, LexiconEntry, Paragraph, Sentence } from "../plugin.ts";
|
|
2
2
|
import { closingSentences } from "../closing-paragraph.ts";
|
|
3
|
+
import { entriesForGenre } from "../lexicon-genres.ts";
|
|
3
4
|
import { exhortationIn, exhortationWords } from "./closing-exhortation.ts";
|
|
4
5
|
import { comparableText, entryIn, entryOpens } from "./lexicon-match.ts";
|
|
5
6
|
|
|
@@ -61,7 +62,11 @@ export const closingClicheWords = (lexicon: readonly LexiconEntry[]): Words => (
|
|
|
61
62
|
|
|
62
63
|
/** 結び(最後の節の終わりの段落)の定型の言い回し。limit は指摘に要る文の数。 */
|
|
63
64
|
export const closingCliche: Detector = (doc, options): Finding[] => {
|
|
64
|
-
const hits = closingClicheHits(
|
|
65
|
+
const hits = closingClicheHits(
|
|
66
|
+
closingSentences(doc.sections, doc.paragraphs),
|
|
67
|
+
doc.paragraphs,
|
|
68
|
+
closingClicheWords(entriesForGenre(options.lexicon ?? [], options.genre)),
|
|
69
|
+
);
|
|
65
70
|
if (hits.length < options.limit) return [];
|
|
66
71
|
return hits.map((hit) => ({
|
|
67
72
|
rule: "",
|
|
@@ -4,8 +4,9 @@ import type { Span } from "../plugin.ts";
|
|
|
4
4
|
|
|
5
5
|
// A short phrase in quotation marks ("Do Not Disturb", ‘we’re going to x’) is a name or an example: the form is mentioned,
|
|
6
6
|
// not used, so it says nothing about the document's register. Spoken words carry punctuation ("We don't know," she
|
|
7
|
-
// said)
|
|
8
|
-
// someone else's wording twice over.
|
|
7
|
+
// said) are counted, unless they are quoted inside another quotation (a platform's label in a quoted sentence), which is
|
|
8
|
+
// someone else's wording twice over. No form inside quotation marks is pointed at: the writer cannot change a quotation.
|
|
9
|
+
// The text must already have straight apostrophes, so a ’ left in it closes a quotation.
|
|
9
10
|
|
|
10
11
|
const MENTION_MARKS: Readonly<Record<string, string>> = { "“": "”", '"': '"', "‘": "’" };
|
|
11
12
|
/** More words than this in quotation marks is a quoted sentence, not a phrase named as an example. */
|
|
@@ -36,6 +37,9 @@ export const withoutMentions = (text: string): string => {
|
|
|
36
37
|
);
|
|
37
38
|
};
|
|
38
39
|
|
|
40
|
+
/** The text with everything in quotation marks blanked out. */
|
|
41
|
+
export const withoutQuotations = (text: string): string => blankSpans(text, quotedSpans(text, MENTION_MARKS));
|
|
42
|
+
|
|
39
43
|
/**
|
|
40
44
|
* The text (which starts at offset in the document) with the document ranges that fall in it blanked out.
|
|
41
45
|
* Ranges are in document coordinates; those outside the text change nothing.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pairMinority, type PairUses } from "./contraction-minority.ts";
|
|
2
|
-
import { blankRanges, isTermList, withoutMentions } from "./contraction-mention.ts";
|
|
2
|
+
import { blankRanges, isTermList, withoutMentions, withoutQuotations } from "./contraction-mention.ts";
|
|
3
3
|
import { stressedWords } from "./contraction-emphasis.ts";
|
|
4
4
|
import { noticeSentences, talksAboutContractions, warningSentences } from "./contraction-set-apart.ts";
|
|
5
5
|
import { escapeRegExp, straightApostrophes } from "../orthography.ts";
|
|
@@ -36,9 +36,11 @@ const comparableText = (text: string): string => {
|
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* 指してよい字。一語だけ強調した形(does **not**)は強勢のために選んだ形なので指さない。
|
|
39
|
-
*
|
|
39
|
+
* 引用符の中の形(引いた標語、回答の文言、人の言葉)は書き手が変えられないので指さない。
|
|
40
|
+
* どちらも、どちらが多いかを数えるときは数える。
|
|
40
41
|
*/
|
|
41
|
-
const pointableText = (sentence: Sentence, stressed: readonly Span[]): string =>
|
|
42
|
+
const pointableText = (sentence: Sentence, stressed: readonly Span[]): string =>
|
|
43
|
+
comparableText(withoutQuotations(straightApostrophes(blankRanges(sentence.text, sentence.span.start, stressed))));
|
|
42
44
|
|
|
43
45
|
/** 語のすぐ後ろが句読点か文の終わり。名前として挙げた語("Use cannot, instead of can't.")はそう並ぶ。 */
|
|
44
46
|
const bareUses = (text: string, word: string): number => [...text.matchAll(new RegExp(`\\b${escapeRegExp(word)}\\b(?=\\s*(?:\\p{P}|$))`, "gu"))].length;
|