chaffjs 0.22.0 → 0.24.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/README.md +7 -1
- package/dist/api.d.ts +14 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/cli-args.d.ts +2 -0
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +2 -0
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +2 -0
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +13 -19
- package/dist/cli.js.map +1 -1
- package/dist/commands/feedback.d.ts +3 -0
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/fix-plan.d.ts.map +1 -1
- package/dist/commands/fix-plan.js +5 -0
- package/dist/commands/fix-plan.js.map +1 -1
- package/dist/commands/rules.d.ts +9 -0
- package/dist/commands/rules.d.ts.map +1 -0
- package/dist/commands/rules.js +26 -0
- package/dist/commands/rules.js.map +1 -0
- package/dist/config/load.d.ts +6 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +1 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/style.js +1 -1
- package/dist/config/style.js.map +1 -1
- package/dist/config/warnings.d.ts +1 -1
- package/dist/config/warnings.d.ts.map +1 -1
- package/dist/config/warnings.js +3 -1
- package/dist/config/warnings.js.map +1 -1
- package/dist/detectors/bare-comparative.d.ts +26 -0
- package/dist/detectors/bare-comparative.d.ts.map +1 -0
- package/dist/detectors/bare-comparative.js +117 -0
- package/dist/detectors/bare-comparative.js.map +1 -0
- package/dist/detectors/chat-citation.d.ts +6 -0
- package/dist/detectors/chat-citation.d.ts.map +1 -1
- package/dist/detectors/chat-citation.js +26 -1
- package/dist/detectors/chat-citation.js.map +1 -1
- package/dist/detectors/clause-shape.d.ts.map +1 -1
- package/dist/detectors/clause-shape.js +19 -5
- package/dist/detectors/clause-shape.js.map +1 -1
- package/dist/detectors/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +4 -2
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/ellipsis.d.ts +10 -0
- package/dist/detectors/ellipsis.d.ts.map +1 -0
- package/dist/detectors/ellipsis.js +56 -0
- package/dist/detectors/ellipsis.js.map +1 -0
- package/dist/detectors/generic-heading.d.ts +8 -0
- package/dist/detectors/generic-heading.d.ts.map +1 -0
- package/dist/detectors/generic-heading.js +26 -0
- package/dist/detectors/generic-heading.js.map +1 -0
- package/dist/detectors/ime-residue.d.ts +13 -0
- package/dist/detectors/ime-residue.d.ts.map +1 -0
- package/dist/detectors/ime-residue.js +27 -0
- package/dist/detectors/ime-residue.js.map +1 -0
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +9 -2
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/lookalike-character.d.ts +18 -0
- package/dist/detectors/lookalike-character.d.ts.map +1 -0
- package/dist/detectors/lookalike-character.js +50 -0
- package/dist/detectors/lookalike-character.js.map +1 -0
- package/dist/detectors/lowercase-name.d.ts +9 -0
- package/dist/detectors/lowercase-name.d.ts.map +1 -0
- package/dist/detectors/lowercase-name.js +40 -0
- package/dist/detectors/lowercase-name.js.map +1 -0
- package/dist/detectors/registry/bare-comparative.d.ts +3 -0
- package/dist/detectors/registry/bare-comparative.d.ts.map +1 -0
- package/dist/detectors/registry/bare-comparative.js +3 -0
- package/dist/detectors/registry/bare-comparative.js.map +1 -0
- package/dist/detectors/registry/calendar-name-case.d.ts +3 -0
- package/dist/detectors/registry/calendar-name-case.d.ts.map +1 -0
- package/dist/detectors/registry/calendar-name-case.js +3 -0
- package/dist/detectors/registry/calendar-name-case.js.map +1 -0
- package/dist/detectors/registry/ellipsis-consistency.d.ts +3 -0
- package/dist/detectors/registry/ellipsis-consistency.d.ts.map +1 -0
- package/dist/detectors/registry/ellipsis-consistency.js +3 -0
- package/dist/detectors/registry/ellipsis-consistency.js.map +1 -0
- package/dist/detectors/registry/generic-heading.d.ts +3 -0
- package/dist/detectors/registry/generic-heading.d.ts.map +1 -0
- package/dist/detectors/registry/generic-heading.js +3 -0
- package/dist/detectors/registry/generic-heading.js.map +1 -0
- package/dist/detectors/registry/ime-residue.d.ts +3 -0
- package/dist/detectors/registry/ime-residue.d.ts.map +1 -0
- package/dist/detectors/registry/ime-residue.js +3 -0
- package/dist/detectors/registry/ime-residue.js.map +1 -0
- package/dist/detectors/registry/lookalike-character.d.ts +3 -0
- package/dist/detectors/registry/lookalike-character.d.ts.map +1 -0
- package/dist/detectors/registry/lookalike-character.js +3 -0
- package/dist/detectors/registry/lookalike-character.js.map +1 -0
- package/dist/detectors/registry/unit-spacing-consistency.d.ts +3 -0
- package/dist/detectors/registry/unit-spacing-consistency.d.ts.map +1 -0
- package/dist/detectors/registry/unit-spacing-consistency.js +3 -0
- package/dist/detectors/registry/unit-spacing-consistency.js.map +1 -0
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +8 -4
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +32 -7
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +14 -0
- package/dist/detectors/technical-docs.js.map +1 -1
- package/dist/detectors/unit-spacing.d.ts +25 -0
- package/dist/detectors/unit-spacing.d.ts.map +1 -0
- package/dist/detectors/unit-spacing.js +50 -0
- package/dist/detectors/unit-spacing.js.map +1 -0
- package/dist/extension/load.d.ts +3 -0
- package/dist/extension/load.d.ts.map +1 -1
- package/dist/extension/load.js +1 -0
- package/dist/extension/load.js.map +1 -1
- package/dist/extension/pack-read.d.ts.map +1 -1
- package/dist/extension/pack-read.js +1 -0
- package/dist/extension/pack-read.js.map +1 -1
- package/dist/extension/plugin-load.js.map +1 -1
- package/dist/extension/plugin-parse.d.ts +7 -0
- package/dist/extension/plugin-parse.d.ts.map +1 -1
- package/dist/extension/plugin-parse.js +18 -2
- package/dist/extension/plugin-parse.js.map +1 -1
- package/dist/extension/problem-text.d.ts.map +1 -1
- package/dist/extension/problem-text.js +5 -0
- package/dist/extension/problem-text.js.map +1 -1
- package/dist/fix-plan/plan.d.ts +4 -0
- package/dist/fix-plan/plan.d.ts.map +1 -1
- package/dist/fix-plan/plan.js +1 -0
- package/dist/fix-plan/plan.js.map +1 -1
- package/dist/fix-plan/render.d.ts.map +1 -1
- package/dist/fix-plan/render.js +9 -0
- package/dist/fix-plan/render.js.map +1 -1
- package/dist/fix-plan/text.d.ts +4 -0
- package/dist/fix-plan/text.d.ts.map +1 -1
- package/dist/fix-plan/text.js +8 -2
- package/dist/fix-plan/text.js.map +1 -1
- package/dist/genre-guide/key-rules.d.ts +10 -0
- package/dist/genre-guide/key-rules.d.ts.map +1 -0
- package/dist/genre-guide/key-rules.js +23 -0
- package/dist/genre-guide/key-rules.js.map +1 -0
- package/dist/genre-guide/layer.d.ts +44 -0
- package/dist/genre-guide/layer.d.ts.map +1 -0
- package/dist/genre-guide/layer.js +43 -0
- package/dist/genre-guide/layer.js.map +1 -0
- package/dist/genre-guide/lines.d.ts +15 -0
- package/dist/genre-guide/lines.d.ts.map +1 -0
- package/dist/genre-guide/lines.js +39 -0
- package/dist/genre-guide/lines.js.map +1 -0
- package/dist/genre-guide/of-config.d.ts +13 -0
- package/dist/genre-guide/of-config.d.ts.map +1 -0
- package/dist/genre-guide/of-config.js +18 -0
- package/dist/genre-guide/of-config.js.map +1 -0
- package/dist/genre-guide/problem-text.d.ts +5 -0
- package/dist/genre-guide/problem-text.d.ts.map +1 -0
- package/dist/genre-guide/problem-text.js +29 -0
- package/dist/genre-guide/problem-text.js.map +1 -0
- package/dist/genre-guide/render.d.ts +5 -0
- package/dist/genre-guide/render.d.ts.map +1 -0
- package/dist/genre-guide/render.js +38 -0
- package/dist/genre-guide/render.js.map +1 -0
- package/dist/genre-guide/report.d.ts +32 -0
- package/dist/genre-guide/report.d.ts.map +1 -0
- package/dist/genre-guide/report.js +42 -0
- package/dist/genre-guide/report.js.map +1 -0
- package/dist/genre-guide/resolve.d.ts +16 -0
- package/dist/genre-guide/resolve.d.ts.map +1 -0
- package/dist/genre-guide/resolve.js +31 -0
- package/dist/genre-guide/resolve.js.map +1 -0
- package/dist/genre-parse.d.ts +5 -1
- package/dist/genre-parse.d.ts.map +1 -1
- package/dist/genre-parse.js +8 -1
- package/dist/genre-parse.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +14 -0
- package/dist/init.js.map +1 -1
- package/dist/quoted-span.d.ts +7 -0
- package/dist/quoted-span.d.ts.map +1 -1
- package/dist/quoted-span.js +20 -0
- package/dist/quoted-span.js.map +1 -1
- package/dist/render/rules-json.d.ts +2 -1
- package/dist/render/rules-json.d.ts.map +1 -1
- package/dist/render/rules-json.js +3 -1
- package/dist/render/rules-json.js.map +1 -1
- package/dist/render/sarif.d.ts +3 -1
- package/dist/render/sarif.d.ts.map +1 -1
- package/dist/render/sarif.js +3 -1
- package/dist/render/sarif.js.map +1 -1
- package/dist/structure/definition-use.d.ts +14 -4
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +29 -9
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/style-parse.d.ts +3 -0
- package/dist/style-parse.d.ts.map +1 -1
- package/dist/style-parse.js +18 -2
- package/dist/style-parse.js.map +1 -1
- package/genres.yaml +329 -0
- package/package.json +3 -3
- package/rules/calendar-name-case.yaml +55 -0
- package/rules/comparative-without-baseline.yaml +71 -0
- package/rules/cross-doc-broken-link.yaml +1 -1
- package/rules/cross-doc-duplicate-definition.yaml +1 -1
- package/rules/cross-doc-fact-conflict.yaml +1 -1
- package/rules/cross-doc-term-variant.yaml +5 -3
- package/rules/ellipsis-consistency.yaml +73 -0
- package/rules/figurative-density.yaml +84 -0
- package/rules/ime-residue.yaml +55 -0
- package/rules/lookalike-character.yaml +82 -0
- package/rules/numbered-generic-heading.yaml +111 -0
- package/rules/undefined-acronym.yaml +1 -0
- package/rules/unit-spacing-consistency.yaml +74 -0
- package/skills/chaff/SKILL.md +6 -0
- package/src/api.ts +13 -0
- package/src/cli-args.ts +3 -0
- package/src/cli-text.ts +2 -0
- package/src/cli.ts +16 -20
- package/src/commands/feedback.ts +3 -0
- package/src/commands/fix-plan.ts +8 -0
- package/src/commands/rules.ts +34 -0
- package/src/config/load.ts +7 -1
- package/src/config/style.ts +1 -1
- package/src/config/warnings.ts +3 -1
- package/src/detectors/bare-comparative.ts +152 -0
- package/src/detectors/chat-citation.ts +28 -1
- package/src/detectors/clause-shape.ts +20 -6
- package/src/detectors/definition-use.ts +13 -3
- package/src/detectors/ellipsis.ts +74 -0
- package/src/detectors/generic-heading.ts +30 -0
- package/src/detectors/ime-residue.ts +37 -0
- package/src/detectors/lexicon.ts +11 -2
- package/src/detectors/lookalike-character.ts +75 -0
- package/src/detectors/lowercase-name.ts +58 -0
- package/src/detectors/registry/bare-comparative.ts +4 -0
- package/src/detectors/registry/calendar-name-case.ts +4 -0
- package/src/detectors/registry/ellipsis-consistency.ts +4 -0
- package/src/detectors/registry/generic-heading.ts +4 -0
- package/src/detectors/registry/ime-residue.ts +4 -0
- package/src/detectors/registry/lookalike-character.ts +4 -0
- package/src/detectors/registry/unit-spacing-consistency.ts +4 -0
- package/src/detectors/signals.ts +9 -5
- package/src/detectors/structure-tree.ts +55 -30
- package/src/detectors/technical-docs.ts +13 -0
- package/src/detectors/unit-spacing.ts +71 -0
- package/src/extension/load.ts +4 -0
- package/src/extension/pack-read.ts +1 -0
- package/src/extension/plugin-load.ts +1 -1
- package/src/extension/plugin-parse.ts +27 -4
- package/src/extension/problem-text.ts +7 -1
- package/src/fix-plan/plan.ts +5 -0
- package/src/fix-plan/render.ts +9 -0
- package/src/fix-plan/text.ts +12 -2
- package/src/genre-guide/key-rules.ts +37 -0
- package/src/genre-guide/layer.ts +77 -0
- package/src/genre-guide/lines.ts +41 -0
- package/src/genre-guide/of-config.ts +26 -0
- package/src/genre-guide/problem-text.ts +34 -0
- package/src/genre-guide/render.ts +50 -0
- package/src/genre-guide/report.ts +63 -0
- package/src/genre-guide/resolve.ts +36 -0
- package/src/genre-parse.ts +13 -3
- package/src/init.ts +14 -0
- package/src/quoted-span.ts +25 -0
- package/src/render/rules-json.ts +4 -0
- package/src/render/sarif.ts +4 -1
- package/src/structure/definition-use.ts +42 -10
- package/src/style-parse.ts +19 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: cross-doc-duplicate-definition
|
|
2
2
|
layer: L3
|
|
3
|
-
status:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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,73 @@
|
|
|
1
|
+
id: ellipsis-consistency
|
|
2
|
+
layer: L2
|
|
3
|
+
status: stable
|
|
4
|
+
how_to_find: ellipsis-consistency
|
|
5
|
+
severity: info
|
|
6
|
+
|
|
7
|
+
name:
|
|
8
|
+
ja: 省略記号の書き方が混ざっている
|
|
9
|
+
en: Ellipses written two ways
|
|
10
|
+
|
|
11
|
+
why:
|
|
12
|
+
ja: 省略の記号を「……」と「・・・」、「…」と「...」のように二通りに書くと、読み手は違いに意味があるのかと迷い、別々の所から貼り合わせた文書に見えます。検索や置換でも片方を取りこぼします。どの書き方が正しいかは決めず、文書の中で少ないほうを指します。
|
|
13
|
+
en: 'An ellipsis written as "..." in some places and "…" in others makes the reader wonder whether the difference means something, and makes the document look pasted together; a search finds only one kind. chaff does not pick a side; it points at the way the document uses less.'
|
|
14
|
+
|
|
15
|
+
message:
|
|
16
|
+
ja: 省略の記号を「{written}」と書いています(この文書はふつう「{usual}」。{of} 箇所のうち {count} 箇所が違う)
|
|
17
|
+
en: 'The ellipsis "{written}" here, where the document usually writes "{usual}" ({count} of {of})'
|
|
18
|
+
|
|
19
|
+
how_to_fix:
|
|
20
|
+
ja: 文書の多いほうの書き方に合わせてください。
|
|
21
|
+
en: Match the way the rest of the document writes it.
|
|
22
|
+
|
|
23
|
+
# 少ないほうが、省略記号の何パーセントまでなら「混ざっている」と見るか。これを超えたら、文書が使い分けている。
|
|
24
|
+
levels: { strict: 49, normal: 34, relaxed: 20 }
|
|
25
|
+
|
|
26
|
+
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
27
|
+
|
|
28
|
+
group: consistency
|
|
29
|
+
summary:
|
|
30
|
+
ja: 「……」と「・・・」、「…」と「...」のように、一つの文書で省略の記号を二通りに書いている所
|
|
31
|
+
en: An ellipsis written two ways in one document, such as "..." and "…"
|
|
32
|
+
example:
|
|
33
|
+
ja:
|
|
34
|
+
before: |
|
|
35
|
+
準備中です……。確認中です……。少々お待ちください・・・。
|
|
36
|
+
after: |
|
|
37
|
+
準備中です……。確認中です……。少々お待ちください……。
|
|
38
|
+
en:
|
|
39
|
+
before: |
|
|
40
|
+
Loading… Saving… Please wait...
|
|
41
|
+
after: |
|
|
42
|
+
Loading… Saving… Please wait…
|
|
43
|
+
not_flagged:
|
|
44
|
+
ja: コードの中は見ません。点がさらに続く所(....、…・)は、どの書き方か決められないので数えません。少ないほうが全体の 3 分の 1 を超える文書や、二通りが同じ数の文書は、使い分けていると読んで指しません。
|
|
45
|
+
en: Code is not read. A longer run of dots ("....") is not counted, since its form is unclear. When the less common way is over a third, or the two are equally common, the document is read as using both on purpose.
|
|
46
|
+
level_meaning:
|
|
47
|
+
ja: 少ないほうが {limit}% までなら指摘
|
|
48
|
+
en: reported while the less common way is at most {limit}% of the ellipses
|
|
49
|
+
sources: [vale-styles]
|
|
50
|
+
rewrite:
|
|
51
|
+
depth: light
|
|
52
|
+
ja:
|
|
53
|
+
direction: 指した記号だけを、文書の多いほうの書き方に替えてください。ほかは変えません。
|
|
54
|
+
pairs:
|
|
55
|
+
- before: 少々お待ちください・・・。
|
|
56
|
+
after: 少々お待ちください……。
|
|
57
|
+
- before: 結果は...まだです。
|
|
58
|
+
after: 結果は……まだです。
|
|
59
|
+
keep:
|
|
60
|
+
- 記号の前後の文
|
|
61
|
+
avoid:
|
|
62
|
+
- 省略記号を消して文を書き換える
|
|
63
|
+
en:
|
|
64
|
+
direction: Change only the marked ellipsis to the form the rest of the document uses.
|
|
65
|
+
pairs:
|
|
66
|
+
- before: Please wait...
|
|
67
|
+
after: Please wait…
|
|
68
|
+
- before: The answer is . . . not yet known.
|
|
69
|
+
after: The answer is… not yet known.
|
|
70
|
+
keep:
|
|
71
|
+
- the words around the ellipsis
|
|
72
|
+
avoid:
|
|
73
|
+
- dropping the ellipsis or rewriting the sentence
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
id: figurative-density
|
|
2
|
+
layer: L2
|
|
3
|
+
status: stable
|
|
4
|
+
how_to_find: phrase-density
|
|
5
|
+
word_list: figurative-phrase
|
|
6
|
+
uses: [pos]
|
|
7
|
+
severity: info
|
|
8
|
+
|
|
9
|
+
name:
|
|
10
|
+
ja: 飾りのたとえが多い
|
|
11
|
+
en: Too many decorative figures
|
|
12
|
+
|
|
13
|
+
why:
|
|
14
|
+
ja: 「まるで魔法のように動く」「呪文のようなコマンド」「おまじないとして書く」のようなたとえは、一つなら文に色を付けますが、重なると何がどう動くのかが書かれないまま文書が進みます。読み手は仕組みを知りたいのに、たとえしか受け取れません。一つ一つは誤りではないので、文書の長さあたりの数で見ます。たとえの一覧は語彙表 figurative-phrase にあり、語ごとに代わりに書くことの例が付いています。
|
|
15
|
+
en: 'A figure such as "works like magic", "a one-line incantation" or "our secret sauce" adds colour once. Piled up, the document goes on without saying what actually happens, and a reader who wants the mechanism gets only the figure. None of them is wrong alone, so the rule counts them per length of the document. The figures are in the lexicon figurative-phrase, each with what to write instead.'
|
|
16
|
+
|
|
17
|
+
message:
|
|
18
|
+
ja: 「{matched}」など、飾りのたとえが 1000 字あたり {density} 個あります
|
|
19
|
+
en: '"{matched}" and other decorative figures: {density} per 1000 words'
|
|
20
|
+
|
|
21
|
+
how_to_fix:
|
|
22
|
+
ja: たとえの代わりに、何がどう動くのか、何ができるのかを書いてください(まるで魔法のように設定が済む → 設定ファイルを読んで自動で済ませる)。
|
|
23
|
+
en: Replace the figure with what happens ("the config sets itself up like magic" becomes "the tool reads the config file and fills in the defaults").
|
|
24
|
+
|
|
25
|
+
# 「まるで魔法のように」は一つのたとえに二語が当たるので、既定は 1000 字あたり 2 個まで。
|
|
26
|
+
levels: { strict: 1, normal: 2, relaxed: 3 }
|
|
27
|
+
|
|
28
|
+
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
29
|
+
off_for:
|
|
30
|
+
literature: "Figures are the writer's material in literature."
|
|
31
|
+
speech: "A speaker's figures are part of the talk."
|
|
32
|
+
|
|
33
|
+
group: ai-tells
|
|
34
|
+
summary:
|
|
35
|
+
ja: 「まるで魔法のように」「呪文のような」「おまじない」のような、仕組みの代わりのたとえが多い所
|
|
36
|
+
en: Decorative figures such as "like magic", "incantation" and "secret sauce" piled up in place of the mechanism
|
|
37
|
+
|
|
38
|
+
example:
|
|
39
|
+
ja:
|
|
40
|
+
pad: true
|
|
41
|
+
before: |
|
|
42
|
+
このツールを入れると、まるで魔法のように設定が終わります。最初の一行は呪文のようなものなので、おまじないとして書いておいてください。
|
|
43
|
+
after: |
|
|
44
|
+
このツールを入れると、設定ファイルを読んで既定の値を自動で埋めます。最初の一行は文字コードを指定する行なので、消さずに残してください。
|
|
45
|
+
en:
|
|
46
|
+
pad: true
|
|
47
|
+
before: |
|
|
48
|
+
The installer works like magic. Our secret sauce is a one-line incantation that magically fixes every path.
|
|
49
|
+
after: |
|
|
50
|
+
The installer reads your config file and fills in the defaults. The fix is one command that rewrites every path to an absolute one.
|
|
51
|
+
|
|
52
|
+
not_flagged:
|
|
53
|
+
ja: 一つ一つは誤りではないので、短い文書は測りません。例を挙げる「〜のような」(A や B のような製品)は数えません。文学と講演のジャンルでは止めています。
|
|
54
|
+
en: None of these is wrong alone, so short documents are not measured. A plain comparison or example ("tools such as A and B") is not counted. The literature and speech genres turn it off.
|
|
55
|
+
level_meaning:
|
|
56
|
+
ja: 1000 字あたり飾りのたとえ {limit} 個まで
|
|
57
|
+
en: up to {limit} decorative figures per 1000 words
|
|
58
|
+
|
|
59
|
+
rewrite:
|
|
60
|
+
depth: register
|
|
61
|
+
ja:
|
|
62
|
+
direction: たとえを、何がどう動くのか、何ができるのかの説明に替えてください。語彙表の語ごとの書き換えの例に従い、文書に書かれていない仕組みは作りません。
|
|
63
|
+
pairs:
|
|
64
|
+
- before: このツールを入れると、まるで魔法のように設定が終わります。
|
|
65
|
+
after: このツールを入れると、設定ファイルを読んで既定の値を自動で埋めます。
|
|
66
|
+
- before: 最初の一行はおまじないとして書いておいてください。
|
|
67
|
+
after: 最初の一行は文字コードを指定する行なので、消さずに残してください。
|
|
68
|
+
keep:
|
|
69
|
+
- 書いてある事実と手順
|
|
70
|
+
avoid:
|
|
71
|
+
- 文書に書かれていない仕組みを作って書く
|
|
72
|
+
- たとえを別のたとえに替える
|
|
73
|
+
en:
|
|
74
|
+
direction: Replace each figure with what actually happens or what the thing does, following the lexicon's hint for the phrase. Do not invent a mechanism the document does not give.
|
|
75
|
+
pairs:
|
|
76
|
+
- before: The installer works like magic.
|
|
77
|
+
after: The installer reads your config file and fills in the defaults.
|
|
78
|
+
- before: Our secret sauce is a one-line incantation that fixes every path.
|
|
79
|
+
after: The fix is one command that rewrites every path to an absolute one.
|
|
80
|
+
keep:
|
|
81
|
+
- the facts and steps the document gives
|
|
82
|
+
avoid:
|
|
83
|
+
- inventing a mechanism the document does not describe
|
|
84
|
+
- swapping one figure for another
|
|
@@ -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,111 @@
|
|
|
1
|
+
id: numbered-generic-heading
|
|
2
|
+
layer: L1
|
|
3
|
+
status: stable
|
|
4
|
+
how_to_find: generic-heading
|
|
5
|
+
word_list: generic-heading-label
|
|
6
|
+
requires: [markdown]
|
|
7
|
+
severity: info
|
|
8
|
+
|
|
9
|
+
name:
|
|
10
|
+
ja: 札と番号だけの見出し
|
|
11
|
+
en: Headings that are only a label and a number
|
|
12
|
+
|
|
13
|
+
why:
|
|
14
|
+
ja: 「メリット1」「メリット2」「ポイント3」のように札と番号だけの見出しは、目次や見出しの一覧で読んでも、その節に何が書いてあるかが分かりません。読み手は節を開くまで中身を知れず、あとで探すこともできません。型をなぞって書いた文書に多い形です。札は語彙表 generic-heading-label にあり、手順の札(ステップ1)は順番そのものが中身なので入れていません。
|
|
15
|
+
en: 'Headings such as "Benefit 1", "Benefit 2" and "Tip 3" say nothing about their sections. A reader scanning the table of contents learns nothing until they open each one, and cannot find a section again later. Documents written to a template are full of them. The labels are in the lexicon generic-heading-label; step labels ("Step 1") are left out, since in a procedure the order is the content.'
|
|
16
|
+
|
|
17
|
+
message:
|
|
18
|
+
ja: 見出し「{heading}」は札と番号だけで、節の中身が分かりません(そういう見出しが {count} 個)
|
|
19
|
+
en: 'The heading "{heading}" is only a label and a number and says nothing about the section ({count} such headings)'
|
|
20
|
+
|
|
21
|
+
how_to_fix:
|
|
22
|
+
ja: 札の後ろに、その節で言うことを書いてください(メリット1 → メリット1:設定が要らない、または 設定が要らない)。
|
|
23
|
+
en: 'Say what the section says ("Benefit 1" becomes "Benefit 1: no setup" or simply "No setup needed").'
|
|
24
|
+
|
|
25
|
+
levels: { strict: 1, normal: 2, relaxed: 3 }
|
|
26
|
+
|
|
27
|
+
use_for: [blog, business, technical, docs, academic, legal, literature, speech]
|
|
28
|
+
off_for:
|
|
29
|
+
literature: "A literary work names its parts as it likes."
|
|
30
|
+
speech: "A transcript has no headings of its own."
|
|
31
|
+
|
|
32
|
+
group: structure
|
|
33
|
+
summary:
|
|
34
|
+
ja: 「メリット1」「ポイント2」「Benefit 3」のように、札と番号だけで中身を言わない見出しが並ぶ所
|
|
35
|
+
en: Headings such as "Benefit 1" and "Tip 2" that are only a label and a number
|
|
36
|
+
|
|
37
|
+
example:
|
|
38
|
+
ja:
|
|
39
|
+
before: |
|
|
40
|
+
# 新しい会議室予約の仕組み
|
|
41
|
+
|
|
42
|
+
## メリット1
|
|
43
|
+
|
|
44
|
+
空き状況がすぐ分かります。
|
|
45
|
+
|
|
46
|
+
## メリット2
|
|
47
|
+
|
|
48
|
+
予約の取り消しが一度で済みます。
|
|
49
|
+
after: |
|
|
50
|
+
# 新しい会議室予約の仕組み
|
|
51
|
+
|
|
52
|
+
## 空き状況がすぐ分かる
|
|
53
|
+
|
|
54
|
+
空き状況がすぐ分かります。
|
|
55
|
+
|
|
56
|
+
## 取り消しが一度で済む
|
|
57
|
+
|
|
58
|
+
予約の取り消しが一度で済みます。
|
|
59
|
+
en:
|
|
60
|
+
before: |
|
|
61
|
+
# The new room booking system
|
|
62
|
+
|
|
63
|
+
## Benefit 1
|
|
64
|
+
|
|
65
|
+
You can see free rooms at once.
|
|
66
|
+
|
|
67
|
+
## Benefit 2
|
|
68
|
+
|
|
69
|
+
You can cancel a booking in one step.
|
|
70
|
+
after: |
|
|
71
|
+
# The new room booking system
|
|
72
|
+
|
|
73
|
+
## Free rooms at a glance
|
|
74
|
+
|
|
75
|
+
You can see free rooms at once.
|
|
76
|
+
|
|
77
|
+
## One-step cancelling
|
|
78
|
+
|
|
79
|
+
You can cancel a booking in one step.
|
|
80
|
+
|
|
81
|
+
not_flagged:
|
|
82
|
+
ja: 札の後ろに題を足した見出し(メリット1:設定が要らない)、手順・理由・課題の見出し(ステップ1、理由2、課題3)、章や節の番号(第1章)は、番号で引かれる単位なので指しません。Markdown の見出しだけを読みます。
|
|
83
|
+
en: 'A heading with a title after the label ("Benefit 1: no setup"), step, lesson, reason and feature headings ("Step 1", "Lesson 2", "Reason 3"), and chapter or section numbers ("Chapter 1") are not reported: each is a unit cited by its number. Only Markdown headings are read.'
|
|
84
|
+
level_meaning:
|
|
85
|
+
ja: 札と番号だけの見出しが {limit} 個から指摘
|
|
86
|
+
en: reported from {limit} such headings
|
|
87
|
+
|
|
88
|
+
rewrite:
|
|
89
|
+
depth: structure
|
|
90
|
+
ja:
|
|
91
|
+
direction: 札と番号だけの見出しに、その節で言うことを一言で書いてください。節の本文から言葉を取り、本文に無いことは足しません。
|
|
92
|
+
pairs:
|
|
93
|
+
- before: "## メリット1"
|
|
94
|
+
after: "## 空き状況がすぐ分かる"
|
|
95
|
+
- before: "## ポイント2"
|
|
96
|
+
after: "## 取り消しは前日まで"
|
|
97
|
+
keep:
|
|
98
|
+
- 節の順番と本文
|
|
99
|
+
avoid:
|
|
100
|
+
- 本文に書かれていない中身を見出しに書く
|
|
101
|
+
en:
|
|
102
|
+
direction: Give each label-and-number heading a few words that say what its section says, taken from the section itself.
|
|
103
|
+
pairs:
|
|
104
|
+
- before: "## Benefit 1"
|
|
105
|
+
after: "## Free rooms at a glance"
|
|
106
|
+
- before: "## Tip 2"
|
|
107
|
+
after: "## Cancel by the day before"
|
|
108
|
+
keep:
|
|
109
|
+
- the order of the sections and their text
|
|
110
|
+
avoid:
|
|
111
|
+
- putting a claim in a heading that the section does not make
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
id: unit-spacing-consistency
|
|
2
|
+
layer: L2
|
|
3
|
+
status: stable
|
|
4
|
+
how_to_find: unit-spacing-consistency
|
|
5
|
+
severity: info
|
|
6
|
+
|
|
7
|
+
name:
|
|
8
|
+
ja: 数と単位の間の空白が混ざっている
|
|
9
|
+
en: Units spaced two ways
|
|
10
|
+
|
|
11
|
+
why:
|
|
12
|
+
ja: 一つの文書で「5 GB」と「5GB」のように、数と単位記号の間を空ける所と詰める所が混ざると、読み手は違いに意味があるのかと迷い、別々の所から貼り合わせた文書に見えます。検索でも片方を取りこぼします。どちらが正しいかは決めず、単位ごとに、文書の中で少ないほうを指します。
|
|
13
|
+
en: 'A document writing "5 GB" in one place and "5GB" in another makes the reader wonder whether the difference means something, looks pasted together, and splits a search. chaff does not pick a side; unit by unit, it points at the way the document uses less.'
|
|
14
|
+
|
|
15
|
+
message:
|
|
16
|
+
ja: 「{written}」と書いています(この文書はこの単位をふつう「{usual}」のように書きます。{of} 箇所のうち {count} 箇所が違う)
|
|
17
|
+
en: '"{written}" here, where the document usually writes this unit like "{usual}" ({count} of {of})'
|
|
18
|
+
|
|
19
|
+
how_to_fix:
|
|
20
|
+
ja: 文書の多いほうの書き方に合わせてください。
|
|
21
|
+
en: Match the way the rest of the document writes units.
|
|
22
|
+
|
|
23
|
+
# 少ないほうが、数と単位の組の何パーセントまでなら「混ざっている」と見るか。これを超えたら、文書が使い分けている。
|
|
24
|
+
levels: { strict: 49, normal: 34, relaxed: 20 }
|
|
25
|
+
|
|
26
|
+
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
27
|
+
|
|
28
|
+
group: consistency
|
|
29
|
+
summary:
|
|
30
|
+
ja: 「5 GB」と「5GB」のように、一つの文書で数と単位記号の間を空けたり詰めたりしている所
|
|
31
|
+
en: A number and a unit symbol spaced in some places and not in others, such as "5 GB" and "5GB"
|
|
32
|
+
example:
|
|
33
|
+
ja:
|
|
34
|
+
before: |
|
|
35
|
+
容量は 5 GB、転送量は 10 GB、上限は 20GB です。
|
|
36
|
+
after: |
|
|
37
|
+
容量は 5 GB、転送量は 10 GB、上限は 20 GB です。
|
|
38
|
+
en:
|
|
39
|
+
before: |
|
|
40
|
+
Storage is 5 GB, transfer is 10 GB and the cap is 20GB.
|
|
41
|
+
after: |
|
|
42
|
+
Storage is 5 GB, transfer is 10 GB and the cap is 20 GB.
|
|
43
|
+
|
|
44
|
+
not_flagged:
|
|
45
|
+
ja: 単位記号の一覧にあるものだけを見ます。一字の記号(m、s、g)、パーセント、温度(°C)は、空けない書き方が別に定着しているので数えません。語で書いた単位(5 時間、5 hours)、コードの中、版や番地の中の数(1.2.3GB)も見ません。単位ごとに比べるので、「5 GB」と「500ms」が並んでも混在とは読みません。ノーブレークスペースも空白と数えます。少ないほうが 3 分の 1 を超える文書や、二通りが同じ数の文書は、使い分けていると読んで指しません。
|
|
46
|
+
en: Only the unit symbols on chaff's list are read. One-letter symbols (m, s, g), the percent sign and temperatures (°C) are left out, since many styles write them unspaced on purpose. Units written as words (5 hours), code, and numbers inside versions or addresses (1.2.3GB) are not read. Each unit is compared with itself, so "5 GB" next to "500ms" is not a mix. A no-break space counts as a space. When the less common way is over a third, or the two are equally common, the document is read as using both on purpose.
|
|
47
|
+
level_meaning:
|
|
48
|
+
ja: 少ないほうが {limit}% までなら指摘
|
|
49
|
+
en: reported while the less common way is at most {limit}% of the units
|
|
50
|
+
sources: [vale-styles]
|
|
51
|
+
rewrite:
|
|
52
|
+
depth: light
|
|
53
|
+
ja:
|
|
54
|
+
direction: 指した所だけ、数と単位の間を文書の多いほうに合わせてください。ほかは変えません。
|
|
55
|
+
pairs:
|
|
56
|
+
- before: 上限は 20GB です。
|
|
57
|
+
after: 上限は 20 GB です。
|
|
58
|
+
- before: 間隔は 500 ms です。
|
|
59
|
+
after: 間隔は 500ms です。
|
|
60
|
+
keep:
|
|
61
|
+
- 数と単位そのもの
|
|
62
|
+
avoid:
|
|
63
|
+
- 単位を別の単位に換える
|
|
64
|
+
en:
|
|
65
|
+
direction: Add or remove the space between the number and the unit at the marked place only, to match the rest of the document.
|
|
66
|
+
pairs:
|
|
67
|
+
- before: The cap is 20GB.
|
|
68
|
+
after: The cap is 20 GB.
|
|
69
|
+
- before: The interval is 500 ms.
|
|
70
|
+
after: The interval is 500ms.
|
|
71
|
+
keep:
|
|
72
|
+
- the number and the unit
|
|
73
|
+
avoid:
|
|
74
|
+
- converting the unit
|
package/skills/chaff/SKILL.md
CHANGED
|
@@ -23,6 +23,10 @@ read. A contract checked as a blog post gets wrong findings, so choose the genre
|
|
|
23
23
|
`npx chaffjs init --genre legal/contract` writes it into `chaff.yaml` (always pass `--genre`: without it,
|
|
24
24
|
`init` asks at a terminal).
|
|
25
25
|
4. The header's first line shows the genre used and where it came from. Check it before trusting the findings.
|
|
26
|
+
5. With the genre set, the report opens with the genre's guide: what a good document of that kind does, and the
|
|
27
|
+
rules that matter most for it. Read it first, before any finding, and hold the draft (or your rewrite) to each
|
|
28
|
+
line; most of it is what no rule can check. The team may have changed it with `guide:` in `chaff.yaml`. A
|
|
29
|
+
guessed or default genre shows no guide.
|
|
26
30
|
|
|
27
31
|
A rule the genre turns off is listed under "did not run" with the genre as the reason. That is the preset's
|
|
28
32
|
choice, not a gap; turn it back on (`rules:` in `chaff.yaml`) only when the person asks.
|
|
@@ -112,6 +116,8 @@ generated. chaff never rewrites; the rewriting is yours.
|
|
|
112
116
|
**Start with the plan.** Run `npx chaffjs fix-plan <file>` (with the genre's `--genre`; `--json` to
|
|
113
117
|
read it as data). It prints, in the document's language:
|
|
114
118
|
|
|
119
|
+
- the genre's guide first, when the genre is set: what a good document of the kind does, the lines your rewrite
|
|
120
|
+
is held to;
|
|
115
121
|
- the constraints: keep facts, numbers, conditions and names; add no fact; ask the writer instead of inventing a
|
|
116
122
|
specific; two passes at most;
|
|
117
123
|
- the recommended mode and why, and the document-level signals with the outline's numbers;
|
package/src/api.ts
CHANGED
|
@@ -138,6 +138,15 @@ export const defineRule = (spec: RuleSpec): Rule => ({ ...spec, apiVersion: API_
|
|
|
138
138
|
/** A word list in each language it has words for: { ja: [...], en: [...] }. A string is an entry with only a pattern. */
|
|
139
139
|
export type LexiconSpec = Readonly<Record<string, readonly (string | LexiconEntry)[]>>;
|
|
140
140
|
|
|
141
|
+
/** Lines of a genre guide: one line or a list, the same in every language, or by language ({ ja: [...], en: [...] }). */
|
|
142
|
+
export type GuideText = string | readonly string[] | Readonly<Record<string, string | readonly string[]>>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Changes to the genre guides chaff prints before the findings, by genre or group (blog/tech, legal): replace sets the
|
|
146
|
+
* lines, add puts lines after them, off leaves the genre with none.
|
|
147
|
+
*/
|
|
148
|
+
export type GuideSpec = Readonly<Record<string, "off" | { readonly replace?: GuideText; readonly add?: GuideText }>>;
|
|
149
|
+
|
|
141
150
|
/** A house style a plugin ships: rule levels and options, and the guideline it follows. */
|
|
142
151
|
export type StyleSpec = {
|
|
143
152
|
readonly id: string;
|
|
@@ -146,6 +155,8 @@ export type StyleSpec = {
|
|
|
146
155
|
readonly source: { readonly title: Text; readonly url: string };
|
|
147
156
|
readonly rules?: Readonly<Record<string, "strict" | "normal" | "relaxed" | "off">>;
|
|
148
157
|
readonly options?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
158
|
+
/** Its changes to the genre guides, while the style is chosen. */
|
|
159
|
+
readonly guide?: GuideSpec;
|
|
149
160
|
};
|
|
150
161
|
|
|
151
162
|
/**
|
|
@@ -158,6 +169,8 @@ export type PluginSpec = {
|
|
|
158
169
|
readonly rules?: readonly (Rule | RuleSpec | Readonly<Record<string, unknown>>)[];
|
|
159
170
|
readonly lexicons?: Readonly<Record<string, LexiconSpec>>;
|
|
160
171
|
readonly styles?: readonly StyleSpec[];
|
|
172
|
+
/** Its changes to the genre guides, whenever the plugin is loaded. */
|
|
173
|
+
readonly guide?: GuideSpec;
|
|
161
174
|
};
|
|
162
175
|
|
|
163
176
|
export type Plugin = PluginSpec & { readonly apiVersion: number };
|
package/src/cli-args.ts
CHANGED
|
@@ -14,6 +14,9 @@ export const withExperimental = <T extends { readonly experimental: boolean }>(c
|
|
|
14
14
|
experimental: config.experimental || args.includes("--experimental"),
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
+
/** Whether this run shows the genre's guide: everywhere it would, unless --no-guide leaves it out. */
|
|
18
|
+
export const showsGuide = (args: readonly string[]): boolean => !args.includes("--no-guide");
|
|
19
|
+
|
|
17
20
|
/** The settings with each --include <glob> added to chaff.yaml's include: the command line widens a directory walk as chaff.yaml can. */
|
|
18
21
|
export const withIncludes = <T extends { readonly include?: readonly string[] | undefined }>(config: T, args: readonly string[]): T => {
|
|
19
22
|
const given = args.flatMap((arg, index) => (index > 0 && args[index - 1] === "--include" && !arg.startsWith("--") ? [arg] : []));
|
package/src/cli-text.ts
CHANGED
|
@@ -56,6 +56,7 @@ const USAGE_JA = `chaff — 文章の読みにくいところを見つけます
|
|
|
56
56
|
誤った指摘・見逃しの報告の下書きを作る(何も送らない。--with-config で chaff.yaml 全体も載せる)
|
|
57
57
|
|
|
58
58
|
--compact エンジニア向けの 1 行形式
|
|
59
|
+
--no-guide ジャンルを決めたときに最初に出す、そのジャンルの指針を出さない
|
|
59
60
|
--experimental 試験中の rule も動かす
|
|
60
61
|
--genre <ジャンル> この実行だけジャンルを決める(chaff.yaml より優先)
|
|
61
62
|
--show-baseline 棚上げした分も含めて全部見る
|
|
@@ -101,6 +102,7 @@ const USAGE_EN = `chaff — finds what makes writing hard to read. It never rewr
|
|
|
101
102
|
draft a report of a wrong or missed finding (sends nothing; --with-config adds all of chaff.yaml)
|
|
102
103
|
|
|
103
104
|
--compact one line per finding, for engineers
|
|
105
|
+
--no-guide leave out the genre's guide, which comes first when the genre is set
|
|
104
106
|
--experimental run the experimental rules too
|
|
105
107
|
--genre <genre> the genre for this run only (wins over chaff.yaml)
|
|
106
108
|
--show-baseline show the shelved findings too
|