chaffjs 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/detectors/bare-comparative.d.ts +26 -0
  2. package/dist/detectors/bare-comparative.d.ts.map +1 -0
  3. package/dist/detectors/bare-comparative.js +117 -0
  4. package/dist/detectors/bare-comparative.js.map +1 -0
  5. package/dist/detectors/chat-citation.d.ts +6 -0
  6. package/dist/detectors/chat-citation.d.ts.map +1 -1
  7. package/dist/detectors/chat-citation.js +26 -1
  8. package/dist/detectors/chat-citation.js.map +1 -1
  9. package/dist/detectors/clause-shape.d.ts.map +1 -1
  10. package/dist/detectors/clause-shape.js +19 -5
  11. package/dist/detectors/clause-shape.js.map +1 -1
  12. package/dist/detectors/connective-hierarchy.d.ts +16 -0
  13. package/dist/detectors/connective-hierarchy.d.ts.map +1 -0
  14. package/dist/detectors/connective-hierarchy.js +68 -0
  15. package/dist/detectors/connective-hierarchy.js.map +1 -0
  16. package/dist/detectors/definition-use.d.ts.map +1 -1
  17. package/dist/detectors/definition-use.js +4 -2
  18. package/dist/detectors/definition-use.js.map +1 -1
  19. package/dist/detectors/generic-heading.d.ts +8 -0
  20. package/dist/detectors/generic-heading.d.ts.map +1 -0
  21. package/dist/detectors/generic-heading.js +26 -0
  22. package/dist/detectors/generic-heading.js.map +1 -0
  23. package/dist/detectors/ime-residue.d.ts +13 -0
  24. package/dist/detectors/ime-residue.d.ts.map +1 -0
  25. package/dist/detectors/ime-residue.js +27 -0
  26. package/dist/detectors/ime-residue.js.map +1 -0
  27. package/dist/detectors/lexicon.d.ts.map +1 -1
  28. package/dist/detectors/lexicon.js +9 -2
  29. package/dist/detectors/lexicon.js.map +1 -1
  30. package/dist/detectors/lookalike-character.d.ts +18 -0
  31. package/dist/detectors/lookalike-character.d.ts.map +1 -0
  32. package/dist/detectors/lookalike-character.js +50 -0
  33. package/dist/detectors/lookalike-character.js.map +1 -0
  34. package/dist/detectors/lowercase-name.d.ts +9 -0
  35. package/dist/detectors/lowercase-name.d.ts.map +1 -0
  36. package/dist/detectors/lowercase-name.js +40 -0
  37. package/dist/detectors/lowercase-name.js.map +1 -0
  38. package/dist/detectors/missing-final-period.d.ts +17 -0
  39. package/dist/detectors/missing-final-period.d.ts.map +1 -0
  40. package/dist/detectors/missing-final-period.js +62 -0
  41. package/dist/detectors/missing-final-period.js.map +1 -0
  42. package/dist/detectors/missing-space-after-comma.d.ts +10 -0
  43. package/dist/detectors/missing-space-after-comma.d.ts.map +1 -0
  44. package/dist/detectors/missing-space-after-comma.js +42 -0
  45. package/dist/detectors/missing-space-after-comma.js.map +1 -0
  46. package/dist/detectors/registry/bare-comparative.d.ts +3 -0
  47. package/dist/detectors/registry/bare-comparative.d.ts.map +1 -0
  48. package/dist/detectors/registry/bare-comparative.js +3 -0
  49. package/dist/detectors/registry/bare-comparative.js.map +1 -0
  50. package/dist/detectors/registry/calendar-name-case.d.ts +3 -0
  51. package/dist/detectors/registry/calendar-name-case.d.ts.map +1 -0
  52. package/dist/detectors/registry/calendar-name-case.js +3 -0
  53. package/dist/detectors/registry/calendar-name-case.js.map +1 -0
  54. package/dist/detectors/registry/connective-hierarchy.d.ts +3 -0
  55. package/dist/detectors/registry/connective-hierarchy.d.ts.map +1 -0
  56. package/dist/detectors/registry/connective-hierarchy.js +3 -0
  57. package/dist/detectors/registry/connective-hierarchy.js.map +1 -0
  58. package/dist/detectors/registry/generic-heading.d.ts +3 -0
  59. package/dist/detectors/registry/generic-heading.d.ts.map +1 -0
  60. package/dist/detectors/registry/generic-heading.js +3 -0
  61. package/dist/detectors/registry/generic-heading.js.map +1 -0
  62. package/dist/detectors/registry/ime-residue.d.ts +3 -0
  63. package/dist/detectors/registry/ime-residue.d.ts.map +1 -0
  64. package/dist/detectors/registry/ime-residue.js +3 -0
  65. package/dist/detectors/registry/ime-residue.js.map +1 -0
  66. package/dist/detectors/registry/lookalike-character.d.ts +3 -0
  67. package/dist/detectors/registry/lookalike-character.d.ts.map +1 -0
  68. package/dist/detectors/registry/lookalike-character.js +3 -0
  69. package/dist/detectors/registry/lookalike-character.js.map +1 -0
  70. package/dist/detectors/registry/missing-final-period.d.ts +3 -0
  71. package/dist/detectors/registry/missing-final-period.d.ts.map +1 -0
  72. package/dist/detectors/registry/missing-final-period.js +3 -0
  73. package/dist/detectors/registry/missing-final-period.js.map +1 -0
  74. package/dist/detectors/registry/missing-space-after-comma.d.ts +3 -0
  75. package/dist/detectors/registry/missing-space-after-comma.d.ts.map +1 -0
  76. package/dist/detectors/registry/missing-space-after-comma.js +3 -0
  77. package/dist/detectors/registry/missing-space-after-comma.js.map +1 -0
  78. package/dist/detectors/registry/unit-spacing-consistency.d.ts +3 -0
  79. package/dist/detectors/registry/unit-spacing-consistency.d.ts.map +1 -0
  80. package/dist/detectors/registry/unit-spacing-consistency.js +3 -0
  81. package/dist/detectors/registry/unit-spacing-consistency.js.map +1 -0
  82. package/dist/detectors/signals.d.ts.map +1 -1
  83. package/dist/detectors/signals.js +8 -4
  84. package/dist/detectors/signals.js.map +1 -1
  85. package/dist/detectors/structure-tree.d.ts.map +1 -1
  86. package/dist/detectors/structure-tree.js +32 -7
  87. package/dist/detectors/structure-tree.js.map +1 -1
  88. package/dist/detectors/technical-docs.d.ts.map +1 -1
  89. package/dist/detectors/technical-docs.js +14 -0
  90. package/dist/detectors/technical-docs.js.map +1 -1
  91. package/dist/detectors/unit-spacing.d.ts +25 -0
  92. package/dist/detectors/unit-spacing.d.ts.map +1 -0
  93. package/dist/detectors/unit-spacing.js +50 -0
  94. package/dist/detectors/unit-spacing.js.map +1 -0
  95. package/dist/quoted-span.d.ts +7 -0
  96. package/dist/quoted-span.d.ts.map +1 -1
  97. package/dist/quoted-span.js +20 -0
  98. package/dist/quoted-span.js.map +1 -1
  99. package/dist/structure/definition-use.d.ts +14 -4
  100. package/dist/structure/definition-use.d.ts.map +1 -1
  101. package/dist/structure/definition-use.js +29 -9
  102. package/dist/structure/definition-use.js.map +1 -1
  103. package/package.json +3 -3
  104. package/rules/calendar-name-case.yaml +55 -0
  105. package/rules/comparative-without-baseline.yaml +71 -0
  106. package/rules/connective-hierarchy.yaml +62 -0
  107. package/rules/cross-doc-broken-link.yaml +1 -1
  108. package/rules/cross-doc-duplicate-definition.yaml +1 -1
  109. package/rules/cross-doc-fact-conflict.yaml +1 -1
  110. package/rules/cross-doc-term-variant.yaml +5 -3
  111. package/rules/ime-residue.yaml +55 -0
  112. package/rules/lookalike-character.yaml +82 -0
  113. package/rules/missing-final-period.yaml +76 -0
  114. package/rules/missing-space-after-comma.yaml +57 -0
  115. package/rules/numbered-generic-heading.yaml +111 -0
  116. package/rules/undefined-acronym.yaml +1 -0
  117. package/rules/unit-spacing-consistency.yaml +74 -0
  118. package/skills/chaff/SKILL.md +20 -3
  119. package/src/detectors/bare-comparative.ts +152 -0
  120. package/src/detectors/chat-citation.ts +28 -1
  121. package/src/detectors/clause-shape.ts +20 -6
  122. package/src/detectors/connective-hierarchy.ts +99 -0
  123. package/src/detectors/definition-use.ts +13 -3
  124. package/src/detectors/generic-heading.ts +30 -0
  125. package/src/detectors/ime-residue.ts +37 -0
  126. package/src/detectors/lexicon.ts +11 -2
  127. package/src/detectors/lookalike-character.ts +75 -0
  128. package/src/detectors/lowercase-name.ts +58 -0
  129. package/src/detectors/missing-final-period.ts +79 -0
  130. package/src/detectors/missing-space-after-comma.ts +54 -0
  131. package/src/detectors/registry/bare-comparative.ts +4 -0
  132. package/src/detectors/registry/calendar-name-case.ts +4 -0
  133. package/src/detectors/registry/connective-hierarchy.ts +4 -0
  134. package/src/detectors/registry/generic-heading.ts +4 -0
  135. package/src/detectors/registry/ime-residue.ts +4 -0
  136. package/src/detectors/registry/lookalike-character.ts +4 -0
  137. package/src/detectors/registry/missing-final-period.ts +4 -0
  138. package/src/detectors/registry/missing-space-after-comma.ts +4 -0
  139. package/src/detectors/registry/unit-spacing-consistency.ts +4 -0
  140. package/src/detectors/signals.ts +9 -5
  141. package/src/detectors/structure-tree.ts +55 -30
  142. package/src/detectors/technical-docs.ts +13 -0
  143. package/src/detectors/unit-spacing.ts +71 -0
  144. package/src/quoted-span.ts +25 -0
  145. package/src/structure/definition-use.ts +42 -10
