chaffjs 0.17.0 → 0.19.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 +52 -56
- package/bin/chaff.js +17 -2
- package/dist/acronym-expansions.d.ts +26 -0
- package/dist/acronym-expansions.d.ts.map +1 -0
- package/dist/acronym-expansions.js +88 -0
- package/dist/acronym-expansions.js.map +1 -0
- package/dist/announced-count.d.ts +26 -0
- package/dist/announced-count.d.ts.map +1 -0
- package/dist/announced-count.js +138 -0
- package/dist/announced-count.js.map +1 -0
- package/dist/announced-list.d.ts +30 -0
- package/dist/announced-list.d.ts.map +1 -0
- package/dist/announced-list.js +95 -0
- package/dist/announced-list.js.map +1 -0
- package/dist/api.d.ts +168 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +10 -0
- package/dist/api.js.map +1 -0
- package/dist/bare-url.d.ts +14 -0
- package/dist/bare-url.d.ts.map +1 -0
- package/dist/bare-url.js +28 -0
- package/dist/bare-url.js.map +1 -0
- package/dist/baseline.d.ts +5 -0
- package/dist/baseline.d.ts.map +1 -1
- package/dist/baseline.js +16 -1
- package/dist/baseline.js.map +1 -1
- package/dist/body-section.d.ts +7 -0
- package/dist/body-section.d.ts.map +1 -0
- package/dist/body-section.js +6 -0
- package/dist/body-section.js.map +1 -0
- package/dist/calendar-number.d.ts +2 -0
- package/dist/calendar-number.d.ts.map +1 -1
- package/dist/calendar-number.js +9 -2
- package/dist/calendar-number.js.map +1 -1
- package/dist/cli-args.d.ts +4 -0
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +5 -0
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-text.d.ts +0 -1
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +14 -18
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +83 -84
- package/dist/cli.js.map +1 -1
- package/dist/closing-paragraph.d.ts +7 -0
- package/dist/closing-paragraph.d.ts.map +1 -0
- package/dist/closing-paragraph.js +22 -0
- package/dist/closing-paragraph.js.map +1 -0
- package/dist/commands/compare.d.ts +15 -0
- package/dist/commands/compare.d.ts.map +1 -0
- package/dist/commands/compare.js +64 -0
- package/dist/commands/compare.js.map +1 -0
- package/dist/commands/document-commands.d.ts +9 -0
- package/dist/commands/document-commands.d.ts.map +1 -0
- package/dist/commands/document-commands.js +17 -0
- package/dist/commands/document-commands.js.map +1 -0
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +19 -10
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/facts.d.ts +8 -0
- package/dist/commands/facts.d.ts.map +1 -0
- package/dist/commands/facts.js +30 -0
- package/dist/commands/facts.js.map +1 -0
- package/dist/commands/feedback.d.ts +15 -2
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +36 -6
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/fix-plan.d.ts +13 -0
- package/dist/commands/fix-plan.d.ts.map +1 -0
- package/dist/commands/fix-plan.js +44 -0
- package/dist/commands/fix-plan.js.map +1 -0
- package/dist/commands/outline.d.ts +8 -0
- package/dist/commands/outline.d.ts.map +1 -0
- package/dist/commands/outline.js +43 -0
- package/dist/commands/outline.js.map +1 -0
- package/dist/commands/read-document.d.ts +14 -0
- package/dist/commands/read-document.d.ts.map +1 -0
- package/dist/commands/read-document.js +21 -0
- package/dist/commands/read-document.js.map +1 -0
- package/dist/commands/suppressions.d.ts +7 -0
- package/dist/commands/suppressions.d.ts.map +1 -0
- package/dist/commands/suppressions.js +9 -0
- package/dist/commands/suppressions.js.map +1 -0
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +3 -5
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/tree.d.ts +13 -0
- package/dist/commands/tree.d.ts.map +1 -1
- package/dist/commands/tree.js +35 -5
- package/dist/commands/tree.js.map +1 -1
- package/dist/compare/atom.d.ts +31 -0
- package/dist/compare/atom.d.ts.map +1 -0
- package/dist/compare/atom.js +4 -0
- package/dist/compare/atom.js.map +1 -0
- package/dist/compare/clock-time.d.ts +8 -0
- package/dist/compare/clock-time.d.ts.map +1 -0
- package/dist/compare/clock-time.js +68 -0
- package/dist/compare/clock-time.js.map +1 -0
- package/dist/compare/distinct.d.ts +9 -0
- package/dist/compare/distinct.d.ts.map +1 -0
- package/dist/compare/distinct.js +12 -0
- package/dist/compare/distinct.js.map +1 -0
- package/dist/compare/extract.d.ts +15 -0
- package/dist/compare/extract.d.ts.map +1 -0
- package/dist/compare/extract.js +60 -0
- package/dist/compare/extract.js.map +1 -0
- package/dist/compare/fact-key.d.ts +17 -0
- package/dist/compare/fact-key.d.ts.map +1 -0
- package/dist/compare/fact-key.js +25 -0
- package/dist/compare/fact-key.js.map +1 -0
- package/dist/compare/fact-text.d.ts +28 -0
- package/dist/compare/fact-text.d.ts.map +1 -0
- package/dist/compare/fact-text.js +61 -0
- package/dist/compare/fact-text.js.map +1 -0
- package/dist/compare/facts-render.d.ts +17 -0
- package/dist/compare/facts-render.d.ts.map +1 -0
- package/dist/compare/facts-render.js +43 -0
- package/dist/compare/facts-render.js.map +1 -0
- package/dist/compare/facts-text.d.ts +15 -0
- package/dist/compare/facts-text.d.ts.map +1 -0
- package/dist/compare/facts-text.js +27 -0
- package/dist/compare/facts-text.js.map +1 -0
- package/dist/compare/markup-atoms.d.ts +11 -0
- package/dist/compare/markup-atoms.d.ts.map +1 -0
- package/dist/compare/markup-atoms.js +23 -0
- package/dist/compare/markup-atoms.js.map +1 -0
- package/dist/compare/match.d.ts +20 -0
- package/dist/compare/match.d.ts.map +1 -0
- package/dist/compare/match.js +84 -0
- package/dist/compare/match.js.map +1 -0
- package/dist/compare/outcome.d.ts +36 -0
- package/dist/compare/outcome.d.ts.map +1 -0
- package/dist/compare/outcome.js +46 -0
- package/dist/compare/outcome.js.map +1 -0
- package/dist/compare/proper-nouns.d.ts +19 -0
- package/dist/compare/proper-nouns.d.ts.map +1 -0
- package/dist/compare/proper-nouns.js +43 -0
- package/dist/compare/proper-nouns.js.map +1 -0
- package/dist/compare/render.d.ts +13 -0
- package/dist/compare/render.d.ts.map +1 -0
- package/dist/compare/render.js +64 -0
- package/dist/compare/render.js.map +1 -0
- package/dist/compare/spans.d.ts +9 -0
- package/dist/compare/spans.d.ts.map +1 -0
- package/dist/compare/spans.js +11 -0
- package/dist/compare/spans.js.map +1 -0
- package/dist/compare/text-atoms.d.ts +27 -0
- package/dist/compare/text-atoms.d.ts.map +1 -0
- package/dist/compare/text-atoms.js +69 -0
- package/dist/compare/text-atoms.js.map +1 -0
- package/dist/compare/text.d.ts +24 -0
- package/dist/compare/text.d.ts.map +1 -0
- package/dist/compare/text.js +90 -0
- package/dist/compare/text.js.map +1 -0
- package/dist/compare/tree-atoms.d.ts +20 -0
- package/dist/compare/tree-atoms.d.ts.map +1 -0
- package/dist/compare/tree-atoms.js +58 -0
- package/dist/compare/tree-atoms.js.map +1 -0
- package/dist/compare/written-names.d.ts +8 -0
- package/dist/compare/written-names.d.ts.map +1 -0
- package/dist/compare/written-names.js +24 -0
- package/dist/compare/written-names.js.map +1 -0
- package/dist/config/load.d.ts +23 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +6 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/option-problems.d.ts +17 -0
- package/dist/config/option-problems.d.ts.map +1 -0
- package/dist/config/option-problems.js +59 -0
- package/dist/config/option-problems.js.map +1 -0
- package/dist/config/read.d.ts +4 -0
- package/dist/config/read.d.ts.map +1 -0
- package/dist/config/read.js +8 -0
- package/dist/config/read.js.map +1 -0
- package/dist/config/rule-problems.d.ts +2 -4
- package/dist/config/rule-problems.d.ts.map +1 -1
- package/dist/config/rule-problems.js +7 -1
- package/dist/config/rule-problems.js.map +1 -1
- package/dist/config/style.d.ts +21 -0
- package/dist/config/style.d.ts.map +1 -0
- package/dist/config/style.js +48 -0
- package/dist/config/style.js.map +1 -0
- package/dist/config/warnings.d.ts +6 -0
- package/dist/config/warnings.d.ts.map +1 -0
- package/dist/config/warnings.js +10 -0
- package/dist/config/warnings.js.map +1 -0
- package/dist/config/write.d.ts.map +1 -1
- package/dist/config/write.js +17 -4
- package/dist/config/write.js.map +1 -1
- package/dist/custom/bounded-match.d.ts +15 -0
- package/dist/custom/bounded-match.d.ts.map +1 -0
- package/dist/custom/bounded-match.js +43 -0
- package/dist/custom/bounded-match.js.map +1 -0
- package/dist/custom/load.d.ts +11 -0
- package/dist/custom/load.d.ts.map +1 -0
- package/dist/custom/load.js +19 -0
- package/dist/custom/load.js.map +1 -0
- package/dist/custom/module-path.d.ts +11 -0
- package/dist/custom/module-path.d.ts.map +1 -0
- package/dist/custom/module-path.js +15 -0
- package/dist/custom/module-path.js.map +1 -0
- package/dist/custom/parse.d.ts +84 -0
- package/dist/custom/parse.d.ts.map +1 -0
- package/dist/custom/parse.js +258 -0
- package/dist/custom/parse.js.map +1 -0
- package/dist/custom/problems.d.ts +8 -0
- package/dist/custom/problems.d.ts.map +1 -0
- package/dist/custom/problems.js +95 -0
- package/dist/custom/problems.js.map +1 -0
- package/dist/custom/regex-safety.d.ts +11 -0
- package/dist/custom/regex-safety.d.ts.map +1 -0
- package/dist/custom/regex-safety.js +110 -0
- package/dist/custom/regex-safety.js.map +1 -0
- package/dist/custom/token-pattern.d.ts +8 -0
- package/dist/custom/token-pattern.d.ts.map +1 -0
- package/dist/custom/token-pattern.js +75 -0
- package/dist/custom/token-pattern.js.map +1 -0
- package/dist/detect-language.js +1 -1
- package/dist/detect.d.ts.map +1 -1
- package/dist/detect.js +30 -2
- package/dist/detect.js.map +1 -1
- package/dist/detectors/acronym-context.d.ts +2 -0
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +12 -4
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/ai-phrasing.d.ts +23 -0
- package/dist/detectors/ai-phrasing.d.ts.map +1 -0
- package/dist/detectors/ai-phrasing.js +116 -0
- package/dist/detectors/ai-phrasing.js.map +1 -0
- package/dist/detectors/announced-count.d.ts +4 -0
- package/dist/detectors/announced-count.d.ts.map +1 -0
- package/dist/detectors/announced-count.js +20 -0
- package/dist/detectors/announced-count.js.map +1 -0
- package/dist/detectors/bold-label.d.ts +10 -0
- package/dist/detectors/bold-label.d.ts.map +1 -0
- package/dist/detectors/bold-label.js +44 -0
- package/dist/detectors/bold-label.js.map +1 -0
- package/dist/detectors/broken-link.d.ts +17 -0
- package/dist/detectors/broken-link.d.ts.map +1 -0
- package/dist/detectors/broken-link.js +66 -0
- package/dist/detectors/broken-link.js.map +1 -0
- package/dist/detectors/cited-name.d.ts.map +1 -1
- package/dist/detectors/cited-name.js +4 -4
- package/dist/detectors/cited-name.js.map +1 -1
- package/dist/detectors/cited-title.d.ts +11 -0
- package/dist/detectors/cited-title.d.ts.map +1 -0
- package/dist/detectors/cited-title.js +75 -0
- package/dist/detectors/cited-title.js.map +1 -0
- package/dist/detectors/concrete-evidence.d.ts +1 -1
- package/dist/detectors/concrete-evidence.d.ts.map +1 -1
- package/dist/detectors/concrete-evidence.js +2 -1
- package/dist/detectors/concrete-evidence.js.map +1 -1
- package/dist/detectors/contrast-frame.d.ts +17 -0
- package/dist/detectors/contrast-frame.d.ts.map +1 -0
- package/dist/detectors/contrast-frame.js +32 -0
- package/dist/detectors/contrast-frame.js.map +1 -0
- package/dist/detectors/custom.d.ts +8 -0
- package/dist/detectors/custom.d.ts.map +1 -0
- package/dist/detectors/custom.js +71 -0
- package/dist/detectors/custom.js.map +1 -0
- package/dist/detectors/dangling-figure.d.ts +7 -0
- package/dist/detectors/dangling-figure.d.ts.map +1 -0
- package/dist/detectors/dangling-figure.js +20 -0
- package/dist/detectors/dangling-figure.js.map +1 -0
- package/dist/detectors/definition-use.d.ts +8 -0
- package/dist/detectors/definition-use.d.ts.map +1 -0
- package/dist/detectors/definition-use.js +32 -0
- package/dist/detectors/definition-use.js.map +1 -0
- package/dist/detectors/doubled-punctuation.d.ts +9 -0
- package/dist/detectors/doubled-punctuation.d.ts.map +1 -0
- package/dist/detectors/doubled-punctuation.js +35 -0
- package/dist/detectors/doubled-punctuation.js.map +1 -0
- package/dist/detectors/doubled-word.d.ts +5 -0
- package/dist/detectors/doubled-word.d.ts.map +1 -1
- package/dist/detectors/doubled-word.js +24 -11
- package/dist/detectors/doubled-word.js.map +1 -1
- package/dist/detectors/duplicate-heading.d.ts +14 -0
- package/dist/detectors/duplicate-heading.d.ts.map +1 -0
- package/dist/detectors/duplicate-heading.js +39 -0
- package/dist/detectors/duplicate-heading.js.map +1 -0
- package/dist/detectors/empty-section.d.ts +8 -0
- package/dist/detectors/empty-section.d.ts.map +1 -0
- package/dist/detectors/empty-section.js +16 -0
- package/dist/detectors/empty-section.js.map +1 -0
- package/dist/detectors/enumerated-runs.d.ts +1 -1
- package/dist/detectors/enumerated-runs.d.ts.map +1 -1
- package/dist/detectors/enumerated-runs.js +15 -4
- package/dist/detectors/enumerated-runs.js.map +1 -1
- package/dist/detectors/fullwidth-alnum.d.ts +24 -0
- package/dist/detectors/fullwidth-alnum.d.ts.map +1 -0
- package/dist/detectors/fullwidth-alnum.js +88 -0
- package/dist/detectors/fullwidth-alnum.js.map +1 -0
- package/dist/detectors/gram-furniture.d.ts +6 -0
- package/dist/detectors/gram-furniture.d.ts.map +1 -0
- package/dist/detectors/gram-furniture.js +21 -0
- package/dist/detectors/gram-furniture.js.map +1 -0
- package/dist/detectors/gram-place.d.ts +2 -0
- package/dist/detectors/gram-place.d.ts.map +1 -1
- package/dist/detectors/gram-place.js +9 -7
- package/dist/detectors/gram-place.js.map +1 -1
- package/dist/detectors/gram-windows.d.ts +9 -0
- package/dist/detectors/gram-windows.d.ts.map +1 -0
- package/dist/detectors/gram-windows.js +27 -0
- package/dist/detectors/gram-windows.js.map +1 -0
- package/dist/detectors/hankaku-kana.d.ts +9 -0
- package/dist/detectors/hankaku-kana.d.ts.map +1 -0
- package/dist/detectors/hankaku-kana.js +27 -0
- package/dist/detectors/hankaku-kana.js.map +1 -0
- package/dist/detectors/heading-case.d.ts +2 -0
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +29 -2
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/heading-code-words.d.ts +6 -0
- package/dist/detectors/heading-code-words.d.ts.map +1 -0
- package/dist/detectors/heading-code-words.js +29 -0
- package/dist/detectors/heading-code-words.js.map +1 -0
- package/dist/detectors/heading-echo.d.ts.map +1 -1
- package/dist/detectors/heading-echo.js +7 -4
- package/dist/detectors/heading-echo.js.map +1 -1
- package/dist/detectors/heading-level-skip.d.ts +12 -0
- package/dist/detectors/heading-level-skip.d.ts.map +1 -0
- package/dist/detectors/heading-level-skip.js +11 -0
- package/dist/detectors/heading-level-skip.js.map +1 -0
- package/dist/detectors/image-alt-text.d.ts +3 -0
- package/dist/detectors/image-alt-text.d.ts.map +1 -0
- package/dist/detectors/image-alt-text.js +9 -0
- package/dist/detectors/image-alt-text.js.map +1 -0
- package/dist/detectors/index.d.ts.map +1 -1
- package/dist/detectors/index.js +70 -1
- package/dist/detectors/index.js.map +1 -1
- package/dist/detectors/invisible-character.d.ts +20 -0
- package/dist/detectors/invisible-character.d.ts.map +1 -0
- package/dist/detectors/invisible-character.js +143 -0
- package/dist/detectors/invisible-character.js.map +1 -0
- package/dist/detectors/kutoten-consistency.d.ts +24 -0
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -0
- package/dist/detectors/kutoten-consistency.js +77 -0
- package/dist/detectors/kutoten-consistency.js.map +1 -0
- package/dist/detectors/lead-in.d.ts +1 -0
- package/dist/detectors/lead-in.d.ts.map +1 -1
- package/dist/detectors/lead-in.js +2 -1
- package/dist/detectors/lead-in.js.map +1 -1
- package/dist/detectors/lexicon-match.d.ts +14 -1
- package/dist/detectors/lexicon-match.d.ts.map +1 -1
- package/dist/detectors/lexicon-match.js +32 -2
- package/dist/detectors/lexicon-match.js.map +1 -1
- package/dist/detectors/lexicon.d.ts +6 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +31 -13
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/list-item.d.ts +45 -0
- package/dist/detectors/list-item.d.ts.map +1 -0
- package/dist/detectors/list-item.js +88 -0
- package/dist/detectors/list-item.js.map +1 -0
- package/dist/detectors/list-items.d.ts +31 -0
- package/dist/detectors/list-items.d.ts.map +1 -0
- package/dist/detectors/list-items.js +113 -0
- package/dist/detectors/list-items.js.map +1 -0
- package/dist/detectors/list-lead-in.d.ts +7 -0
- package/dist/detectors/list-lead-in.d.ts.map +1 -0
- package/dist/detectors/list-lead-in.js +28 -0
- package/dist/detectors/list-lead-in.js.map +1 -0
- package/dist/detectors/list-sentence.d.ts +67 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -0
- package/dist/detectors/list-sentence.js +130 -0
- package/dist/detectors/list-sentence.js.map +1 -0
- package/dist/detectors/list-view.d.ts +34 -0
- package/dist/detectors/list-view.d.ts.map +1 -0
- package/dist/detectors/list-view.js +137 -0
- package/dist/detectors/list-view.js.map +1 -0
- package/dist/detectors/long-vowel.d.ts +7 -0
- package/dist/detectors/long-vowel.d.ts.map +1 -0
- package/dist/detectors/long-vowel.js +71 -0
- package/dist/detectors/long-vowel.js.map +1 -0
- package/dist/detectors/markup-finding.d.ts +8 -0
- package/dist/detectors/markup-finding.d.ts.map +1 -0
- package/dist/detectors/markup-finding.js +29 -0
- package/dist/detectors/markup-finding.js.map +1 -0
- package/dist/detectors/modal-conflict.d.ts +4 -0
- package/dist/detectors/modal-conflict.d.ts.map +1 -0
- package/dist/detectors/modal-conflict.js +22 -0
- package/dist/detectors/modal-conflict.js.map +1 -0
- package/dist/detectors/name-numeral.d.ts +1 -1
- package/dist/detectors/name-numeral.d.ts.map +1 -1
- package/dist/detectors/name-numeral.js +2 -7
- package/dist/detectors/name-numeral.js.map +1 -1
- package/dist/detectors/name-variant.d.ts +4 -0
- package/dist/detectors/name-variant.d.ts.map +1 -0
- package/dist/detectors/name-variant.js +13 -0
- package/dist/detectors/name-variant.js.map +1 -0
- package/dist/detectors/nominalization.d.ts +11 -0
- package/dist/detectors/nominalization.d.ts.map +1 -0
- package/dist/detectors/nominalization.js +56 -0
- package/dist/detectors/nominalization.js.map +1 -0
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +72 -37
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/outside-announced-list.d.ts +4 -0
- package/dist/detectors/outside-announced-list.d.ts.map +1 -0
- package/dist/detectors/outside-announced-list.js +24 -0
- package/dist/detectors/outside-announced-list.js.map +1 -0
- package/dist/detectors/oxford-comma.d.ts +7 -1
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +136 -229
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/phrase-match.d.ts +4 -1
- package/dist/detectors/phrase-match.d.ts.map +1 -1
- package/dist/detectors/phrase-match.js +26 -7
- package/dist/detectors/phrase-match.js.map +1 -1
- package/dist/detectors/place-run.d.ts.map +1 -1
- package/dist/detectors/place-run.js +10 -6
- package/dist/detectors/place-run.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts +9 -0
- package/dist/detectors/placeholder-text.d.ts.map +1 -0
- package/dist/detectors/placeholder-text.js +18 -0
- package/dist/detectors/placeholder-text.js.map +1 -0
- package/dist/detectors/quote-around.d.ts +3 -0
- package/dist/detectors/quote-around.d.ts.map +1 -0
- package/dist/detectors/quote-around.js +8 -0
- package/dist/detectors/quote-around.js.map +1 -0
- package/dist/detectors/ra-nuki.d.ts +9 -0
- package/dist/detectors/ra-nuki.d.ts.map +1 -0
- package/dist/detectors/ra-nuki.js +30 -0
- package/dist/detectors/ra-nuki.js.map +1 -0
- package/dist/detectors/register.d.ts +11 -3
- package/dist/detectors/register.d.ts.map +1 -1
- package/dist/detectors/register.js +28 -9
- package/dist/detectors/register.js.map +1 -1
- package/dist/detectors/requirement-modal.d.ts +5 -0
- package/dist/detectors/requirement-modal.d.ts.map +1 -0
- package/dist/detectors/requirement-modal.js +54 -0
- package/dist/detectors/requirement-modal.js.map +1 -0
- package/dist/detectors/requirement-smell.d.ts +4 -0
- package/dist/detectors/requirement-smell.d.ts.map +1 -0
- package/dist/detectors/requirement-smell.js +41 -0
- package/dist/detectors/requirement-smell.js.map +1 -0
- package/dist/detectors/roman-numeral.d.ts +2 -0
- package/dist/detectors/roman-numeral.d.ts.map +1 -1
- package/dist/detectors/roman-numeral.js +2 -0
- package/dist/detectors/roman-numeral.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts +17 -1
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +13 -7
- package/dist/detectors/sentence-ending.js.map +1 -1
- package/dist/detectors/sentence-length.d.ts.map +1 -1
- package/dist/detectors/sentence-length.js +13 -4
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/signals.d.ts +8 -0
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +67 -46
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/space-before-punctuation.d.ts +8 -0
- package/dist/detectors/space-before-punctuation.d.ts.map +1 -0
- package/dist/detectors/space-before-punctuation.js +24 -0
- package/dist/detectors/space-before-punctuation.js.map +1 -0
- package/dist/detectors/spelling-variety.d.ts +23 -0
- package/dist/detectors/spelling-variety.d.ts.map +1 -0
- package/dist/detectors/spelling-variety.js +59 -0
- package/dist/detectors/spelling-variety.js.map +1 -0
- package/dist/detectors/structure-tree.d.ts +6 -0
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +39 -1
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/structure.d.ts +1 -3
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +19 -6
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/superlative-comparison.d.ts +20 -0
- package/dist/detectors/superlative-comparison.d.ts.map +1 -0
- package/dist/detectors/superlative-comparison.js +32 -0
- package/dist/detectors/superlative-comparison.js.map +1 -0
- package/dist/detectors/superlative-name.d.ts.map +1 -1
- package/dist/detectors/superlative-name.js +8 -5
- package/dist/detectors/superlative-name.js.map +1 -1
- package/dist/detectors/superlative-scope.d.ts.map +1 -1
- package/dist/detectors/superlative-scope.js +9 -4
- package/dist/detectors/superlative-scope.js.map +1 -1
- package/dist/detectors/token-column.d.ts +46 -0
- package/dist/detectors/token-column.d.ts.map +1 -0
- package/dist/detectors/token-column.js +95 -0
- package/dist/detectors/token-column.js.map +1 -0
- package/dist/detectors/unbalanced-bracket.d.ts +22 -0
- package/dist/detectors/unbalanced-bracket.d.ts.map +1 -0
- package/dist/detectors/unbalanced-bracket.js +119 -0
- package/dist/detectors/unbalanced-bracket.js.map +1 -0
- package/dist/detectors/url-run-on.d.ts +9 -0
- package/dist/detectors/url-run-on.d.ts.map +1 -0
- package/dist/detectors/url-run-on.js +24 -0
- package/dist/detectors/url-run-on.js.map +1 -0
- package/dist/detectors/vague-figure-pointer.d.ts +10 -0
- package/dist/detectors/vague-figure-pointer.d.ts.map +1 -0
- package/dist/detectors/vague-figure-pointer.js +46 -0
- package/dist/detectors/vague-figure-pointer.js.map +1 -0
- package/dist/detectors/word-list.d.ts +2 -0
- package/dist/detectors/word-list.d.ts.map +1 -1
- package/dist/detectors/word-list.js +4 -1
- package/dist/detectors/word-list.js.map +1 -1
- package/dist/document-sections.d.ts +13 -0
- package/dist/document-sections.d.ts.map +1 -0
- package/dist/document-sections.js +32 -0
- package/dist/document-sections.js.map +1 -0
- package/dist/document.d.ts +20 -7
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +140 -125
- package/dist/document.js.map +1 -1
- package/dist/email-parts.d.ts +28 -0
- package/dist/email-parts.d.ts.map +1 -0
- package/dist/email-parts.js +230 -0
- package/dist/email-parts.js.map +1 -0
- package/dist/eval.d.ts +2 -1
- package/dist/eval.d.ts.map +1 -1
- package/dist/eval.js +16 -4
- package/dist/eval.js.map +1 -1
- package/dist/extension/document-view.d.ts +7 -0
- package/dist/extension/document-view.d.ts.map +1 -0
- package/dist/extension/document-view.js +91 -0
- package/dist/extension/document-view.js.map +1 -0
- package/dist/extension/failure-text.d.ts +5 -0
- package/dist/extension/failure-text.d.ts.map +1 -0
- package/dist/extension/failure-text.js +33 -0
- package/dist/extension/failure-text.js.map +1 -0
- package/dist/extension/import-default.d.ts +7 -0
- package/dist/extension/import-default.d.ts.map +1 -0
- package/dist/extension/import-default.js +21 -0
- package/dist/extension/import-default.js.map +1 -0
- package/dist/extension/load.d.ts +28 -0
- package/dist/extension/load.d.ts.map +1 -0
- package/dist/extension/load.js +51 -0
- package/dist/extension/load.js.map +1 -0
- package/dist/extension/module-detector.d.ts +21 -0
- package/dist/extension/module-detector.d.ts.map +1 -0
- package/dist/extension/module-detector.js +49 -0
- package/dist/extension/module-detector.js.map +1 -0
- package/dist/extension/plugin-load.d.ts +9 -0
- package/dist/extension/plugin-load.d.ts.map +1 -0
- package/dist/extension/plugin-load.js +68 -0
- package/dist/extension/plugin-load.js.map +1 -0
- package/dist/extension/plugin-name.d.ts +8 -0
- package/dist/extension/plugin-name.d.ts.map +1 -0
- package/dist/extension/plugin-name.js +22 -0
- package/dist/extension/plugin-name.js.map +1 -0
- package/dist/extension/plugin-parse.d.ts +41 -0
- package/dist/extension/plugin-parse.d.ts.map +1 -0
- package/dist/extension/plugin-parse.js +156 -0
- package/dist/extension/plugin-parse.js.map +1 -0
- package/dist/extension/problem-text.d.ts +5 -0
- package/dist/extension/problem-text.d.ts.map +1 -0
- package/dist/extension/problem-text.js +74 -0
- package/dist/extension/problem-text.js.map +1 -0
- package/dist/extension/real-path.d.ts +3 -0
- package/dist/extension/real-path.d.ts.map +1 -0
- package/dist/extension/real-path.js +8 -0
- package/dist/extension/real-path.js.map +1 -0
- package/dist/extension/returned-findings.d.ts +17 -0
- package/dist/extension/returned-findings.d.ts.map +1 -0
- package/dist/extension/returned-findings.js +48 -0
- package/dist/extension/returned-findings.js.map +1 -0
- package/dist/extension/rule-export.d.ts +13 -0
- package/dist/extension/rule-export.d.ts.map +1 -0
- package/dist/extension/rule-export.js +16 -0
- package/dist/extension/rule-export.js.map +1 -0
- package/dist/feedback/draft.d.ts +2 -0
- package/dist/feedback/draft.d.ts.map +1 -1
- package/dist/feedback/draft.js +3 -0
- package/dist/feedback/draft.js.map +1 -1
- package/dist/figure-references.d.ts +39 -0
- package/dist/figure-references.d.ts.map +1 -0
- package/dist/figure-references.js +113 -0
- package/dist/figure-references.js.map +1 -0
- package/dist/files.d.ts +2 -0
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +4 -0
- package/dist/files.js.map +1 -1
- package/dist/finding-order.d.ts +9 -0
- package/dist/finding-order.d.ts.map +1 -0
- package/dist/finding-order.js +3 -0
- package/dist/finding-order.js.map +1 -0
- package/dist/fix-plan/mode.d.ts +21 -0
- package/dist/fix-plan/mode.d.ts.map +1 -0
- package/dist/fix-plan/mode.js +16 -0
- package/dist/fix-plan/mode.js.map +1 -0
- package/dist/fix-plan/plan.d.ts +77 -0
- package/dist/fix-plan/plan.d.ts.map +1 -0
- package/dist/fix-plan/plan.js +100 -0
- package/dist/fix-plan/plan.js.map +1 -0
- package/dist/fix-plan/render.d.ts +6 -0
- package/dist/fix-plan/render.d.ts.map +1 -0
- package/dist/fix-plan/render.js +101 -0
- package/dist/fix-plan/render.js.map +1 -0
- package/dist/fix-plan/text.d.ts +35 -0
- package/dist/fix-plan/text.d.ts.map +1 -0
- package/dist/fix-plan/text.js +95 -0
- package/dist/fix-plan/text.js.map +1 -0
- package/dist/heading-label.d.ts +22 -0
- package/dist/heading-label.d.ts.map +1 -0
- package/dist/heading-label.js +50 -0
- package/dist/heading-label.js.map +1 -0
- package/dist/in-page-nav.d.ts +4 -1
- package/dist/in-page-nav.d.ts.map +1 -1
- package/dist/in-page-nav.js +53 -18
- package/dist/in-page-nav.js.map +1 -1
- package/dist/joined-view.d.ts.map +1 -1
- package/dist/joined-view.js +1 -0
- package/dist/joined-view.js.map +1 -1
- package/dist/language-sample.d.ts +2 -0
- package/dist/language-sample.d.ts.map +1 -0
- package/dist/language-sample.js +41 -0
- package/dist/language-sample.js.map +1 -0
- package/dist/levels.d.ts +5 -1
- package/dist/levels.d.ts.map +1 -1
- package/dist/levels.js +9 -0
- package/dist/levels.js.map +1 -1
- package/dist/line-paragraphs.d.ts +8 -0
- package/dist/line-paragraphs.d.ts.map +1 -1
- package/dist/line-paragraphs.js +33 -10
- package/dist/line-paragraphs.js.map +1 -1
- package/dist/link-line.d.ts +8 -0
- package/dist/link-line.d.ts.map +1 -0
- package/dist/link-line.js +12 -0
- package/dist/link-line.js.map +1 -0
- package/dist/long-vowel.d.ts +38 -0
- package/dist/long-vowel.d.ts.map +1 -0
- package/dist/long-vowel.js +78 -0
- package/dist/long-vowel.js.map +1 -0
- package/dist/markdown-node.d.ts +19 -0
- package/dist/markdown-node.d.ts.map +1 -0
- package/dist/markdown-node.js +6 -0
- package/dist/markdown-node.js.map +1 -0
- package/dist/markdown-read.d.ts +17 -0
- package/dist/markdown-read.d.ts.map +1 -0
- package/dist/markdown-read.js +37 -0
- package/dist/markdown-read.js.map +1 -0
- package/dist/markup.d.ts +22 -0
- package/dist/markup.d.ts.map +1 -0
- package/dist/markup.js +182 -0
- package/dist/markup.js.map +1 -0
- package/dist/mask.js +8 -5
- package/dist/mask.js.map +1 -1
- package/dist/name-variants.d.ts +25 -0
- package/dist/name-variants.d.ts.map +1 -0
- package/dist/name-variants.js +181 -0
- package/dist/name-variants.js.map +1 -0
- package/dist/node-version.d.ts +7 -0
- package/dist/node-version.d.ts.map +1 -0
- package/dist/node-version.js +19 -0
- package/dist/node-version.js.map +1 -0
- package/dist/not-run.d.ts +14 -0
- package/dist/not-run.d.ts.map +1 -0
- package/dist/not-run.js +12 -0
- package/dist/not-run.js.map +1 -0
- package/dist/number-name.d.ts +21 -5
- package/dist/number-name.d.ts.map +1 -1
- package/dist/number-name.js +119 -17
- package/dist/number-name.js.map +1 -1
- package/dist/orthography.d.ts +10 -1
- package/dist/orthography.d.ts.map +1 -1
- package/dist/orthography.js +42 -16
- package/dist/orthography.js.map +1 -1
- package/dist/outline/render.d.ts +18 -0
- package/dist/outline/render.d.ts.map +1 -0
- package/dist/outline/render.js +60 -0
- package/dist/outline/render.js.map +1 -0
- package/dist/outline/shape.d.ts +26 -0
- package/dist/outline/shape.d.ts.map +1 -0
- package/dist/outline/shape.js +37 -0
- package/dist/outline/shape.js.map +1 -0
- package/dist/outline/text.d.ts +21 -0
- package/dist/outline/text.d.ts.map +1 -0
- package/dist/outline/text.js +30 -0
- package/dist/outline/text.js.map +1 -0
- package/dist/page-furniture.d.ts +5 -2
- package/dist/page-furniture.d.ts.map +1 -1
- package/dist/page-furniture.js +8 -2
- package/dist/page-furniture.js.map +1 -1
- package/dist/plain-source.d.ts +1 -0
- package/dist/plain-source.d.ts.map +1 -1
- package/dist/plain-source.js +2 -1
- package/dist/plain-source.js.map +1 -1
- package/dist/plugin.d.ts +138 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/profile/for-file.d.ts.map +1 -1
- package/dist/profile/for-file.js +3 -1
- package/dist/profile/for-file.js.map +1 -1
- package/dist/quoted-span.d.ts.map +1 -1
- package/dist/quoted-span.js +8 -3
- package/dist/quoted-span.js.map +1 -1
- package/dist/reasons.d.ts +4 -0
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +8 -0
- package/dist/reasons.js.map +1 -1
- package/dist/reference-lists.d.ts +3 -0
- package/dist/reference-lists.d.ts.map +1 -0
- package/dist/reference-lists.js +75 -0
- package/dist/reference-lists.js.map +1 -0
- package/dist/render/compact.d.ts +3 -1
- package/dist/render/compact.d.ts.map +1 -1
- package/dist/render/compact.js +8 -2
- package/dist/render/compact.js.map +1 -1
- package/dist/render/explain.d.ts +9 -1
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +54 -13
- package/dist/render/explain.js.map +1 -1
- package/dist/render/friendly.d.ts.map +1 -1
- package/dist/render/friendly.js +19 -9
- package/dist/render/friendly.js.map +1 -1
- package/dist/render/options.d.ts +7 -0
- package/dist/render/options.d.ts.map +1 -0
- package/dist/render/options.js +50 -0
- package/dist/render/options.js.map +1 -0
- package/dist/render/rules-json.d.ts +4 -1
- package/dist/render/rules-json.d.ts.map +1 -1
- package/dist/render/rules-json.js +110 -16
- package/dist/render/rules-json.js.map +1 -1
- package/dist/render/rules-table.d.ts +4 -0
- package/dist/render/rules-table.d.ts.map +1 -0
- package/dist/render/rules-table.js +70 -0
- package/dist/render/rules-table.js.map +1 -0
- package/dist/render/sarif.js +4 -4
- package/dist/render/sarif.js.map +1 -1
- package/dist/render/semantic.js +3 -3
- package/dist/render/semantic.js.map +1 -1
- package/dist/render/severity-name.d.ts +6 -0
- package/dist/render/severity-name.d.ts.map +1 -0
- package/dist/render/severity-name.js +7 -0
- package/dist/render/severity-name.js.map +1 -0
- package/dist/render/suppressions.d.ts +3 -0
- package/dist/render/suppressions.d.ts.map +1 -1
- package/dist/render/suppressions.js +20 -1
- package/dist/render/suppressions.js.map +1 -1
- package/dist/render/text.d.ts +7 -2
- package/dist/render/text.d.ts.map +1 -1
- package/dist/render/text.js +15 -4
- package/dist/render/text.js.map +1 -1
- package/dist/resolve-genre.d.ts +1 -1
- package/dist/resolve-genre.d.ts.map +1 -1
- package/dist/resolve-genre.js +4 -1
- package/dist/resolve-genre.js.map +1 -1
- package/dist/rule-genres.d.ts +24 -0
- package/dist/rule-genres.d.ts.map +1 -0
- package/dist/rule-genres.js +11 -0
- package/dist/rule-genres.js.map +1 -0
- package/dist/rule-guide.d.ts +73 -0
- package/dist/rule-guide.d.ts.map +1 -0
- package/dist/rule-guide.js +95 -0
- package/dist/rule-guide.js.map +1 -0
- package/dist/rule-load.d.ts.map +1 -1
- package/dist/rule-load.js +87 -33
- package/dist/rule-load.js.map +1 -1
- package/dist/rule-options.d.ts +50 -0
- package/dist/rule-options.d.ts.map +1 -0
- package/dist/rule-options.js +106 -0
- package/dist/rule-options.js.map +1 -0
- package/dist/run-semantic.d.ts.map +1 -1
- package/dist/run-semantic.js +2 -1
- package/dist/run-semantic.js.map +1 -1
- package/dist/run.d.ts +18 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +80 -19
- package/dist/run.js.map +1 -1
- package/dist/sentence-shape.d.ts.map +1 -1
- package/dist/sentence-shape.js +4 -4
- package/dist/sentence-shape.js.map +1 -1
- package/dist/setting-problems.d.ts +2 -1
- package/dist/setting-problems.d.ts.map +1 -1
- package/dist/setting-problems.js +8 -1
- package/dist/setting-problems.js.map +1 -1
- package/dist/spacing-minority.d.ts +16 -0
- package/dist/spacing-minority.d.ts.map +1 -0
- package/dist/spacing-minority.js +23 -0
- package/dist/spacing-minority.js.map +1 -0
- package/dist/span-cut.d.ts +6 -0
- package/dist/span-cut.d.ts.map +1 -0
- package/dist/span-cut.js +22 -0
- package/dist/span-cut.js.map +1 -0
- package/dist/stet-block.d.ts +5 -0
- package/dist/stet-block.d.ts.map +1 -0
- package/dist/stet-block.js +59 -0
- package/dist/stet-block.js.map +1 -0
- package/dist/stet.d.ts +4 -0
- package/dist/stet.d.ts.map +1 -1
- package/dist/stet.js +31 -11
- package/dist/stet.js.map +1 -1
- package/dist/structure/aside-depth.d.ts +21 -0
- package/dist/structure/aside-depth.d.ts.map +1 -0
- package/dist/structure/aside-depth.js +65 -0
- package/dist/structure/aside-depth.js.map +1 -0
- package/dist/structure/build.d.ts +5 -1
- package/dist/structure/build.d.ts.map +1 -1
- package/dist/structure/build.js +29 -17
- package/dist/structure/build.js.map +1 -1
- package/dist/structure/closed-pairs.d.ts +8 -0
- package/dist/structure/closed-pairs.d.ts.map +1 -0
- package/dist/structure/closed-pairs.js +22 -0
- package/dist/structure/closed-pairs.js.map +1 -0
- package/dist/structure/date-range.d.ts +31 -0
- package/dist/structure/date-range.d.ts.map +1 -0
- package/dist/structure/date-range.js +77 -0
- package/dist/structure/date-range.js.map +1 -0
- package/dist/structure/definition-use.d.ts +32 -0
- package/dist/structure/definition-use.d.ts.map +1 -0
- package/dist/structure/definition-use.js +102 -0
- package/dist/structure/definition-use.js.map +1 -0
- package/dist/structure/known-mentions.d.ts +18 -0
- package/dist/structure/known-mentions.d.ts.map +1 -0
- package/dist/structure/known-mentions.js +78 -0
- package/dist/structure/known-mentions.js.map +1 -0
- package/dist/structure/lazy-tree.d.ts +8 -0
- package/dist/structure/lazy-tree.d.ts.map +1 -0
- package/dist/structure/lazy-tree.js +14 -0
- package/dist/structure/lazy-tree.js.map +1 -0
- package/dist/structure/modal-conflict.d.ts +28 -0
- package/dist/structure/modal-conflict.d.ts.map +1 -0
- package/dist/structure/modal-conflict.js +74 -0
- package/dist/structure/modal-conflict.js.map +1 -0
- package/dist/structure/numbered-clauses.d.ts +4 -0
- package/dist/structure/numbered-clauses.d.ts.map +1 -0
- package/dist/structure/numbered-clauses.js +9 -0
- package/dist/structure/numbered-clauses.js.map +1 -0
- package/dist/structure/numbering.d.ts +1 -0
- package/dist/structure/numbering.d.ts.map +1 -1
- package/dist/structure/numbering.js +11 -6
- package/dist/structure/numbering.js.map +1 -1
- package/dist/structure/of.d.ts +3 -1
- package/dist/structure/of.d.ts.map +1 -1
- package/dist/structure/of.js +5 -1
- package/dist/structure/of.js.map +1 -1
- package/dist/structure/percent-sum.d.ts +16 -0
- package/dist/structure/percent-sum.d.ts.map +1 -0
- package/dist/structure/percent-sum.js +104 -0
- package/dist/structure/percent-sum.js.map +1 -0
- package/dist/structure/quoted-number.d.ts +8 -0
- package/dist/structure/quoted-number.d.ts.map +1 -0
- package/dist/structure/quoted-number.js +34 -0
- package/dist/structure/quoted-number.js.map +1 -0
- package/dist/structure/relative-find.d.ts.map +1 -1
- package/dist/structure/relative-find.js +34 -46
- package/dist/structure/relative-find.js.map +1 -1
- package/dist/structure/relative-resolve.d.ts.map +1 -1
- package/dist/structure/relative-resolve.js +76 -30
- package/dist/structure/relative-resolve.js.map +1 -1
- package/dist/structure/runs.d.ts +2 -0
- package/dist/structure/runs.d.ts.map +1 -1
- package/dist/structure/runs.js +2 -2
- package/dist/structure/runs.js.map +1 -1
- package/dist/structure/sexp.d.ts +1 -1
- package/dist/structure/sexp.d.ts.map +1 -1
- package/dist/structure/sexp.js +18 -6
- package/dist/structure/sexp.js.map +1 -1
- package/dist/structure/total.d.ts +3 -0
- package/dist/structure/total.d.ts.map +1 -1
- package/dist/structure/total.js +2 -2
- package/dist/structure/total.js.map +1 -1
- package/dist/structure/universal.d.ts +14 -2
- package/dist/structure/universal.d.ts.map +1 -1
- package/dist/structure/universal.js +24 -3
- package/dist/structure/universal.js.map +1 -1
- package/dist/structure/wrapped-tail.d.ts +14 -7
- package/dist/structure/wrapped-tail.d.ts.map +1 -1
- package/dist/structure/wrapped-tail.js +33 -8
- package/dist/structure/wrapped-tail.js.map +1 -1
- package/dist/style-load.d.ts +4 -0
- package/dist/style-load.d.ts.map +1 -0
- package/dist/style-load.js +28 -0
- package/dist/style-load.js.map +1 -0
- package/dist/style-parse.d.ts +25 -0
- package/dist/style-parse.d.ts.map +1 -0
- package/dist/style-parse.js +88 -0
- package/dist/style-parse.js.map +1 -0
- package/dist/subheading-line.d.ts +23 -0
- package/dist/subheading-line.d.ts.map +1 -0
- package/dist/subheading-line.js +85 -0
- package/dist/subheading-line.js.map +1 -0
- package/dist/tag-coverage.d.ts +8 -0
- package/dist/tag-coverage.d.ts.map +1 -0
- package/dist/tag-coverage.js +7 -0
- package/dist/tag-coverage.js.map +1 -0
- package/dist/template-syntax.d.ts +17 -0
- package/dist/template-syntax.d.ts.map +1 -0
- package/dist/template-syntax.js +140 -0
- package/dist/template-syntax.js.map +1 -0
- package/dist/text-above.d.ts +19 -0
- package/dist/text-above.d.ts.map +1 -0
- package/dist/text-above.js +43 -0
- package/dist/text-above.js.map +1 -0
- package/dist/text-figures.d.ts +10 -0
- package/dist/text-figures.d.ts.map +1 -0
- package/dist/text-figures.js +131 -0
- package/dist/text-figures.js.map +1 -0
- package/dist/trailing-aside.d.ts +2 -0
- package/dist/trailing-aside.d.ts.map +1 -0
- package/dist/trailing-aside.js +53 -0
- package/dist/trailing-aside.js.map +1 -0
- package/dist/tree-walk.d.ts +18 -0
- package/dist/tree-walk.d.ts.map +1 -0
- package/dist/tree-walk.js +45 -0
- package/dist/tree-walk.js.map +1 -0
- package/genres.yaml +68 -0
- package/package.json +9 -3
- package/reference-headings.yaml +17 -0
- package/rules/acronym-expansion-conflict.yaml +82 -0
- package/rules/adverb-overuse.yaml +19 -0
- package/rules/agentless-passive.yaml +47 -0
- package/rules/agreement-slip.yaml +14 -1
- package/rules/ai-generated-composite.yaml +102 -0
- package/rules/ai-tell.yaml +57 -0
- package/rules/announced-count-mismatch.yaml +57 -0
- package/rules/announcing-opener.yaml +82 -0
- package/rules/assistant-residue.yaml +82 -0
- package/rules/bold-density.yaml +59 -0
- package/rules/bold-label-list.yaml +81 -0
- package/rules/broken-link.yaml +65 -0
- package/rules/closing-cliche.yaml +58 -0
- package/rules/colon-lead-in.yaml +83 -0
- package/rules/concrete-evidence-density.yaml +41 -0
- package/rules/contraction-consistency.yaml +18 -0
- package/rules/contrast-framing.yaml +88 -0
- package/rules/cushion-phrase-density.yaml +53 -1
- package/rules/dangling-figure-reference.yaml +61 -0
- package/rules/dangling-reference.yaml +54 -1
- package/rules/date-order.yaml +34 -1
- package/rules/date-range-reversed.yaml +46 -0
- package/rules/date-weekday-mismatch.yaml +17 -1
- package/rules/double-keigo.yaml +16 -0
- package/rules/double-negative.yaml +51 -0
- package/rules/doubled-punctuation.yaml +45 -0
- package/rules/doubled-word.yaml +18 -2
- package/rules/duplicate-definition.yaml +59 -1
- package/rules/duplicate-heading.yaml +78 -0
- package/rules/emoji-density.yaml +28 -2
- package/rules/empty-conclusion.yaml +28 -0
- package/rules/empty-intensifier.yaml +44 -0
- package/rules/empty-section.yaml +74 -0
- package/rules/excessive-hedging.yaml +49 -2
- package/rules/expletive-construction.yaml +19 -0
- package/rules/fullwidth-alnum-consistency.yaml +53 -0
- package/rules/hankaku-kana.yaml +41 -0
- package/rules/heading-echo.yaml +31 -0
- package/rules/heading-level-skip.yaml +78 -0
- package/rules/hiragana-fukushi.yaml +16 -0
- package/rules/image-alt-text.yaml +54 -0
- package/rules/internal-jargon.yaml +21 -0
- package/rules/invisible-character.yaml +63 -0
- package/rules/katakana-long-vowel.yaml +99 -0
- package/rules/kutoten-consistency.yaml +53 -0
- package/rules/latin-spacing.yaml +30 -4
- package/rules/max-kanji-continuous.yaml +17 -0
- package/rules/max-paragraph-length.yaml +34 -0
- package/rules/max-sentence-length.yaml +58 -0
- package/rules/modal-conflict.yaml +106 -0
- package/rules/name-variant.yaml +88 -0
- package/rules/ngram-repetition.yaml +29 -2
- package/rules/no-doubled-joshi.yaml +17 -0
- package/rules/no-em-dash.yaml +49 -0
- package/rules/no-mixed-desumasu.yaml +28 -2
- package/rules/no-nakaguro-parallel.yaml +20 -0
- package/rules/nominalization.yaml +89 -0
- package/rules/numbering-gap.yaml +53 -1
- package/rules/outside-announced-list.yaml +80 -0
- package/rules/oxford-comma-consistency.yaml +18 -0
- package/rules/padded-intro.yaml +44 -0
- package/rules/paragraph-length-variance.yaml +73 -0
- package/rules/percent-sum-mismatch.yaml +58 -0
- package/rules/preamble-length.yaml +56 -0
- package/rules/preferred-term.yaml +28 -0
- package/rules/proper-noun-density.yaml +37 -2
- package/rules/ra-nuki.yaml +43 -0
- package/rules/repeated-conjunction.yaml +47 -0
- package/rules/repeated-sentence-head.yaml +23 -0
- package/rules/required-sections.yaml +49 -0
- package/rules/requirement-modal.yaml +94 -0
- package/rules/requirement-smell.yaml +70 -0
- package/rules/risk-disclosure.yaml +22 -0
- package/rules/rule-of-three.yaml +143 -0
- package/rules/sasete-itadaku.yaml +18 -0
- package/rules/section-length-uniformity.yaml +113 -0
- package/rules/sentence-initial-conjunction-run.yaml +18 -0
- package/rules/sentence-rhythm.yaml +51 -0
- package/rules/space-before-punctuation.yaml +41 -0
- package/rules/spelling-consistency.yaml +47 -0
- package/rules/stock-transition.yaml +86 -0
- package/rules/stray-space.yaml +18 -0
- package/rules/taigen-dome-in-prose.yaml +33 -0
- package/rules/title-case-consistency.yaml +42 -0
- package/rules/total-mismatch.yaml +38 -1
- package/rules/unbalanced-bracket.yaml +56 -0
- package/rules/undefined-acronym.yaml +23 -0
- package/rules/unfilled-placeholder.yaml +50 -0
- package/rules/unqualified-superlative.yaml +20 -0
- package/rules/unsourced-number.yaml +16 -0
- package/rules/unused-definition.yaml +75 -0
- package/rules/url-run-on.yaml +45 -0
- package/rules/use-before-definition.yaml +77 -0
- package/rules/vague-figure-reference.yaml +66 -0
- package/skills/chaff/SKILL.md +171 -1
- package/src/acronym-expansions.ts +106 -0
- package/src/announced-count.ts +190 -0
- package/src/announced-list.ts +120 -0
- package/src/api.ts +154 -0
- package/src/bare-url.ts +35 -0
- package/src/baseline.ts +17 -1
- package/src/body-section.ts +7 -0
- package/src/calendar-number.ts +18 -4
- package/src/cli-args.ts +6 -0
- package/src/cli-text.ts +14 -15
- package/src/cli.ts +93 -92
- package/src/closing-paragraph.ts +24 -0
- package/src/commands/compare.ts +73 -0
- package/src/commands/document-commands.ts +19 -0
- package/src/commands/eval.ts +22 -10
- package/src/commands/facts.ts +33 -0
- package/src/commands/feedback.ts +45 -7
- package/src/commands/fix-plan.ts +53 -0
- package/src/commands/outline.ts +49 -0
- package/src/commands/read-document.ts +24 -0
- package/src/commands/suppressions.ts +19 -0
- package/src/commands/test.ts +3 -5
- package/src/commands/tree.ts +41 -5
- package/src/compare/atom.ts +33 -0
- package/src/compare/clock-time.ts +89 -0
- package/src/compare/distinct.ts +13 -0
- package/src/compare/extract.ts +80 -0
- package/src/compare/fact-key.ts +31 -0
- package/src/compare/fact-text.ts +87 -0
- package/src/compare/facts-render.ts +63 -0
- package/src/compare/facts-text.ts +41 -0
- package/src/compare/markup-atoms.ts +29 -0
- package/src/compare/match.ts +105 -0
- package/src/compare/outcome.ts +80 -0
- package/src/compare/proper-nouns.ts +65 -0
- package/src/compare/render.ts +102 -0
- package/src/compare/spans.ts +17 -0
- package/src/compare/text-atoms.ts +96 -0
- package/src/compare/text.ts +121 -0
- package/src/compare/tree-atoms.ts +80 -0
- package/src/compare/written-names.ts +26 -0
- package/src/config/load.ts +30 -0
- package/src/config/option-problems.ts +72 -0
- package/src/config/read.ts +8 -0
- package/src/config/rule-problems.ts +12 -2
- package/src/config/style.ts +55 -0
- package/src/config/warnings.ts +13 -0
- package/src/config/write.ts +18 -4
- package/src/custom/bounded-match.ts +58 -0
- package/src/custom/load.ts +23 -0
- package/src/custom/module-path.ts +23 -0
- package/src/custom/parse.ts +323 -0
- package/src/custom/problems.ts +111 -0
- package/src/custom/regex-safety.ts +118 -0
- package/src/custom/token-pattern.ts +84 -0
- package/src/detect-language.ts +1 -1
- package/src/detect.ts +35 -2
- package/src/detectors/acronym-context.ts +16 -4
- package/src/detectors/ai-phrasing.ts +141 -0
- package/src/detectors/announced-count.ts +25 -0
- package/src/detectors/bold-label.ts +55 -0
- package/src/detectors/broken-link.ts +90 -0
- package/src/detectors/cited-name.ts +6 -5
- package/src/detectors/cited-title.ts +96 -0
- package/src/detectors/concrete-evidence.ts +3 -2
- package/src/detectors/contrast-frame.ts +54 -0
- package/src/detectors/custom.ts +89 -0
- package/src/detectors/dangling-figure.ts +26 -0
- package/src/detectors/definition-use.ts +41 -0
- package/src/detectors/doubled-punctuation.ts +52 -0
- package/src/detectors/doubled-word.ts +19 -4
- package/src/detectors/duplicate-heading.ts +47 -0
- package/src/detectors/empty-section.ts +21 -0
- package/src/detectors/enumerated-runs.ts +13 -4
- package/src/detectors/fullwidth-alnum.ts +118 -0
- package/src/detectors/gram-furniture.ts +30 -0
- package/src/detectors/gram-place.ts +9 -5
- package/src/detectors/gram-windows.ts +31 -0
- package/src/detectors/hankaku-kana.ts +38 -0
- package/src/detectors/heading-case.ts +30 -2
- package/src/detectors/heading-code-words.ts +35 -0
- package/src/detectors/heading-echo.ts +8 -4
- package/src/detectors/heading-level-skip.ts +19 -0
- package/src/detectors/image-alt-text.ts +11 -0
- package/src/detectors/index.ts +79 -1
- package/src/detectors/invisible-character.ts +190 -0
- package/src/detectors/kutoten-consistency.ts +96 -0
- package/src/detectors/lead-in.ts +3 -1
- package/src/detectors/lexicon-match.ts +41 -2
- package/src/detectors/lexicon.ts +40 -13
- package/src/detectors/list-item.ts +122 -0
- package/src/detectors/list-items.ts +163 -0
- package/src/detectors/list-lead-in.ts +33 -0
- package/src/detectors/list-sentence.ts +198 -0
- package/src/detectors/list-view.ts +157 -0
- package/src/detectors/long-vowel.ts +82 -0
- package/src/detectors/markup-finding.ts +39 -0
- package/src/detectors/modal-conflict.ts +26 -0
- package/src/detectors/name-numeral.ts +4 -2
- package/src/detectors/name-variant.ts +15 -0
- package/src/detectors/nominalization.ts +73 -0
- package/src/detectors/orthography.ts +97 -41
- package/src/detectors/outside-announced-list.ts +25 -0
- package/src/detectors/oxford-comma.ts +179 -283
- package/src/detectors/phrase-match.ts +27 -7
- package/src/detectors/place-run.ts +7 -4
- package/src/detectors/placeholder-text.ts +27 -0
- package/src/detectors/quote-around.ts +9 -0
- package/src/detectors/ra-nuki.ts +38 -0
- package/src/detectors/register.ts +37 -10
- package/src/detectors/requirement-modal.ts +67 -0
- package/src/detectors/requirement-smell.ts +52 -0
- package/src/detectors/roman-numeral.ts +3 -0
- package/src/detectors/sentence-ending.ts +14 -7
- package/src/detectors/sentence-length.ts +16 -5
- package/src/detectors/signals.ts +80 -46
- package/src/detectors/space-before-punctuation.ts +32 -0
- package/src/detectors/spelling-variety.ts +81 -0
- package/src/detectors/structure-tree.ts +47 -1
- package/src/detectors/structure.ts +20 -7
- package/src/detectors/superlative-comparison.ts +47 -0
- package/src/detectors/superlative-name.ts +7 -4
- package/src/detectors/superlative-scope.ts +8 -3
- package/src/detectors/token-column.ts +149 -0
- package/src/detectors/unbalanced-bracket.ts +153 -0
- package/src/detectors/url-run-on.ts +33 -0
- package/src/detectors/vague-figure-pointer.ts +58 -0
- package/src/detectors/word-list.ts +6 -1
- package/src/document-sections.ts +46 -0
- package/src/document.ts +188 -173
- package/src/email-parts.ts +269 -0
- package/src/eval.ts +14 -4
- package/src/extension/document-view.ts +109 -0
- package/src/extension/failure-text.ts +46 -0
- package/src/extension/import-default.ts +13 -0
- package/src/extension/load.ts +97 -0
- package/src/extension/module-detector.ts +61 -0
- package/src/extension/plugin-load.ts +82 -0
- package/src/extension/plugin-name.ts +26 -0
- package/src/extension/plugin-parse.ts +229 -0
- package/src/extension/problem-text.ts +103 -0
- package/src/extension/real-path.ts +10 -0
- package/src/extension/returned-findings.ts +62 -0
- package/src/extension/rule-export.ts +23 -0
- package/src/feedback/draft.ts +6 -0
- package/src/figure-references.ts +173 -0
- package/src/files.ts +5 -0
- package/src/finding-order.ts +3 -0
- package/src/fix-plan/mode.ts +34 -0
- package/src/fix-plan/plan.ts +181 -0
- package/src/fix-plan/render.ts +128 -0
- package/src/fix-plan/text.ts +133 -0
- package/src/heading-label.ts +55 -0
- package/src/in-page-nav.ts +48 -19
- package/src/joined-view.ts +1 -0
- package/src/language-sample.ts +48 -0
- package/src/levels.ts +14 -1
- package/src/line-paragraphs.ts +52 -9
- package/src/link-line.ts +13 -0
- package/src/long-vowel.ts +109 -0
- package/src/markdown-node.ts +19 -0
- package/src/markdown-read.ts +44 -0
- package/src/markup.ts +212 -0
- package/src/mask.ts +8 -8
- package/src/name-variants.ts +217 -0
- package/src/node-version.ts +22 -0
- package/src/not-run.ts +16 -0
- package/src/number-name.ts +151 -24
- package/src/orthography.ts +50 -14
- package/src/outline/render.ts +85 -0
- package/src/outline/shape.ts +72 -0
- package/src/outline/text.ts +50 -0
- package/src/page-furniture.ts +11 -2
- package/src/plain-source.ts +2 -1
- package/src/plugin.ts +120 -3
- package/src/profile/for-file.ts +3 -1
- package/src/quoted-span.ts +9 -3
- package/src/reasons.ts +12 -0
- package/src/reference-lists.ts +91 -0
- package/src/render/compact.ts +13 -3
- package/src/render/explain.ts +75 -14
- package/src/render/friendly.ts +20 -9
- package/src/render/options.ts +58 -0
- package/src/render/rules-json.ts +140 -18
- package/src/render/rules-table.ts +91 -0
- package/src/render/sarif.ts +4 -4
- package/src/render/semantic.ts +3 -3
- package/src/render/severity-name.ts +10 -0
- package/src/render/suppressions.ts +30 -2
- package/src/render/text.ts +21 -7
- package/src/resolve-genre.ts +4 -1
- package/src/rule-genres.ts +25 -0
- package/src/rule-guide.ts +173 -0
- package/src/rule-load.ts +91 -34
- package/src/rule-options.ts +131 -0
- package/src/run-semantic.ts +2 -1
- package/src/run.ts +105 -22
- package/src/sentence-shape.ts +4 -5
- package/src/setting-problems.ts +9 -1
- package/src/spacing-minority.ts +27 -0
- package/src/span-cut.ts +28 -0
- package/src/stet-block.ts +60 -0
- package/src/stet.ts +41 -15
- package/src/structure/aside-depth.ts +67 -0
- package/src/structure/build.ts +38 -19
- package/src/structure/closed-pairs.ts +20 -0
- package/src/structure/date-range.ts +117 -0
- package/src/structure/definition-use.ts +130 -0
- package/src/structure/known-mentions.ts +96 -0
- package/src/structure/lazy-tree.ts +15 -0
- package/src/structure/modal-conflict.ts +86 -0
- package/src/structure/numbered-clauses.ts +11 -0
- package/src/structure/numbering.ts +9 -5
- package/src/structure/of.ts +11 -3
- package/src/structure/percent-sum.ts +135 -0
- package/src/structure/quoted-number.ts +36 -0
- package/src/structure/relative-find.ts +34 -47
- package/src/structure/relative-resolve.ts +77 -30
- package/src/structure/runs.ts +2 -2
- package/src/structure/sexp.ts +17 -5
- package/src/structure/total.ts +2 -2
- package/src/structure/universal.ts +33 -5
- package/src/structure/wrapped-tail.ts +38 -13
- package/src/style-load.ts +28 -0
- package/src/style-parse.ts +112 -0
- package/src/subheading-line.ts +106 -0
- package/src/tag-coverage.ts +13 -0
- package/src/template-syntax.ts +164 -0
- package/src/text-above.ts +49 -0
- package/src/text-figures.ts +147 -0
- package/src/trailing-aside.ts +50 -0
- package/src/tree-walk.ts +48 -0
- package/styles/bunkacho.yaml +25 -0
- package/styles/ieice.yaml +30 -0
- package/styles/jis-z8301-2011.yaml +28 -0
- package/styles/jis-z8301-2019.yaml +31 -0
- package/styles/koyobun.yaml +35 -0
- package/dist/legal-address.d.ts +0 -2
- package/dist/legal-address.d.ts.map +0 -1
- package/dist/legal-address.js +0 -16
- package/dist/legal-address.js.map +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
id: vague-figure-reference
|
|
2
|
+
layer: L2
|
|
3
|
+
status: experimental
|
|
4
|
+
how_to_find: vague-figure-pointer
|
|
5
|
+
# 置き場所で指す言い方と、その言い方が指す種類(図・表)。図・表に名前を付ける語は dangling-figure-reference と同じ figure-label。
|
|
6
|
+
# 箇条を置き場所で指す言い方は vague-clause-pointer。文書の構造の木に番号付きの条か章があるときだけ見る。
|
|
7
|
+
word_list: vague-figure-pointer
|
|
8
|
+
extra_word_lists: [figure-label, vague-clause-pointer]
|
|
9
|
+
severity: warning
|
|
10
|
+
|
|
11
|
+
name:
|
|
12
|
+
ja: 図や表、箇条を「上記の図」のように指している
|
|
13
|
+
en: A figure, table or clause pointed at by where it is
|
|
14
|
+
|
|
15
|
+
why:
|
|
16
|
+
ja: 「上記の図」「下の表」は、どの図のことかを読み手に探させます。図を足したり動かしたりすると、指す先が黙って変わります。印刷やページの区切り、画面の幅で「上」「下」も変わります。JIS Z 8301:2019 の 10.6 は「上記の図」「以下の箇条」のような引用をしないとしています。図や表に番号を付けている文書なら、「図 3」のように番号で指せます。箇条も、条や章に番号を付けている文書なら「箇条 4」のように指せます。番号を一つも付けていない種類は見ません。
|
|
17
|
+
en: '"The figure above" makes the reader search for the figure. When a figure is added or moved, what it points at changes without a word. Printing, page breaks and the width of the screen change what is above and below as well. JIS Z 8301:2019, 10.6, rules out pointers such as "the figure above". A document that numbers its figures and tables can name them ("Figure 3"), and one that numbers its clauses can name a clause ("Clause 4"). A kind that the document never numbers is not checked.'
|
|
18
|
+
|
|
19
|
+
message:
|
|
20
|
+
ja: 「{matched}」ではなく、番号で指してください(この文書は{kind}に番号を付けています)
|
|
21
|
+
en: 'Name it by its number instead of "{matched}" (this document numbers its {kind}s)'
|
|
22
|
+
|
|
23
|
+
how_to_fix:
|
|
24
|
+
ja: 指している図や表、箇条の番号を書いてください。「上記の図のとおり」は「図 3 のとおり」に、「以下の箇条による」は「箇条 5 による」に。
|
|
25
|
+
en: 'Write the number of the figure, table or clause. "As the figure above shows" becomes "as Figure 3 shows"; "under the clause below" becomes "under Clause 5".'
|
|
26
|
+
|
|
27
|
+
placeholders:
|
|
28
|
+
matched:
|
|
29
|
+
ja: 見つけた言い方
|
|
30
|
+
en: the phrase found
|
|
31
|
+
kind:
|
|
32
|
+
ja: 図、表や箇条
|
|
33
|
+
en: figure, table or clause
|
|
34
|
+
|
|
35
|
+
levels: { strict: error, normal: warning, relaxed: info }
|
|
36
|
+
|
|
37
|
+
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
38
|
+
sources: [jis-z8301-2019]
|
|
39
|
+
|
|
40
|
+
group: structure
|
|
41
|
+
summary:
|
|
42
|
+
ja: 図や表、条に番号を付けた文書で、「上記の図」「下の表」「以下の箇条」のように置き場所で指している所
|
|
43
|
+
en: '"The figure above", "the table below" or "the clause below" in a document that numbers its figures, tables or clauses'
|
|
44
|
+
example:
|
|
45
|
+
ja:
|
|
46
|
+
before: |
|
|
47
|
+
売上は上記の図のとおり伸びた。
|
|
48
|
+
|
|
49
|
+
図1 売上の推移
|
|
50
|
+
after: |
|
|
51
|
+
売上は図1のとおり伸びた。
|
|
52
|
+
|
|
53
|
+
図1 売上の推移
|
|
54
|
+
en:
|
|
55
|
+
before: |
|
|
56
|
+
Sales rose, as the figure below shows.
|
|
57
|
+
|
|
58
|
+
Figure 1: Sales by month
|
|
59
|
+
after: |
|
|
60
|
+
Sales rose, as Figure 1 shows.
|
|
61
|
+
|
|
62
|
+
Figure 1: Sales by month
|
|
63
|
+
|
|
64
|
+
not_flagged:
|
|
65
|
+
ja: 番号を一つも付けていない種類(番号で指しようがない)、番号を添えた言い方(上の図1)、長い語の一部(向上の図、上の図表)、コードの中は見ません。
|
|
66
|
+
en: 'A kind the document never numbers is not checked: there is no number to use. Nor are "Figure 2 below" (it has the number), a phrase inside a longer word, and code.'
|
package/skills/chaff/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: chaff
|
|
3
|
-
description: "Check prose with chaff (npx chaffjs): pick the genre preset for the kind of document (contract, statute, manual, FAQ, paper, fiction, transcript…), run it on Markdown or text, read each finding, fix the text or record why not, and tune chaff.yaml with rules --json and relax --why. Use when asked to lint, proofread or tighten documents, or to set up a team's writing rules."
|
|
3
|
+
description: "Check prose with chaff (npx chaffjs): pick the genre preset for the kind of document (contract, statute, manual, FAQ, paper, fiction, transcript…), run it on Markdown or text, read each finding, fix the text or record why not, and tune chaff.yaml with rules --json and relax --why. Use when asked to lint, proofread or tighten documents, or to set up a team's writing rules. Also use when asked to make text sound less AI-generated (「AIっぽさをなくして」「AI臭さを消して」「人間らしく書き直して」, 'make this sound human'): Light, Bold or Full mode, with Full (全面書き直し) when the request says 「全面的に」 or 'from scratch'."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Checking writing with chaff
|
|
@@ -61,6 +61,7 @@ relaxing a rule.
|
|
|
61
61
|
existing one is left as it is), and adds `.chaff-cache/` and `.env*` to `.gitignore`.
|
|
62
62
|
- `npx chaffjs rules --json [--genre <genre>]` prints every rule with its levels, the setting in effect (`now`,
|
|
63
63
|
the genre's preset included) and why a rule is off. Read it instead of guessing rule names or limits.
|
|
64
|
+
`npx chaffjs rules` shows the same as a table, grouped, with the level each rule runs at now.
|
|
64
65
|
- A level is `strict` / `normal` / `relaxed` / `off`; when even `relaxed` is too tight, a positive number is the
|
|
65
66
|
limit itself (`max-sentence-length: 260`).
|
|
66
67
|
- `prefer:` maps spellings to the team's (`e-mail: email`); `preferred-term: normal` turns the rule on.
|
|
@@ -68,6 +69,175 @@ relaxing a rule.
|
|
|
68
69
|
- `genre:` sets the kind of document; `by_path` sets one per folder; `--genre` overrides both for one run.
|
|
69
70
|
`rules:` wins over the genre's preset.
|
|
70
71
|
|
|
72
|
+
## Turn a team's style note into chaff.yaml
|
|
73
|
+
|
|
74
|
+
When the person gives house rules ("polite endings, sentences of at most 80 characters"), do not guess rule
|
|
75
|
+
names or numbers:
|
|
76
|
+
|
|
77
|
+
1. Read `npx chaffjs rules --json`. Each rule has `summary` (what it finds), `level_meaning` (what a level's
|
|
78
|
+
number means), `levels`, `example`, `not_flagged`, and `genres` (whether it runs in each genre).
|
|
79
|
+
2. Split the note into single requirements; map each to the rule whose `summary` and `level_meaning` fit. A
|
|
80
|
+
number between levels is written as the number itself (`max-sentence-length: 80`). Spellings go under
|
|
81
|
+
`prefer`, in-house words under `jargon`, required headings under `required_sections`.
|
|
82
|
+
3. Say plainly what no rule covers. For example, `no-mixed-desumasu` flags a register mixed into a document, but
|
|
83
|
+
does not require a particular one; a document wholly in the other register is not reported.
|
|
84
|
+
4. Write only what differs from the default, then check before committing: `npx chaffjs explain <rule-id>`, a
|
|
85
|
+
short sample that breaks each requirement (each must be reported), and `npx chaffjs rules` (the table shows the
|
|
86
|
+
level each rule now runs at).
|
|
87
|
+
|
|
88
|
+
## Adding a team rule
|
|
89
|
+
|
|
90
|
+
Pick the easiest way that can say the requirement:
|
|
91
|
+
|
|
92
|
+
| Requirement | Use |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| An existing rule covers it | A level, a number, `prefer`, `jargon` or `required_sections` in `chaff.yaml` |
|
|
95
|
+
| A fixed phrase or pattern, with the team's own message | `custom_rules` of type `words` or `pattern` (coming in the next release) |
|
|
96
|
+
| Decided by part of speech or inflection | `custom_rules` of type `tokens` (coming in the next release) |
|
|
97
|
+
| Counting or comparing that the above cannot express | a Node function, `type: module` (a later release) |
|
|
98
|
+
|
|
99
|
+
Test a new team rule the same way: `explain`, then a sample it must report and a sample it must not, before
|
|
100
|
+
committing `chaff.yaml`. The guide page "Adding a rule" covers each way and how to add a rule to chaff itself.
|
|
101
|
+
|
|
102
|
+
## Making AI-sounding text sound human
|
|
103
|
+
|
|
104
|
+
Use this section when asked to make a text sound less generated: 「AIっぽさをなくして」「AI臭さを消して」「人間らしく
|
|
105
|
+
書き直して」, "make this sound human", "this reads like AI wrote it".
|
|
106
|
+
|
|
107
|
+
chaff marks the shapes common in generated text (group "Signs of generated text" in `npx chaffjs rules`: `ai-tell`,
|
|
108
|
+
`contrast-framing`, `stock-transition`, `announcing-opener`, `colon-lead-in` (Japanese only), `assistant-residue`, and the signals
|
|
109
|
+
`ai-generated-composite` reads). Most are experimental: run with `--experimental`. None of them says the text was
|
|
110
|
+
generated. chaff never rewrites; the rewriting is yours.
|
|
111
|
+
|
|
112
|
+
**Start with the plan.** Run `npx chaffjs fix-plan <file> --experimental` (with the genre's `--genre`; `--json` to
|
|
113
|
+
read it as data). It prints, in the document's language:
|
|
114
|
+
|
|
115
|
+
- the constraints: keep facts, numbers, conditions and names; add no fact; ask the writer instead of inventing a
|
|
116
|
+
specific; two passes at most;
|
|
117
|
+
- the recommended mode and why, and the document-level signals with the outline's numbers;
|
|
118
|
+
- for each rule that fired: its rewrite direction, what to keep, what to avoid, one before/after pair, hints for the
|
|
119
|
+
`ai-tell` phrases found, and the spots (line and sentence);
|
|
120
|
+
- the check commands to run on the rewrite.
|
|
121
|
+
|
|
122
|
+
Follow it. Rewrite in the mode it recommends; a request that says 「全面的に」 or "from scratch" means Full whatever it
|
|
123
|
+
says. Apply each rule's direction at its spots. Where a fix needs a specific the text does not give, leave [ ] and
|
|
124
|
+
ask. Save the result under the name the plan gives, run its check commands, and report the mode and the checks'
|
|
125
|
+
output. The mode steps below say the rest.
|
|
126
|
+
|
|
127
|
+
Pick one of three modes and say which.
|
|
128
|
+
|
|
129
|
+
| Mode | Changes | Pick it when |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| **Light** | only the flagged spots | the content and the structure are fine and only some phrasing is off |
|
|
132
|
+
| **Bold** | each section's prose, keeping the outline | the outline is fixed (a report template, a manual, required sections) |
|
|
133
|
+
| **Full** | the whole document, from scratch | the request says 「全面的に」「一から」「全部書き直して」 / "from scratch" / "rewrite the whole thing"; or the genre is `blog/*` or an essay (`literature/essay`); or `ai-generated-composite` fires |
|
|
134
|
+
|
|
135
|
+
For a blog or an essay, and whenever `ai-generated-composite` fires, recommend Full. A Light or Bold pass leaves the
|
|
136
|
+
skeleton of generated text: a heading every few paragraphs, bold lead-ins, symmetric sections, a closing まとめ that
|
|
137
|
+
repeats the body. The writer usually wants the structure changed, not only the sentences.
|
|
138
|
+
|
|
139
|
+
**Light** (only the flagged spots):
|
|
140
|
+
|
|
141
|
+
1. `npx chaffjs fix-plan <file> --experimental` (or with the genre's `--genre`).
|
|
142
|
+
2. Rewrite only the flagged spots, each by its rule's direction in the plan. Keep the meaning, numbers, conditions and
|
|
143
|
+
technical constraints.
|
|
144
|
+
3. Run chaff again. At most two rewrite passes.
|
|
145
|
+
4. Show the rewritten text and a short list of what changed and why.
|
|
146
|
+
|
|
147
|
+
**Bold** (section by section, outline kept):
|
|
148
|
+
|
|
149
|
+
1. Run chaff with `--experimental` and note the document-level signals: the `ai-generated-composite` inputs,
|
|
150
|
+
`bold-density`, `contrast-framing`, `stock-transition`, `sentence-rhythm`.
|
|
151
|
+
2. Rewrite each section toward a human voice: less bold; one-line paragraphs and punchlines folded back into
|
|
152
|
+
paragraphs; no "X ではありません。Y です" / "It's not X. It's Y" frames; lists turned back into sentences where the
|
|
153
|
+
items connect; fewer em dashes; no announcing openers. Each paragraph carries one claim, joined to the last by a
|
|
154
|
+
connective, built around the writer's own experience or numbers where the original has them.
|
|
155
|
+
3. Run chaff again and report the same signals before and after, from chaff's output.
|
|
156
|
+
4. Run `npx chaffjs compare <old> <new>` (exit 1 on a dropped or added fact; `--json` to act on it). Restore every
|
|
157
|
+
dropped fact; for one that is not a fact (a number inside a metaphor, the heading of a section you cut), say why it
|
|
158
|
+
stays out. `--allow-dropped <kind>` excludes a kind you cut on purpose. Never leave an added fact.
|
|
159
|
+
|
|
160
|
+
**Full** (全面書き直し, from scratch):
|
|
161
|
+
|
|
162
|
+
1. **Take inventory before writing.** `npx chaffjs facts <file> --json` lists every fact `compare` will hold you to
|
|
163
|
+
(numbers, dates, times, URLs, code, names, quotations, headings, references, footnotes). `npx chaffjs outline <file>`
|
|
164
|
+
gives the old outline and its shape. Then write down, one line each, the writer's actual claims and every concrete
|
|
165
|
+
experience, example and opinion in the original. This inventory is what you write from; the old sentences are not.
|
|
166
|
+
2. **Throw away the structure.** Decide what the piece is for and who reads it. Choose one angle or story for the
|
|
167
|
+
whole piece, and outline it the way a person would. Do these before writing:
|
|
168
|
+
- reorder: put the conclusion, or the most interesting episode, first;
|
|
169
|
+
- merge thin sections and split overloaded ones, so a section is a real unit, not one heading per paragraph;
|
|
170
|
+
- cut sections that only restate, the closing まとめ / "Conclusion" included;
|
|
171
|
+
- drop a heading that wraps a single paragraph;
|
|
172
|
+
- turn a list-of-points section into a narrative with one through-line;
|
|
173
|
+
- no symmetric three-point sections unless the content really has three parts;
|
|
174
|
+
- move the writer's concrete experience to where it carries the argument;
|
|
175
|
+
- open with the point or a concrete scene, not a generic opener.
|
|
176
|
+
3. **Show the new outline first.** Put the old outline (headings from `chaff outline`) next to the proposed one:
|
|
177
|
+
headings, and one line per section on what it says. The writer then sees the structural change at a glance. Wait
|
|
178
|
+
for a yes, unless the person asked for it to be done without asking; then go straight on.
|
|
179
|
+
4. **Write it fresh**, in the writer's voice, from the inventory:
|
|
180
|
+
- paragraphs that argue, joined by connectives; sentence lengths that vary;
|
|
181
|
+
- plain verbs instead of metaphors ("静かに壊れる", "silently fails" → what actually happens);
|
|
182
|
+
- the writer's own episodes and numbers kept; generic filler cut;
|
|
183
|
+
- bold only where a reader truly must not miss something; lists only for real enumerations, steps or commands;
|
|
184
|
+
- no hedges stacked on a claim, no announcing what you are about to say, no "it's not X, it's Y", no em dashes;
|
|
185
|
+
- the register of the writer's other paragraphs (です/ます or だ/である) and of the platform (Zenn, a company
|
|
186
|
+
report, an email);
|
|
187
|
+
- nothing the inventory does not have: no new facts, people, numbers, causes or consequences.
|
|
188
|
+
|
|
189
|
+
Three principles while writing:
|
|
190
|
+
- **Undo personification.** A thing or an idea as the subject of a verb of will (秩序が壊れる, 文化が醸成される,
|
|
191
|
+
アーキテクチャが要求する) becomes what a person or the system does. 「チームにレビューの文化が醸成された」 →
|
|
192
|
+
「チームで互いにレビューをするようになった」. If the original does not say who, ask the writer.
|
|
193
|
+
- **Turn noun endings and noun chains back into sentences with a verb.** 「キュー滞留によるメッセージ処理遅延の発生。」 →
|
|
194
|
+
「キューにメッセージが溜まり、処理が遅れた。」 A noun ending hides who did what and when.
|
|
195
|
+
- **Never invent specifics.** A vague sentence may read better with a concrete example. If the writer did not give
|
|
196
|
+
one, ask for it, or mark your guess for them to confirm. Never write it as fact.
|
|
197
|
+
「チームの雰囲気が良くなった」 stays as it is, with a question: 「雰囲気が良くなったと感じたのは、どんな場面でしたか」.
|
|
198
|
+
`chaff compare` catches an added number or name, but not added wording such as 「朝会で冗談が出るようになり」, so
|
|
199
|
+
this one is yours to keep.
|
|
200
|
+
5. **Check.**
|
|
201
|
+
- `npx chaffjs <old> --experimental` and `npx chaffjs <new> --experimental`: the AI signals before and after.
|
|
202
|
+
- `npx chaffjs outline <old> <new>`: headings, average section length, text in lists, bold, before and after. A
|
|
203
|
+
restructure shows up here, not only in rule counts.
|
|
204
|
+
- `npx chaffjs compare <old> <new> --distinct --allow-dropped heading --allow-added heading`: the headings are the
|
|
205
|
+
structure you rebuilt on purpose; every other dropped fact is restored and no other fact is added. A cut まとめ
|
|
206
|
+
restates facts the body still holds, so `--distinct` counts a fact as kept when the new text states it at least
|
|
207
|
+
once.
|
|
208
|
+
6. **Stop** when all of these hold, or after two full passes, whichever comes first:
|
|
209
|
+
- `ai-generated-composite` does not fire;
|
|
210
|
+
- the density rules (`bold-density`, `contrast-framing`, `stock-transition`, `colon-lead-in`) are under their limits;
|
|
211
|
+
- `compare` is clean, or every exclusion has a stated reason.
|
|
212
|
+
7. **Show** the new text, a short "what changed and why" list, then a table of the signals and the shape before and
|
|
213
|
+
after, taken from chaff's output.
|
|
214
|
+
|
|
215
|
+
**Read for these too.** chaff cannot detect them mechanically, so check them by reading, in every mode:
|
|
216
|
+
|
|
217
|
+
- a generic opener or closer ("本記事では〜解説します", "いかがでしたでしょうか", "In today's fast-paced world");
|
|
218
|
+
- explaining what every reader already knows;
|
|
219
|
+
- every section the same length and the same shape;
|
|
220
|
+
- a list of benefits with no cost or trade-off;
|
|
221
|
+
- no first-hand detail: nothing the writer saw, measured or did;
|
|
222
|
+
- the same enthusiasm everywhere, so nothing stands out;
|
|
223
|
+
- politeness piled on politeness;
|
|
224
|
+
- a definition nobody asked for;
|
|
225
|
+
- headings that are full sentences or slogans;
|
|
226
|
+
- a まとめ / "Conclusion" that repeats the body.
|
|
227
|
+
|
|
228
|
+
In every mode:
|
|
229
|
+
|
|
230
|
+
- Never add facts, people, numbers or causes the original does not have.
|
|
231
|
+
- Keep a domain term a word rule trips when it is right in context.
|
|
232
|
+
- Prefer a direct statement over a negated contrast. Say who does what.
|
|
233
|
+
- Never loop just to silence a warning; two passes at most, and list what is left with the reason.
|
|
234
|
+
- Per genre: in a tech article, replace metaphors ("静かに壊れる", "silently fails") with what happens and keep steps
|
|
235
|
+
and commands as lists; in a business document, put the conclusion and who does what first and keep tables and
|
|
236
|
+
figures; in an essay, fold punchlines back in and replace big words ("真理", "new possibilities") with the scene.
|
|
237
|
+
|
|
238
|
+
The guide page "Making AI-sounding text sound human" has worked examples of a Bold and a Full rewrite, with chaff's
|
|
239
|
+
output before and after.
|
|
240
|
+
|
|
71
241
|
## Structured documents
|
|
72
242
|
|
|
73
243
|
- `npx chaffjs tree <file>` shows a contract or specification as a tree of addresses (`3.2` for 第3条第2項 or
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { namesAcronym } from "./detectors/acronym-expansion.ts";
|
|
2
|
+
|
|
3
|
+
// 略語とその展開を、文書が書いたとおりに読む。同じ略語を二通りに展開していないかを比べるため。
|
|
4
|
+
|
|
5
|
+
/** 本文の一続き(文)。start は文書の中の位置。 */
|
|
6
|
+
export type ExpansionText = { readonly start: number; readonly text: string };
|
|
7
|
+
|
|
8
|
+
export type Expansion = { readonly acronym: string; readonly name: string; readonly offset: number };
|
|
9
|
+
|
|
10
|
+
const ACRONYM = String.raw`[A-Z][A-Z0-9&]*[A-Z]`;
|
|
11
|
+
const QUOTE = String.raw`["“”'‘’「」]?`;
|
|
12
|
+
|
|
13
|
+
/** 名前のあとに括弧で略語(Service Level Agreement (SLA)、(the "SLA"))。 */
|
|
14
|
+
const NAME_FIRST = new RegExp(String.raw`[((]\s*(?:the\s+)?${QUOTE}(?<acronym>${ACRONYM})${QUOTE}\s*[))]`, "gu");
|
|
15
|
+
/** 略語のあとに括弧で名前(SLA (Service Level Agreement)、CI(継続的インテグレーション))。 */
|
|
16
|
+
const ACRONYM_FIRST = new RegExp(String.raw`(?<![\p{Script=Latin}\p{N}])(?<acronym>${ACRONYM})\s?[((](?<name>[^()()\n]{2,60})[))]`, "gu");
|
|
17
|
+
|
|
18
|
+
/** 頭文字に数えない短い語(Department of Defense の of)。 */
|
|
19
|
+
const SMALL_WORDS: ReadonlySet<string> = new Set(["of", "and", "the", "for", "to", "in", "on", "a", "an", "&", "de", "by", "with"]);
|
|
20
|
+
|
|
21
|
+
const wordsBefore = (text: string): string[] =>
|
|
22
|
+
text
|
|
23
|
+
.replaceAll(/["“”'‘’]/gu, "")
|
|
24
|
+
.trim()
|
|
25
|
+
.split(/\s+/u)
|
|
26
|
+
.filter((word) => word !== "");
|
|
27
|
+
|
|
28
|
+
const initialsOf = (words: readonly string[]): string =>
|
|
29
|
+
words
|
|
30
|
+
.filter((word) => !SMALL_WORDS.has(word.toLowerCase()))
|
|
31
|
+
.flatMap((word) => word.split("-"))
|
|
32
|
+
.map((word) => word.charAt(0))
|
|
33
|
+
.join("")
|
|
34
|
+
.toUpperCase();
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 括弧の前の語のうち、頭文字がちょうど略語になる最も短い並び(the Federal Open Market Committee (FOMC) なら
|
|
38
|
+
* Federal Open Market Committee)。頭文字の揃う並びが無ければ、展開ではない((see Table 2) や (FOMC) の前の文)。
|
|
39
|
+
*/
|
|
40
|
+
export const nameBefore = (text: string, acronym: string): string | undefined => {
|
|
41
|
+
const words = wordsBefore(text).slice(-acronym.length * 2 - 2);
|
|
42
|
+
const letters = acronym.replaceAll("&", "");
|
|
43
|
+
const width = words.findIndex((_word, index) => initialsOf(words.slice(-(index + 1))) === letters);
|
|
44
|
+
if (width < 0) return undefined;
|
|
45
|
+
const name = words.slice(-(width + 1));
|
|
46
|
+
const start = name.findIndex((word) => !SMALL_WORDS.has(word.toLowerCase()));
|
|
47
|
+
return name
|
|
48
|
+
.slice(start)
|
|
49
|
+
.join(" ")
|
|
50
|
+
.replace(/[,;:]$/u, "");
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const NON_LATIN_NAME = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}ー・\s\p{L}\p{N}-]+$/u;
|
|
54
|
+
const HAS_KANA_OR_KANJI = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}]/u;
|
|
55
|
+
/** 括弧の中の定義の語や文(以下「CI」という。、読点のある説明)は、名前ではない。 */
|
|
56
|
+
const NOT_A_NAME = /以下|という|[、。,;:]/u;
|
|
57
|
+
|
|
58
|
+
/** 略語のあとの括弧の中が、その略語の名前か。英字の名前は頭文字が揃うとき、日本語の名前は語だけのとき。 */
|
|
59
|
+
const isNameAfter = (name: string, acronym: string): boolean => {
|
|
60
|
+
if (NOT_A_NAME.test(name)) return false;
|
|
61
|
+
if (HAS_KANA_OR_KANJI.test(name)) return NON_LATIN_NAME.test(name);
|
|
62
|
+
return namesAcronym(name, acronym);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** 文の中の略語の展開。両方の形を、文書の中の位置の順に。 */
|
|
66
|
+
export const expansionsIn = (body: ExpansionText): Expansion[] => {
|
|
67
|
+
const nameFirst = [...body.text.matchAll(NAME_FIRST)].flatMap((match) => {
|
|
68
|
+
const acronym = match.groups?.["acronym"] ?? "";
|
|
69
|
+
const name = nameBefore(body.text.slice(0, match.index), acronym);
|
|
70
|
+
return name === undefined ? [] : [{ acronym, name, offset: body.start + match.index }];
|
|
71
|
+
});
|
|
72
|
+
const acronymFirst = [...body.text.matchAll(ACRONYM_FIRST)].flatMap((match) => {
|
|
73
|
+
const acronym = match.groups?.["acronym"] ?? "";
|
|
74
|
+
const name = (match.groups?.["name"] ?? "").trim();
|
|
75
|
+
return isNameAfter(name, acronym) ? [{ acronym, name, offset: body.start + match.index }] : [];
|
|
76
|
+
});
|
|
77
|
+
return [...nameFirst, ...acronymFirst].toSorted((left, right) => left.offset - right.offset);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** 比べる形。大文字小文字、ハイフンと空白、& と and、語の終わりの複数の s は名前を変えない。 */
|
|
81
|
+
export const comparableName = (name: string): string =>
|
|
82
|
+
name
|
|
83
|
+
.toLowerCase()
|
|
84
|
+
.replaceAll("&", " and ")
|
|
85
|
+
.replaceAll(/[-‐‑\s]+/gu, " ")
|
|
86
|
+
.trim()
|
|
87
|
+
.replaceAll(/(?<=\p{Script=Latin}{3})s\b/gu, "");
|
|
88
|
+
|
|
89
|
+
export type ExpansionConflict = { readonly expansion: Expansion; readonly first: Expansion };
|
|
90
|
+
|
|
91
|
+
/** 同じ略語の、最初の展開と違う展開。違う書き方ごとに最初の一つだけ。 */
|
|
92
|
+
export const expansionConflicts = (expansions: readonly Expansion[]): ExpansionConflict[] => {
|
|
93
|
+
const firsts = new Map<string, Expansion>();
|
|
94
|
+
const reported = new Set<string>();
|
|
95
|
+
return expansions.flatMap((expansion) => {
|
|
96
|
+
const first = firsts.get(expansion.acronym);
|
|
97
|
+
if (first === undefined) {
|
|
98
|
+
firsts.set(expansion.acronym, expansion);
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
const variant = `${expansion.acronym}\u0000${comparableName(expansion.name)}`;
|
|
102
|
+
if (comparableName(first.name) === comparableName(expansion.name) || reported.has(variant)) return [];
|
|
103
|
+
reported.add(variant);
|
|
104
|
+
return [{ expansion, first }];
|
|
105
|
+
});
|
|
106
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { escapeRegExp } from "./orthography.ts";
|
|
2
|
+
import type { BulletList, Span } from "./plugin.ts";
|
|
3
|
+
import { joined, linesAbove, type TextBlock } from "./text-above.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 箇条書きのすぐ前の文が予告した数(以下の3点、the following three steps)と、箇条書きのいちばん外側の項目の数。
|
|
7
|
+
* 予告と読むのは、文の最後の一文に数がちょうど一つあり、先を指す語がその前にあるか文がコロンで終わるときだけ。
|
|
8
|
+
* 言語の知識(先を指す語、漢数字や数の語、数える語、数を目安や順番にする語)は語彙表から受け取る。
|
|
9
|
+
*/
|
|
10
|
+
export type CountWords = {
|
|
11
|
+
/** 以下の、次の、following。 */
|
|
12
|
+
readonly anchors: readonly string[];
|
|
13
|
+
/** 数を字で書いたもの。一から順に並べる。 */
|
|
14
|
+
readonly numbers: readonly string[];
|
|
15
|
+
/** 数のすぐ後ろで並べるものを数える語。点、つ、steps。 */
|
|
16
|
+
readonly counters: readonly string[];
|
|
17
|
+
/** 数のすぐ前にあると予告でなくなる語(約、第、at least)。 */
|
|
18
|
+
readonly hedgesBefore: readonly string[];
|
|
19
|
+
/** 数か数える語のすぐ後ろにあると予告でなくなる語(以上、目、or more)。 */
|
|
20
|
+
readonly hedgesAfter: readonly string[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type CountMismatch = { readonly offset: number; readonly phrase: string; readonly announced: number; readonly listed: number };
|
|
24
|
+
|
|
25
|
+
/** counted: 数える語が付いている(3点)。付いていない数(the following two:)は、先を指す語のすぐ後ろでだけ予告に読む。 */
|
|
26
|
+
type Phrase = { readonly start: number; readonly numberEnd: number; readonly end: number; readonly announced: number; readonly counted: boolean };
|
|
27
|
+
|
|
28
|
+
/** 予告の文の外側。見出し、表、引用、コードの囲みの行は、すぐ下の箇条書きを予告する文ではない。 */
|
|
29
|
+
const NOT_A_LEAD = /^[ \t]*(?:#|\||>|```|~~~)/u;
|
|
30
|
+
|
|
31
|
+
/** 箇条書きのすぐ前の塊。見出し・表・引用・コードの囲みなら undefined。 */
|
|
32
|
+
const leadBefore = (source: string, listStart: number): TextBlock | undefined => {
|
|
33
|
+
const lines = linesAbove(source, listStart);
|
|
34
|
+
return lines.some((line) => NOT_A_LEAD.test(line.text)) ? undefined : joined(source, lines);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** 文の終わり。英語の「.」は後ろが空白のときだけ(3.5 や e.g. の途中で切らない)。 */
|
|
38
|
+
const SENTENCE_END = /[。!?!?]|\.(?=\s)/gu;
|
|
39
|
+
|
|
40
|
+
/** 塊の最後の一文の始まり(塊の中の位置)。 */
|
|
41
|
+
const lastSentenceStart = (text: string): number => {
|
|
42
|
+
const body = text.trimEnd();
|
|
43
|
+
const ends = [...body.matchAll(SENTENCE_END)].map((match) => match.index + match[0].length).filter((end) => end < body.length);
|
|
44
|
+
return ends.at(-1) ?? 0;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const alternation = (words: readonly string[]): string =>
|
|
48
|
+
words
|
|
49
|
+
.toSorted((a, b) => b.length - a.length)
|
|
50
|
+
.map(escapeRegExp)
|
|
51
|
+
.join("|");
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 数と、それが数えるもの。数の前が数字・英字・数の字なら数の途中(十三、23、eleven の中)。
|
|
55
|
+
* 英語は数と数える語の間に語を二つまで置ける(three key steps)。数える語が無くても、文がコロンで終わる直前の数(the following two:)は数に読む。
|
|
56
|
+
*/
|
|
57
|
+
const phrasePattern = (words: CountWords): RegExp => {
|
|
58
|
+
const numberChars = escapeRegExp([...new Set(words.numbers.join(""))].join(""));
|
|
59
|
+
const numbers = words.numbers.length === 0 ? "\\p{Nd}+" : `\\p{Nd}+|${alternation(words.numbers)}`;
|
|
60
|
+
const counted = `[ \\t\\u00a0]?(?:\\p{Ll}[\\p{Ll}-]*[ \\t]){0,2}(${alternation(words.counters)})(?![A-Za-z])`;
|
|
61
|
+
return new RegExp(`(?<![\\p{N}A-Za-z${numberChars}])(${numbers})(?:${counted}|(?=[ \\t]?[::][ \\t]*$))`, "giu");
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const valueOf = (written: string, numbers: readonly string[]): number => {
|
|
65
|
+
const digits = Number(written.normalize("NFKC"));
|
|
66
|
+
if (!Number.isNaN(digits)) return digits;
|
|
67
|
+
return numbers.findIndex((number) => number.toLowerCase() === written.toLowerCase()) + 1;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const LATIN_LETTER = /[A-Za-z]/u;
|
|
71
|
+
const isLatin = (char: string | undefined): boolean => LATIN_LETTER.test(char ?? "");
|
|
72
|
+
|
|
73
|
+
/** 英語の語は語の切れ目で照らす(over が moreover に当たらない)。日本語の語は字面どおり。 */
|
|
74
|
+
const endsWithWord = (text: string, word: string): boolean => text.endsWith(word) && !(isLatin(word[0]) && isLatin(text.at(-word.length - 1)));
|
|
75
|
+
|
|
76
|
+
const startsWithWord = (text: string, word: string): boolean => text.startsWith(word) && !(isLatin(word.at(-1)) && isLatin(text[word.length]));
|
|
77
|
+
|
|
78
|
+
const isHedged = (sentence: string, phrase: Phrase, words: CountWords): boolean => {
|
|
79
|
+
const before = sentence.slice(0, phrase.start).trimEnd().toLowerCase();
|
|
80
|
+
const afters = [sentence.slice(phrase.numberEnd), sentence.slice(phrase.end)].map((text) => text.trimStart().toLowerCase());
|
|
81
|
+
return (
|
|
82
|
+
words.hedgesBefore.some((hedge) => endsWithWord(before, hedge.toLowerCase())) ||
|
|
83
|
+
words.hedgesAfter.some((hedge) => afters.some((after) => startsWithWord(after, hedge.toLowerCase())))
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const COLON_END = /[::][ \t]*$/u;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 数字か、語の切れ目で区切った英語の数の語(two)。英字や点に続く数字は版や名前の一部(v2、1.2)なので数えない。
|
|
91
|
+
* 漢数字は「一緒」「一般」の中にもあるので数えない。
|
|
92
|
+
*/
|
|
93
|
+
const numberPattern = (words: CountWords): RegExp => {
|
|
94
|
+
const latin = words.numbers.filter((number) => isLatin(number[0]));
|
|
95
|
+
const digits = String.raw`(?<![A-Za-z.])\p{Nd}`;
|
|
96
|
+
return new RegExp(latin.length === 0 ? digits : `${digits}|(?<![A-Za-z])(?:${alternation(latin)})(?![A-Za-z])`, "iu");
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
type Patterns = { readonly phrase: RegExp; readonly number: RegExp };
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 数える語の無い数は、先を指す語のすぐ後ろでだけ(the following two:)。「under $75:」の金額を数に読まない。
|
|
103
|
+
* 先を指す語が無く、終わりのコロンだけが予告なら、コロンが渡すのはその手前のいちばん近い数。数の後ろにまだ数があれば
|
|
104
|
+
* (「1 つのページにまとめていましたが、2 ページに分けました:」)、その数は予告の数ではない。
|
|
105
|
+
*/
|
|
106
|
+
const pointsAhead = (sentence: string, phrase: Phrase, anchors: readonly string[], number: RegExp): boolean => {
|
|
107
|
+
const before = sentence.slice(0, phrase.start).toLowerCase();
|
|
108
|
+
const lowered = anchors.map((anchor) => anchor.toLowerCase());
|
|
109
|
+
if (!phrase.counted) return lowered.some((anchor) => endsWithWord(before.trimEnd(), anchor));
|
|
110
|
+
if (lowered.some((anchor) => before.includes(anchor))) return true;
|
|
111
|
+
return COLON_END.test(sentence.trimEnd()) && !number.test(sentence.slice(phrase.end));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/** 最後の一文の予告。数がちょうど一つで、目安や順番でなく、先を指しているときだけ。 */
|
|
115
|
+
const announcedIn = (sentence: string, words: CountWords, patterns: Patterns): Phrase | undefined => {
|
|
116
|
+
const phrases = [...sentence.matchAll(patterns.phrase)].map((match) => ({
|
|
117
|
+
start: match.index,
|
|
118
|
+
numberEnd: match.index + (match[1] ?? "").length,
|
|
119
|
+
end: match.index + match[0].length,
|
|
120
|
+
announced: valueOf(match[1] ?? "", words.numbers),
|
|
121
|
+
counted: match[2] !== undefined,
|
|
122
|
+
}));
|
|
123
|
+
const only = phrases.length === 1 ? phrases[0] : undefined;
|
|
124
|
+
if (only === undefined || only.announced < 1 || isHedged(sentence, only, words)) return undefined;
|
|
125
|
+
return pointsAhead(sentence, only, words.anchors, patterns.number) ? only : undefined;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** 位置から空白と改行を読み飛ばした先。 */
|
|
129
|
+
const pastSpace = (source: string, at: number): number => {
|
|
130
|
+
const filled = /[^ \t\r\n]/gu;
|
|
131
|
+
filled.lastIndex = at;
|
|
132
|
+
return filled.exec(source)?.index ?? source.length;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/** 箇条書きの終わり(後ろの空白を読み飛ばした先)と始まり。空白だけを挟んで続く二つの箇条書きは、終わりと始まりが同じ位置になる。 */
|
|
136
|
+
type Neighbours = { readonly ends: ReadonlySet<number>; readonly starts: ReadonlySet<number> };
|
|
137
|
+
|
|
138
|
+
const neighboursOf = (source: string, lists: readonly BulletList[]): Neighbours => ({
|
|
139
|
+
ends: new Set(lists.map((list) => pastSpace(source, list.span.end))),
|
|
140
|
+
starts: new Set(lists.map((list) => list.span.start)),
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
/** 空白だけを挟んで前か後ろに別の箇条書きが続く。印が変わって二つに割れた一つの並びかもしれず、数を決められない。 */
|
|
144
|
+
const hasNeighbour = (source: string, list: Span, neighbours: Neighbours): boolean =>
|
|
145
|
+
neighbours.ends.has(list.start) || neighbours.starts.has(pastSpace(source, list.end));
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 分類した箇条書き(「- **実運用**: CLI / Telegram」)の行は、ラベルの後ろに項目を区切って並べる。予告の数は区切った項目の数かもしれない。
|
|
149
|
+
* 区切りは斜線だけ。読点とコンマは項目の説明の文の中にも書くので(「UI: rename the button to Save, continue」)区切りに数えない。
|
|
150
|
+
* 行内のコードの中の斜線(`a/b`)も数えない。
|
|
151
|
+
*/
|
|
152
|
+
const CATEGORY_ITEM = /^[ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+[^::\n]{1,40}[::][ \t]*(?<members>\S[^\n]*)/u;
|
|
153
|
+
const MEMBER_SEPARATOR = /[//]/u;
|
|
154
|
+
const INLINE_CODE = /`[^`\n]*`/gu;
|
|
155
|
+
|
|
156
|
+
const membersOf = (item: string): number | undefined =>
|
|
157
|
+
CATEGORY_ITEM.exec(item)
|
|
158
|
+
?.groups?.["members"]?.replace(INLINE_CODE, "code")
|
|
159
|
+
.split(MEMBER_SEPARATOR)
|
|
160
|
+
.filter((member) => member.trim() !== "").length;
|
|
161
|
+
|
|
162
|
+
/** どの行も分類の形なら、区切って並べた項目の数の和。一行でも違えば undefined。 */
|
|
163
|
+
const categorisedCount = (source: string, list: BulletList): number | undefined => {
|
|
164
|
+
const counts = list.itemSpans.map((item) => membersOf(source.slice(item.start, item.end)));
|
|
165
|
+
return counts.every((count) => count !== undefined) ? counts.reduce<number>((sum, count) => sum + (count ?? 0), 0) : undefined;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/** 予告の数が、行の数か、分類した行に並べた項目の数に合う。 */
|
|
169
|
+
const matchesList = (announced: number, source: string, list: BulletList): boolean =>
|
|
170
|
+
announced === list.items.length || announced === categorisedCount(source, list);
|
|
171
|
+
|
|
172
|
+
type Context = { readonly source: string; readonly words: CountWords; readonly patterns: Patterns; readonly neighbours: Neighbours };
|
|
173
|
+
|
|
174
|
+
const mismatchOf = ({ source, words, patterns, neighbours }: Context, list: BulletList): CountMismatch[] => {
|
|
175
|
+
if (hasNeighbour(source, list.span, neighbours)) return [];
|
|
176
|
+
const lead = leadBefore(source, list.span.start);
|
|
177
|
+
if (lead === undefined) return [];
|
|
178
|
+
const sentenceStart = lastSentenceStart(lead.text);
|
|
179
|
+
const sentence = lead.text.slice(sentenceStart);
|
|
180
|
+
const phrase = announcedIn(sentence, words, patterns);
|
|
181
|
+
if (phrase === undefined || matchesList(phrase.announced, source, list)) return [];
|
|
182
|
+
const offset = lead.start + sentenceStart + phrase.start;
|
|
183
|
+
return [{ offset, phrase: sentence.slice(phrase.start, phrase.end).trim(), announced: phrase.announced, listed: list.items.length }];
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export const announcedCountMismatches = (source: string, lists: readonly BulletList[], words: CountWords): CountMismatch[] => {
|
|
187
|
+
if (words.counters.length === 0) return [];
|
|
188
|
+
const context = { source, words, patterns: { phrase: phrasePattern(words), number: numberPattern(words) }, neighbours: neighboursOf(source, lists) };
|
|
189
|
+
return lists.flatMap((list) => mismatchOf(context, list));
|
|
190
|
+
};
|