@@ -1,5 +1,6 @@
1
1
  import { escapeRegExp } from "../orthography.js";
2
2
  import { inDocumentOrder } from "./issues.js";
3
+ const NEVER_MENTIONED = () => false;
3
4
  /** 強調の印("**Agreement**")は語の一部ではない。 */
4
5
  const EMPHASIS_MARKS = /[*_]+/gu;
5
6
  /** 語の長さの上限。これより長い引用(表の見出し、文)は、定義した語ではない。 */
@@ -15,7 +16,8 @@ export const definedTerms = (tree) => inDocumentOrder(tree).flatMap((node) => {
15
16
  .replaceAll(EMPHASIS_MARKS, "")
16
17
  .trim()
17
18
  : "";
18
- return isTerm(term) ? [{ term, span: node.span, line: node.line, inline: node.attrs["placement"] === "inline" }] : [];
19
+ const bare = node.attrs["form"] === "bare" ? { bare: true } : {};
20
+ return isTerm(term) ? [{ term, span: node.span, line: node.line, inline: node.attrs["placement"] === "inline", ...bare }] : [];
19
21
  });
20
22
  const LATIN_EDGE = /^[\p{Script=Latin}\p{N}]|[\p{Script=Latin}\p{N}]$/u;
21
23
  /** 一字の漢字の語(「法」「甲」)は、漢字の後ろに続く所(方法、法律の前の「方」)では別の語の一部。 */
@@ -36,10 +38,16 @@ const termPattern = (term, caseMatch) => {
36
38
  return new RegExp(String.raw `(?<![\p{Script=Latin}\p{N}])${head}${rest}(?:e?s|['’]s?)?(?![\p{Script=Latin}\p{N}])`, "gu");
37
39
  };
38
40
  const inside = (offset, spans) => spans.some((span) => span.start <= offset && offset < span.end);
39
- /** 語の現れ(文書の中の位置)を順に。定義そのもの("Seller" means、(the "Seller"))の中の現れは使用に数えない。 */
40
- export const usesOf = (term, texts, definitionSpans, caseMatch = "loose") => {
41
+ /**
42
+ * 語の現れ(文書の中の位置)を順に。定義そのもの("Seller" means、(the "Seller"))の中の現れは使用に数えない。
43
+ * mentioned が言う現れ(引用符で例として挙げただけ)も数えない。
44
+ */
45
+ export const usesOf = (term, texts, definitionSpans, caseMatch = "loose", mentioned = NEVER_MENTIONED) => {
41
46
  const pattern = termPattern(term, caseMatch);
42
- return texts.flatMap((body) => [...body.text.matchAll(pattern)].map((match) => body.start + match.index).filter((offset) => !inside(offset, definitionSpans)));
47
+ return texts.flatMap((body) => [...body.text.matchAll(pattern)]
48
+ .filter((match) => !mentioned(body.start + match.index, body.start + match.index + match[0].length))
49
+ .map((match) => body.start + match.index)
50
+ .filter((offset) => !inside(offset, definitionSpans)));
43
51
  };
44
52
  /** 語ごとに、最初の定義と、その語のすべての定義の範囲。定義が何千あっても語の数だけ回る。 */
45
53
  const groupsOf = (terms) => {
@@ -54,9 +62,18 @@ const groupsOf = (terms) => {
54
62
  return [...groups.values()];
55
63
  };
56
64
  /** 定義したのに、定義の外で一度も使っていない語。同じ語の定義が二つあれば、最初の一つだけを言う(二つ目は duplicate-definition)。 */
57
- export const unusedDefinitions = (terms, texts) => groupsOf(terms)
58
- .filter((group) => usesOf(group.first.term, texts, group.spans).length === 0)
59
- .map((group) => group.first);
65
+ export const unusedDefinitions = (terms, texts, mentioned = NEVER_MENTIONED) => {
66
+ const groups = groupsOf(terms);
67
+ const examples = quotesExamples(groups, texts, mentioned);
68
+ return groups
69
+ .filter((group) => !(examples && group.first.bare === true) && usesOf(group.first.term, texts, group.spans).length === 0)
70
+ .map((group) => group.first);
71
+ };
72
+ /**
73
+ * 定義の語の無い括弧の引用(("Seller"))を、文書が一つも本文で使っていなければ、それは定義ではなく例の引用
74
+ * (Plain verbs, not metaphors ("silently fails"))。引用符で挙げただけの現れは使用に数えない。
75
+ */
76
+ const quotesExamples = (groups, texts, mentioned) => !groups.some((group) => group.first.bare === true && usesOf(group.first.term, texts, group.spans, "loose", mentioned).length > 0);
60
77
  /** offset を含む文。texts は start の昇順で、二分探索で引く。 */
61
78
  const sentenceAt = (texts, offset) => {
62
79
  let low = 0;
@@ -90,12 +107,15 @@ const isDistinctive = (term) => CAPITAL_OR_NON_LATIN.test(term) && !SINGLE_KANJI
90
107
  * 文の途中で括弧に入れて定義した語((the "Seller")、以下「甲」という)を、その定義の文より前で使っている所。最初の一つだけ。
91
108
  * 定義の文の中の現れ(株式会社GovTech東京(以下「GovTech東京」という。))は、定義する名前そのものなので数えない。札の文も数えない。
92
109
  * 定義の条("Seller" means、「甲」とは)は条の並びの頭にも終わりにも置く書き方があるので、前で使っても言わない。
110
+ * 定義の語の無い括弧の引用(("The key point is"))は例の引用と同じ形なので、その語を引用符で挙げただけの現れ
111
+ * (Its sentences open with "The key point is")は使用ではない。定義の語のある定義((the "Seller")、以下「買主」という)は、
112
+ * 引用符に入れた現れ(The "Seller" ships)も使用。
93
113
  */
94
- export const usesBeforeDefinition = (terms, texts) => groupsOf(terms)
114
+ export const usesBeforeDefinition = (terms, texts, mentioned = NEVER_MENTIONED) => groupsOf(terms)
95
115
  .filter((group) => group.first.inline && isDistinctive(group.first.term))
96
116
  .flatMap(({ first: defined, spans }) => {
97
117
  const defining = sentenceAt(texts, defined.span.start)?.start ?? defined.span.start;
98
- const uses = usesOf(defined.term, texts, spans, "exact");
118
+ const uses = usesOf(defined.term, texts, spans, "exact", defined.bare === true ? mentioned : NEVER_MENTIONED);
99
119
  const first = uses.find((offset) => !isLabel(sentenceAt(texts, offset), defined.term));
100
120
  return first !== undefined && first < defining ? [{ term: defined, offset: first }] : [];
101
121
  });
@@ -1 +1 @@
1
- {"version":3,"file":"definition-use.js","sourceRoot":"","sources":["../../src/structure/definition-use.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAW9C,sCAAsC;AACtC,MAAM,cAAc,GAAG,SAAS,CAAC;AACjC,4CAA4C;AAC5C,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,sEAAsE;AACtE,MAAM,UAAU,GAAG,uBAAuB,CA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
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Prose validation harness. Finds what is hard to read, and never rewrites it for you.",
5
5
  "keywords": [
6
6
  "chaff",
@@ -66,8 +66,8 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@anthropic-ai/sdk": "^0.125.0",
69
- "@chaffjs/lang-en": "0.21.0",
70
- "@chaffjs/lang-ja": "0.22.0",
69
+ "@chaffjs/lang-en": "0.22.0",
70
+ "@chaffjs/lang-ja": "0.24.0",
71
71
  "mdast-util-from-markdown": "^2.0.3",
72
72
  "mdast-util-frontmatter": "^2.0.1",
73
73
  "mdast-util-gfm-table": "^2.0.0",
@@ -0,0 +1,55 @@
1
+ id: calendar-name-case
2
+ layer: L1
3
+ status: stable
4
+ how_to_find: calendar-name-case
5
+ languages: [en]
6
+ severity: warning
7
+
8
+ name:
9
+ ja: 小文字で書いた曜日・月の名
10
+ en: Weekday or month in lower case
11
+
12
+ why:
13
+ ja: 英語では曜日と月の名(Monday、January)は固有名として必ず大文字で始めます。「on monday」のような小文字は、急いで打った跡か、チャットから貼った文に見え、検索でも大文字の形と分かれます。どの書き方を選ぶかの話ではなく、英語の綴りの決まりです。
14
+ en: 'English always capitalises the names of the days and months (Monday, January). "On monday" reads as typed in a hurry or pasted from a chat, and splits a search from the capitalised form. It is a rule of English spelling, not a matter of style.'
15
+
16
+ message:
17
+ ja: 「{written}」は大文字で始めて「{usual}」と書きます
18
+ en: 'Write "{written}" as "{usual}"'
19
+
20
+ how_to_fix:
21
+ ja: 頭の字を大文字にしてください。
22
+ en: Capitalise the first letter.
23
+
24
+ levels: { strict: error, normal: warning, relaxed: info }
25
+
26
+ use_for: [business, technical, blog, legal, docs, academic, literature, speech]
27
+
28
+ group: slips
29
+ summary:
30
+ ja: 英語で、「on monday」のように小文字で書いた曜日や月の名
31
+ en: A weekday or month written in lower case, as in "on monday"
32
+ example:
33
+ en:
34
+ before: |
35
+ The review is on monday, and the release follows in june.
36
+ after: |
37
+ The review is on Monday, and the release follows in June.
38
+
39
+ not_flagged:
40
+ ja: '英語の文書だけで動きます。普通の語でもある may、march、august と、略した形(mon、jan)は見ません。コードの中と、パス・タグ・アドレスの一部(monday.md、/june/、#friday、@sunday)と、設定の値(day: monday、"monday"、cron の * * monday)も見ません。'
41
+ en: 'Only in English documents. "may", "march" and "august", which are also ordinary words, and abbreviations (mon, jan) are not read. Code, and names inside a path, a tag or an address (monday.md, /june/, #friday, @sunday), and values in settings (day: monday, "monday", a cron field) are not read either.'
42
+ sources: [proselint]
43
+ rewrite:
44
+ depth: light
45
+ en:
46
+ direction: Capitalise the marked weekday or month. Change nothing else.
47
+ pairs:
48
+ - before: The review is on monday.
49
+ after: The review is on Monday.
50
+ - before: We ship in june and again in december.
51
+ after: We ship in June and again in December.
52
+ keep:
53
+ - the words and their order
54
+ avoid:
55
+ - capitalising other words in the sentence
@@ -0,0 +1,71 @@
1
+ id: comparative-without-baseline
2
+ layer: L3
3
+ status: stable
4
+ how_to_find: bare-comparative
5
+ requires: [pos]
6
+ severity: info
7
+
8
+ name:
9
+ ja: 比べる相手の無い比較
10
+ en: A comparison with nothing to compare with
11
+
12
+ why:
13
+ ja: 「より良い結果」「さらに高速になりました」は、何より良いのか、何より速いのかが書かれていなければ、読み手は確かめようがありません。宣伝の文に多く、言い切ったように見えて何も約束していません。「より」「さらに」の直後に程度を言う語がある文で、同じ文にも直前の文にも比べる相手(従来、以前、前回、「〜より」)が無いものを指します。
14
+ en: '"Better results" and "the new engine is faster" leave the reader unable to check anything unless they say better or faster than what. Marketing copy is full of them: they sound like a claim and promise nothing. A comparative that closes a clause after a verb ("is faster.", "is more efficient.") is reported when neither its sentence nor the one before names what it is compared with ("than", "previous", "before").'
15
+
16
+ message:
17
+ ja: 「{matched}」は、何と比べているかが書かれていません
18
+ en: '"{matched}" does not say what it is compared with'
19
+
20
+ how_to_fix:
21
+ ja: 比べる相手を書いてください(さらに高速になりました → 前の版より 2 倍速くなりました)。相手が無いなら、比較をやめて事実を書きます(処理は 1 秒で終わります)。
22
+ en: Name what it is compared with ("is faster" becomes "is twice as fast as version 2"), or state the fact instead of comparing ("finishes in one second").
23
+
24
+ levels: { strict: warning, normal: info, relaxed: info }
25
+
26
+ use_for: [business, technical, blog, docs, academic, legal, literature, speech]
27
+ off_for:
28
+ literature: "A narrator and a character compare as they speak."
29
+ speech: "A speaker's comparisons lean on what the audience already has in mind."
30
+
31
+ group: wording
32
+ summary:
33
+ ja: 「より良い」「さらに高速」のように、比べる相手が書かれていない比較
34
+ en: A comparative such as "is faster" or "is more efficient" with no "than" or other baseline nearby
35
+
36
+ example:
37
+ ja:
38
+ before: 新しい版では、処理がさらに高速になりました。
39
+ after: 新しい版では、処理が前の版の 2 倍速くなりました。
40
+ en:
41
+ before: We rewrote the parser. The new engine is faster.
42
+ after: We rewrote the parser. The new engine is twice as fast as version 2.
43
+
44
+ not_flagged:
45
+ ja: 同じ文か直前の文に比べる相手(従来、以前、前回、昨年、「〜より」「〜に比べて」)がある比較、「より多くの」「より詳しく」のような決まった言い方、程度を言う語が続かない「さらに」(さらに、〜します)、条件の下の比較(入れるとより良くなる)は指しません。
46
+ en: 'A comparison whose sentence or the one before names a baseline ("than", "previous", "before", "compared"), a comparative before a noun ("better results", read only in Japanese), a comparative that does not close its clause ("runs faster on large files"), and one under a condition or a hypothesis ("if it looks better", "would be easier") are not reported.'
47
+
48
+ rewrite:
49
+ depth: light
50
+ ja:
51
+ direction: 比べる相手を文書から探して書き足すか、比較をやめて数や事実で言い直してください。相手が文書に無ければ、作らずに書き手に尋ねます。
52
+ pairs:
53
+ - before: 新しい版では、処理がさらに高速になりました。
54
+ after: 新しい版では、処理が前の版の 2 倍速くなりました。
55
+ - before: より良い結果を届けます。
56
+ after: 誤検出を前年の半分に減らします。
57
+ keep:
58
+ - 文書に書いてある数と事実
59
+ avoid:
60
+ - 文書に無い比べる相手や数を作る
61
+ en:
62
+ direction: Add what the comparison is against, taken from the document, or replace the comparison with the figure or fact. If the document gives no baseline, ask the writer instead of inventing one.
63
+ pairs:
64
+ - before: The new engine is faster.
65
+ after: The new engine is twice as fast as version 2.
66
+ - before: Setup is now easier.
67
+ after: Setup now takes one command instead of five.
68
+ keep:
69
+ - the figures and facts the document gives
70
+ avoid:
71
+ - inventing a baseline or a figure the document does not give
@@ -0,0 +1,62 @@
1
+ id: connective-hierarchy
2
+ layer: L2
3
+ status: stable
4
+ how_to_find: connective-hierarchy
5
+ word_list: connective-hierarchy
6
+ extra_word_lists: [connective-lookalike]
7
+ requires: [pos]
8
+ languages: [ja]
9
+ severity: warning
10
+
11
+ name:
12
+ ja: 内の段の無い「並びに」「若しくは」
13
+ en: 並びに or 若しくは with no inner level
14
+
15
+ why:
16
+ ja: 法令と公用文では、並べる語を段で使い分けます。一段の並べ方は「及び」「又は」で書き、二段に重ねたときだけ、外の段を「並びに」、内の段を「若しくは」で書きます(A及びB並びにC、A若しくはB又はC)。「及び」の無い文の「並びに」と、「又は」の無い文の「若しくは」は、段の無い並べ方に外の段の語を使っていて、読み手は内の段を探して止まります。
17
+ en: Japanese statutes and official writing join lists by level. A one-level list uses 及び (and) or 又は (or); only a two-level list uses 並びに for the outer "and" (A及びB並びにC) and 若しくは for the inner "or" (A若しくはB又はC). 並びに in a sentence with no 及び, or 若しくは in one with no 又は, uses the word for a level the sentence does not have, and the reader looks for the other level.
18
+
19
+ message:
20
+ ja: 「{written}」の文に、段の組になる語がありません(一段なら「{usual}」)
21
+ en: '"{written}" with no other level of the list in the sentence (a one-level list uses "{usual}")'
22
+
23
+ how_to_fix:
24
+ ja: 一段の並べ方なら「並びに」を「及び」に、「若しくは」を「又は」に替えてください。二段に重ねるつもりなら、内の段の語を書き足してください。
25
+ en: For a one-level list, write 及び for 並びに and 又は for 若しくは. If the list has two levels, write the other level's word too.
26
+
27
+ levels: { strict: error, normal: warning, relaxed: info }
28
+
29
+ use_for: [business, technical, blog, legal, docs, academic, literature, speech]
30
+ off_for:
31
+ literature: Older prose uses 並びに and 若しくは as plain literary connectives, not by the official levels.
32
+ speech: Spoken Japanese, as in Diet and press transcripts, says 並びに and 若しくは for a single "and" and "or".
33
+
34
+ group: wording
35
+ summary:
36
+ ja: 「及び」の無い文の「並びに」、「又は」の無い文の「若しくは」
37
+ en: 並びに in a sentence with no 及び, or 若しくは in one with no 又は
38
+ example:
39
+ ja:
40
+ before: |
41
+ 申請書並びに添付書類を提出する。
42
+ after: |
43
+ 申請書及び添付書類を提出する。
44
+
45
+ not_flagged:
46
+ ja: 日本語の文書だけで動きます。仮名の「ならびに」「もしくは」は、普通の文で一段の並べ方にも使われるので見ません。「及び」「および」「又は」「または」が同じ文にあれば、段の組を作ったと読みます。「」『』の中は、引いた語句の片方だけなので見ません。名詞の後ろで名詞をつなぐときだけ見ます(文字の並びに、正しい並びに、縦並びには見ません)。
47
+ en: Only in Japanese documents. The kana forms ならびに and もしくは, which plain writing also uses for a one-level list, are not read. A sentence holding 及び, および, 又は or または is read as having the other level. A phrase inside 「」 or 『』 quotes half of a list and is not read. Only a word joining two nouns is read (文字の並びに, 正しい並びに and 縦並びに, the noun 並び with に, are not).
48
+ sources: [koyobun-2022]
49
+ rewrite:
50
+ depth: light
51
+ ja:
52
+ direction: 一段の並べ方なら、「並びに」を「及び」に、「若しくは」を「又は」に替えます。並べた語と順は変えません。
53
+ pairs:
54
+ - before: 申請書並びに添付書類を提出する。
55
+ after: 申請書及び添付書類を提出する。
56
+ - before: 書面若しくは電磁的方法により通知する。
57
+ after: 書面又は電磁的方法により通知する。
58
+ keep:
59
+ - 並べた語とその順
60
+ avoid:
61
+ - 文に無い内の段を書き足す
62
+ - 仮名の「および」「または」に書き換える
@@ -1,6 +1,6 @@
1
1
  id: cross-doc-broken-link
2
2
  layer: L1
3
- status: experimental
3
+ status: stable
4
4
  how_to_find: cross-doc-broken-link
5
5
  # documents: compares the files of one run, so it runs only when chaff is given two or more files, or a folder.
6
6
  requires: [markdown, documents]
@@ -1,6 +1,6 @@
1
1
  id: cross-doc-duplicate-definition
2
2
  layer: L3
3
- status: experimental
3
+ status: stable
4
4
  how_to_find: cross-doc-duplicate-definition
5
5
  # documents: compares the files of one run, so it runs only when chaff is given two or more files, or a folder.
6
6
  requires: [structure, documents]
@@ -1,6 +1,6 @@
1
1
  id: cross-doc-fact-conflict
2
2
  layer: L3
3
- status: experimental
3
+ status: stable
4
4
  how_to_find: cross-doc-fact-conflict
5
5
  # documents: compares the files of one run, so it runs only when chaff is given two or more files, or a folder.
6
6
  requires: [quantities, documents]
@@ -1,12 +1,12 @@
1
1
  id: cross-doc-term-variant
2
2
  layer: L3
3
- status: experimental
3
+ status: stable
4
4
  how_to_find: cross-doc-term-variant
5
5
  # documents: compares the files of one run, so it runs only when chaff is given two or more files, or a folder.
6
6
  requires: [documents]
7
7
  # The katakana words come from the language package's split. Without parts of speech only the Latin and listed words are read.
8
8
  uses: [pos]
9
- severity: warning
9
+ severity: info
10
10
 
11
11
  name:
12
12
  ja: ファイルによって書き方が違う語
@@ -32,9 +32,11 @@ placeholders:
32
32
  ja: ほかのファイルの書き方
33
33
  en: the other files' spelling
34
34
 
35
- levels: { strict: error, normal: warning, relaxed: info }
35
+ levels: { strict: warning, normal: info, relaxed: info }
36
36
 
37
37
  use_for: [business, technical, blog, legal, docs, academic, literature, speech]
38
+ off_for:
39
+ literature: measured by yarn rules:measure
38
40
 
39
41
  group: consistency
40
42
  summary:
@@ -0,0 +1,55 @@
1
+ id: ime-residue
2
+ layer: L1
3
+ status: stable
4
+ how_to_find: ime-residue
5
+ languages: [ja]
6
+ severity: warning
7
+
8
+ name:
9
+ ja: 変換し損ねた英字
10
+ en: A Latin letter left by the input method
11
+
12
+ why:
13
+ ja: 「おもしrおい」「対応sた」のように、日本語の語の中に英字が一字だけ残るのは、ローマ字入力で押したキーが仮名にならなかった跡です。読み手はその語で止まり、検索にも当たりません。打ち間違いなので、どちらの書き方が正しいかの話ではありません。
14
+ en: "A single Latin letter inside a Japanese word (おもしrおい for おもしろい) is a key pressed in romaji input that never became kana. The reader stops at the word, and search does not find it. It is a typing slip, not a style."
15
+
16
+ message:
17
+ ja: 日本語の語の中に英字「{letter}」が一字だけあります(変換し損ねた跡)
18
+ en: 'A lone Latin letter "{letter}" inside a Japanese word, left by the input method'
19
+
20
+ how_to_fix:
21
+ ja: 英字を消して、語を打ち直してください(おもしrおい → おもしろい)。
22
+ en: Delete the letter and retype the word (おもしrおい → おもしろい).
23
+
24
+ levels: { strict: error, normal: warning, relaxed: info }
25
+
26
+ use_for: [business, technical, blog, legal, docs, academic, literature, speech]
27
+
28
+ group: slips
29
+ summary:
30
+ ja: 「おもしrおい」「対応sた」のような、日本語の語の中に一字だけ残った英字
31
+ en: A single Latin letter left inside a Japanese word by the input method, as in おもしrおい
32
+ example:
33
+ ja:
34
+ before: |
35
+ この資料はとてもおもしrおいです。
36
+ after: |
37
+ この資料はとてもおもしろいです。
38
+
39
+ not_flagged:
40
+ ja: 大文字(A 社、B さん)、二字以上の英字(while 文、note)、コードの中は指しません。後ろに助詞が続く一字(変数 x が、まず x を、を x で)は変数の名と読み、一字の後ろが漢字のもの(の x 座標)も指しません。片仮名の後ろの一字(サイズ m、プラン b)は記号と読み、パスの中(/docs/…)も見ません。
41
+ en: Capitals (A社, Bさん), runs of two or more letters (while文, note) and code are not reported. A letter followed by a particle (変数xが, まずxを, をxで) is read as the name of a variable, and a letter followed by a kanji (のx座標) is not reported either. A letter after katakana (サイズm, プランb) is read as a label, and paths (/docs/…) are not read.
42
+ sources: [textlint-ja-presets]
43
+ rewrite:
44
+ depth: light
45
+ ja:
46
+ direction: 残った英字を消して、前後の仮名から語を打ち直してください。語が決められないときは書き手に尋ねます。
47
+ pairs:
48
+ - before: この資料はとてもおもしrおいです。
49
+ after: この資料はとてもおもしろいです。
50
+ - before: 申請に対応sたことを報告します。
51
+ after: 申請に対応したことを報告します。
52
+ keep:
53
+ - 文のほかの語
54
+ avoid:
55
+ - 前後の語まで書き換える
@@ -0,0 +1,82 @@
1
+ id: lookalike-character
2
+ layer: L1
3
+ status: stable
4
+ how_to_find: lookalike-character
5
+ severity: warning
6
+
7
+ name:
8
+ ja: 見た目が同じで別の字
9
+ en: Look-alike character
10
+
11
+ why:
12
+ ja: 部首の字(⼈ U+2F08)や互換漢字は、ふつうの「人」と同じに見えて別の字です。濁点を別の字にした「か+゛」(macOS のファイル名や、そこからコピーした文に多い)も、「が」と同じに見えて別の並びです。どれも検索、並べ替え、辞書引き、表記の照合から漏れ、読み手には直す所が見えません。PDF からのコピーや、入力の変換で入ります。コードの中も見ます。
13
+ en: "A Kangxi radical (⼈ U+2F08) looks like the ordinary 人 and is another character; so is a CJK compatibility ideograph. A letter written as a base and a separate combining mark (e + U+0301, common in macOS file names and text copied from them) looks like é and is another sequence. Search, sorting, dictionaries and spelling checks all miss them, and the reader cannot see what to fix. They come from PDF copies and input methods. Code is checked too."
14
+
15
+ message:
16
+ ja: 「{written}」({code})は「{usual}」と同じに見える別の字です
17
+ en: '"{written}" ({code}) looks like "{usual}" but is another character'
18
+
19
+ messages:
20
+ radical:
21
+ ja: 「{written}」({code})は部首の字です。ふつうの「{usual}」と書きます
22
+ en: '"{written}" ({code}) is a radical, not the ordinary "{usual}"'
23
+ compatibility:
24
+ ja: 「{written}」({code})は互換漢字です。ふつうの「{usual}」と書きます
25
+ en: '"{written}" ({code}) is a compatibility ideograph, not the ordinary "{usual}"'
26
+ decomposed:
27
+ ja: 「{written}」は字と記号が分かれています({code})。一字の「{usual}」と書きます
28
+ en: '"{written}" is a letter and a separate mark ({code}), not the single letter "{usual}"'
29
+ spacing-mark:
30
+ ja: 「{written}」は濁点・半濁点を別の字で書いています({code})。一字の「{usual}」と書きます
31
+ en: '"{written}" writes the voicing mark as a separate character ({code}), not the single letter "{usual}"'
32
+
33
+ how_to_fix:
34
+ ja: その字を消して、ふつうの字を打ち直してください。文書全体を NFC に正規化しても直ります(部首の字は NFKC)。
35
+ en: Delete the character and type the ordinary one. Normalising the document to NFC also fixes it (NFKC for radicals).
36
+
37
+ levels: { strict: error, normal: warning, relaxed: info }
38
+
39
+ use_for: [business, technical, blog, legal, docs, academic, literature, speech]
40
+
41
+ group: slips
42
+ summary:
43
+ ja: 部首の字(⼈)、互換漢字、字と分かれた濁点(か+゛)のような、ふつうの字と同じに見える別の字
44
+ en: A character that looks like an ordinary one but is another, such as a Kangxi radical (⼈ for 人) or a letter and a separate combining mark
45
+ example:
46
+ ja:
47
+ before: "申込書は総務課の⼭田さんへ送ってください。\n"
48
+ after: |
49
+ 申込書は総務課の山田さんへ送ってください。
50
+ en:
51
+ before: "Send the form to the café office.\n"
52
+ after: |
53
+ Send the form to the café office.
54
+
55
+ not_flagged:
56
+ ja: 一字にまとまる形の無い組み合わせ(字に付いた異体字の指定、合成済みの形の無いアクセント)と、Unicode が別の字として持つ互換漢字(﨑 など)は指しません。
57
+ en: Combinations with no single precomposed form (a variation selector after a character, an accent with no precomposed letter) and compatibility ideographs that Unicode keeps as their own characters (﨑) are not reported.
58
+ sources: [textlint-ja-presets]
59
+ rewrite:
60
+ depth: light
61
+ ja:
62
+ direction: 指した字だけを、同じに見えるふつうの字に打ち直してください。ほかの字は変えません。
63
+ pairs:
64
+ - before: "総務課の⼭田さんへ送ってください。"
65
+ after: 総務課の山田さんへ送ってください。
66
+ - before: "がいしゃに送ります。"
67
+ after: がいしゃに送ります。
68
+ keep:
69
+ - 字の並びと文の意味
70
+ avoid:
71
+ - 同じに見えるからと、指した字をそのまま残す
72
+ en:
73
+ direction: Retype only the marked character as the ordinary one it looks like. Change nothing else.
74
+ pairs:
75
+ - before: "Send it to the café office."
76
+ after: Send it to the café office.
77
+ - before: "The résumé is attached."
78
+ after: The résumé is attached.
79
+ keep:
80
+ - the words and their order
81
+ avoid:
82
+ - leaving the marked character because it looks right
@@ -0,0 +1,76 @@
1
+ id: missing-final-period
2
+ layer: L2
3
+ status: stable
4
+ how_to_find: missing-final-period
5
+ requires: [pos]
6
+ languages: [ja]
7
+ severity: info
8
+
9
+ name:
10
+ ja: 「。」で終わらない段落
11
+ en: A paragraph ending without 。
12
+
13
+ why:
14
+ ja: ほかの段落が「。」で終わる文書で、一つの段落だけが「〜しました」のように句点無しで終わると、書きかけで止まったか、貼り合わせた所に見えます。どちらの書き方が正しいかは決めず、文書の中で少ないほうを指します。見出しのような短い行、「:」で次へ続く行、注の行、表のように空白で並べた行、名詞で終わる行(体言止めの項目)は、文ではないので数えません。
15
+ en: In a Japanese document whose paragraphs end with 。, one paragraph that stops without it (〜しました) reads as unfinished, or as pasted in from elsewhere. chaff does not pick a side; it points at the paragraphs that differ from most of the document. Short lines such as captions, lines leading into a list with :, notes, lines laid out with runs of spaces, and lines ending in a noun (an item in noun style) are not sentences and are not counted.
16
+
17
+ message:
18
+ ja: この段落は「。」で終わっていません(この文書の段落はふつう「。」で終わります。{of} 段落のうち {count} 段落)
19
+ en: "This paragraph ends without 。, where the document's paragraphs usually end with it ({count} of {of})"
20
+
21
+ how_to_fix:
22
+ ja: 段落の終わりに「。」を付けてください。
23
+ en: Add 。 at the end of the paragraph.
24
+
25
+ # 少ないほうが、数えた段落の何パーセントまでなら「混ざっている」と見るか。これを超えたら、文書が使い分けている。
26
+ levels: { strict: 34, normal: 25, relaxed: 15 }
27
+
28
+ use_for: [business, technical, blog, legal, docs, academic, literature, speech]
29
+ off_for:
30
+ literature: Verse and dialogue end lines without 。 on purpose.
31
+ speech: A transcript breaks where the speaker stops, not where a written sentence would end.
32
+
33
+ group: consistency
34
+ summary:
35
+ ja: 「。」で終わる段落の多い文書で、「。」無しで終わった段落
36
+ en: A paragraph ending without 。 in a document whose other paragraphs end with it
37
+ example:
38
+ ja:
39
+ before: |
40
+ 申請は市役所の窓口で受け付けます。
41
+
42
+ 受付の時間は平日の午前九時から午後五時までです。
43
+
44
+ 提出した書類は二週間ほどで審査が終わります。
45
+
46
+ 審査の結果は郵送でお知らせしました
47
+ after: |
48
+ 申請は市役所の窓口で受け付けます。
49
+
50
+ 受付の時間は平日の午前九時から午後五時までです。
51
+
52
+ 提出した書類は二週間ほどで審査が終わります。
53
+
54
+ 審査の結果は郵送でお知らせしました。
55
+
56
+ not_flagged:
57
+ ja: 日本語の文書だけで動きます。十五字に満たない行、「:」で終わる行、※ や * で始まる注の行、空白を二つ続けて並べた行、名詞や連用形で終わる行(受付時間の案内、可能性あり)は文として数えません。閉じ括弧で終わる行(〜をご覧ください)と、「?」「!」で終わる行も数えません。段落の多くが「。」で終わらない文書(スライド、一覧)は指しません。
58
+ en: Only in Japanese documents. Lines under fifteen characters, lines ending in :, note lines starting with ※ or *, lines laid out with two spaces in a row, and lines ending in a noun or a continuative form are not counted as sentences, nor are lines ending in a closing bracket, ? or !. A document whose paragraphs mostly end without 。 (slides, lists) is not reported.
59
+ level_meaning:
60
+ ja: 「。」の無い段落が {limit}% までなら指摘
61
+ en: reported while paragraphs without 。 are at most {limit}% of the counted paragraphs
62
+ sources: [textlint-ja-presets]
63
+ rewrite:
64
+ depth: light
65
+ ja:
66
+ direction: 指した段落の終わりに「。」を一つ付けます。文は変えません。
67
+ pairs:
68
+ - before: 審査の結果は郵送でお知らせしました
69
+ after: 審査の結果は郵送でお知らせしました。
70
+ - before: 詳しい手順は担当者から説明します
71
+ after: 詳しい手順は担当者から説明します。
72
+ keep:
73
+ - 段落の言葉と順
74
+ avoid:
75
+ - 文を書き換える
76
+ - 名詞で終わる項目にまで「。」を付ける