chaffjs 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/announced-count.d.ts +26 -0
- package/dist/announced-count.d.ts.map +1 -0
- package/dist/announced-count.js +104 -0
- package/dist/announced-count.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 +9 -2
- package/dist/calendar-number.d.ts.map +1 -1
- package/dist/calendar-number.js +18 -4
- 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.map +1 -1
- package/dist/cli-text.js +8 -4
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.js +33 -30
- package/dist/cli.js.map +1 -1
- package/dist/closing-numbers.d.ts +20 -0
- package/dist/closing-numbers.d.ts.map +1 -0
- package/dist/closing-numbers.js +56 -0
- package/dist/closing-numbers.js.map +1 -0
- package/dist/commands/compare.d.ts +8 -0
- package/dist/commands/compare.d.ts.map +1 -0
- package/dist/commands/compare.js +72 -0
- package/dist/commands/compare.js.map +1 -0
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +17 -9
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/feedback.d.ts +5 -2
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +11 -5
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +13 -13
- 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 +65 -0
- package/dist/compare/clock-time.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 +58 -0
- package/dist/compare/extract.js.map +1 -0
- package/dist/compare/fact-text.d.ts +23 -0
- package/dist/compare/fact-text.d.ts.map +1 -0
- package/dist/compare/fact-text.js +47 -0
- package/dist/compare/fact-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 +19 -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 +33 -0
- package/dist/compare/outcome.d.ts.map +1 -0
- package/dist/compare/outcome.js +40 -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 +44 -0
- package/dist/compare/proper-nouns.js.map +1 -0
- package/dist/compare/render.d.ts +9 -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 +24 -0
- package/dist/compare/text-atoms.d.ts.map +1 -0
- package/dist/compare/text-atoms.js +67 -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 +15 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +5 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/option-problems.d.ts +16 -0
- package/dist/config/option-problems.d.ts.map +1 -0
- package/dist/config/option-problems.js +58 -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 +16 -0
- package/dist/config/style.d.ts.map +1 -0
- package/dist/config/style.js +36 -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 +8 -0
- package/dist/custom/load.d.ts.map +1 -0
- package/dist/custom/load.js +11 -0
- package/dist/custom/load.js.map +1 -0
- package/dist/custom/parse.d.ts +70 -0
- package/dist/custom/parse.d.ts.map +1 -0
- package/dist/custom/parse.js +215 -0
- package/dist/custom/parse.js.map +1 -0
- package/dist/custom/problems.d.ts +5 -0
- package/dist/custom/problems.d.ts.map +1 -0
- package/dist/custom/problems.js +78 -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.d.ts.map +1 -1
- package/dist/detect.js +24 -2
- package/dist/detect.js.map +1 -1
- package/dist/detectors/acronym-context.d.ts +4 -0
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +25 -4
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/acronym-expansion.d.ts +2 -0
- package/dist/detectors/acronym-expansion.d.ts.map +1 -1
- package/dist/detectors/acronym-expansion.js +104 -1
- package/dist/detectors/acronym-expansion.js.map +1 -1
- package/dist/detectors/agreement-slip.d.ts +32 -0
- package/dist/detectors/agreement-slip.d.ts.map +1 -0
- package/dist/detectors/agreement-slip.js +137 -0
- package/dist/detectors/agreement-slip.js.map +1 -0
- package/dist/detectors/ai-phrasing.d.ts +20 -0
- package/dist/detectors/ai-phrasing.d.ts.map +1 -0
- package/dist/detectors/ai-phrasing.js +112 -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/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/content-morphemes.d.ts +4 -0
- package/dist/detectors/content-morphemes.d.ts.map +1 -0
- package/dist/detectors/content-morphemes.js +12 -0
- package/dist/detectors/content-morphemes.js.map +1 -0
- 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 +4 -0
- package/dist/detectors/dangling-figure.d.ts.map +1 -0
- package/dist/detectors/dangling-figure.js +18 -0
- package/dist/detectors/dangling-figure.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 +33 -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/en-shape.d.ts +0 -1
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +0 -235
- package/dist/detectors/en-shape.js.map +1 -1
- 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/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/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 +17 -20
- 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/heading-overlap.d.ts +13 -0
- package/dist/detectors/heading-overlap.d.ts.map +1 -0
- package/dist/detectors/heading-overlap.js +52 -0
- package/dist/detectors/heading-overlap.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 +40 -2
- package/dist/detectors/index.js.map +1 -1
- 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/letter-joined-name.d.ts +13 -0
- package/dist/detectors/letter-joined-name.d.ts.map +1 -0
- package/dist/detectors/letter-joined-name.js +11 -0
- package/dist/detectors/letter-joined-name.js.map +1 -0
- package/dist/detectors/lexicon-match.d.ts +4 -0
- package/dist/detectors/lexicon-match.d.ts.map +1 -1
- package/dist/detectors/lexicon-match.js +7 -2
- package/dist/detectors/lexicon-match.js.map +1 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +5 -2
- 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 +65 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -0
- package/dist/detectors/list-sentence.js +105 -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 +57 -0
- package/dist/detectors/long-vowel.js.map +1 -0
- package/dist/detectors/markup-finding.d.ts +6 -0
- package/dist/detectors/markup-finding.d.ts.map +1 -0
- package/dist/detectors/markup-finding.js +19 -0
- package/dist/detectors/markup-finding.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/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +16 -12
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/oxford-comma.d.ts +9 -0
- package/dist/detectors/oxford-comma.d.ts.map +1 -0
- package/dist/detectors/oxford-comma.js +246 -0
- package/dist/detectors/oxford-comma.js.map +1 -0
- 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/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/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 +94 -54
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/stacked-hedge.d.ts +0 -7
- package/dist/detectors/stacked-hedge.d.ts.map +1 -1
- package/dist/detectors/stacked-hedge.js +6 -3
- package/dist/detectors/stacked-hedge.js.map +1 -1
- package/dist/detectors/stray-space.d.ts +7 -0
- package/dist/detectors/stray-space.d.ts.map +1 -0
- package/dist/detectors/stray-space.js +34 -0
- package/dist/detectors/stray-space.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 +37 -1
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/structure.d.ts +4 -4
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +7 -6
- package/dist/detectors/structure.js.map +1 -1
- 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 +19 -0
- package/dist/detectors/url-run-on.js.map +1 -0
- 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 +11 -4
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +99 -95
- 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/figure-references.d.ts +30 -0
- package/dist/figure-references.d.ts.map +1 -0
- package/dist/figure-references.js +76 -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/genre-parse.d.ts +5 -1
- package/dist/genre-parse.d.ts.map +1 -1
- package/dist/genre-parse.js +16 -3
- package/dist/genre-parse.js.map +1 -1
- package/dist/genre-suggest.d.ts.map +1 -1
- package/dist/genre-suggest.js +15 -1
- package/dist/genre-suggest.js.map +1 -1
- 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/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 +36 -11
- package/dist/line-paragraphs.js.map +1 -1
- package/dist/long-vowel.d.ts +35 -0
- package/dist/long-vowel.d.ts.map +1 -0
- package/dist/long-vowel.js +71 -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 +180 -0
- package/dist/markup.js.map +1 -0
- package/dist/mask.d.ts.map +1 -1
- package/dist/mask.js +10 -16
- package/dist/mask.js.map +1 -1
- package/dist/number-name.d.ts +21 -5
- package/dist/number-name.d.ts.map +1 -1
- package/dist/number-name.js +120 -18
- package/dist/number-name.js.map +1 -1
- package/dist/opening-line.d.ts +3 -0
- package/dist/opening-line.d.ts.map +1 -0
- package/dist/opening-line.js +14 -0
- package/dist/opening-line.js.map +1 -0
- package/dist/orthography.d.ts +7 -1
- package/dist/orthography.d.ts.map +1 -1
- package/dist/orthography.js +16 -5
- package/dist/orthography.js.map +1 -1
- 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/paragraph-length.d.ts +7 -0
- package/dist/paragraph-length.d.ts.map +1 -0
- package/dist/paragraph-length.js +10 -0
- package/dist/paragraph-length.js.map +1 -0
- 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 +121 -0
- 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 +0 -2
- package/dist/quoted-span.d.ts.map +1 -1
- package/dist/quoted-span.js +9 -4
- package/dist/quoted-span.js.map +1 -1
- package/dist/reasons.d.ts +3 -0
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +6 -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/explain.d.ts +7 -1
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +36 -12
- 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 +102 -12
- 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/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 +54 -0
- package/dist/rule-guide.d.ts.map +1 -0
- package/dist/rule-guide.js +81 -0
- package/dist/rule-guide.js.map +1 -0
- package/dist/rule-load.d.ts.map +1 -1
- package/dist/rule-load.js +94 -32
- 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 +3 -1
- package/dist/run-semantic.d.ts.map +1 -1
- package/dist/run-semantic.js +8 -3
- package/dist/run-semantic.js.map +1 -1
- package/dist/run.d.ts +15 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +57 -10
- package/dist/run.js.map +1 -1
- package/dist/semantic.d.ts +1 -1
- package/dist/semantic.d.ts.map +1 -1
- package/dist/semantic.js +10 -3
- package/dist/semantic.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 +6 -1
- package/dist/setting-problems.js.map +1 -1
- 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/span-merge.d.ts +4 -0
- package/dist/span-merge.d.ts.map +1 -0
- package/dist/span-merge.js +12 -0
- package/dist/span-merge.js.map +1 -0
- package/dist/speaker-labels.d.ts +4 -0
- package/dist/speaker-labels.d.ts.map +1 -0
- package/dist/speaker-labels.js +106 -0
- package/dist/speaker-labels.js.map +1 -0
- package/dist/stray-space.d.ts +17 -0
- package/dist/stray-space.d.ts.map +1 -0
- package/dist/stray-space.js +66 -0
- package/dist/stray-space.js.map +1 -0
- 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 +21 -0
- package/dist/structure/date-range.d.ts.map +1 -0
- package/dist/structure/date-range.js +45 -0
- package/dist/structure/date-range.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/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 +94 -42
- 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 +17 -2
- 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 +19 -0
- package/dist/style-parse.d.ts.map +1 -0
- package/dist/style-parse.js +60 -0
- package/dist/style-parse.js.map +1 -0
- package/dist/subheading-line.d.ts +6 -0
- package/dist/subheading-line.d.ts.map +1 -0
- package/dist/subheading-line.js +57 -0
- package/dist/subheading-line.js.map +1 -0
- package/dist/team-names.d.ts.map +1 -1
- package/dist/team-names.js +11 -14
- package/dist/team-names.js.map +1 -1
- 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 +60 -2
- package/package.json +5 -3
- package/reference-headings.yaml +17 -0
- package/rules/adverb-overuse.yaml +19 -0
- package/rules/agentless-passive.yaml +19 -0
- package/rules/agreement-slip.yaml +49 -0
- package/rules/ai-generated-composite.yaml +102 -0
- package/rules/ai-tell.yaml +23 -0
- package/rules/announced-count-mismatch.yaml +57 -0
- package/rules/announcing-opener.yaml +51 -0
- package/rules/assistant-residue.yaml +52 -0
- package/rules/bold-density.yaml +31 -0
- package/rules/broken-link.yaml +65 -0
- package/rules/closing-cliche.yaml +33 -0
- package/rules/colon-lead-in.yaml +59 -0
- package/rules/concrete-evidence-density.yaml +41 -0
- package/rules/contraction-consistency.yaml +18 -0
- package/rules/contrast-framing.yaml +57 -0
- package/rules/cushion-phrase-density.yaml +25 -0
- package/rules/dangling-figure-reference.yaml +61 -0
- package/rules/dangling-reference.yaml +53 -1
- package/rules/date-order.yaml +33 -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/doubled-punctuation.yaml +45 -0
- package/rules/doubled-word.yaml +17 -1
- package/rules/duplicate-definition.yaml +59 -1
- package/rules/emoji-density.yaml +25 -0
- package/rules/empty-conclusion.yaml +29 -0
- package/rules/empty-intensifier.yaml +19 -0
- package/rules/excessive-hedging.yaml +19 -0
- package/rules/expletive-construction.yaml +19 -0
- package/rules/heading-echo.yaml +32 -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/katakana-long-vowel.yaml +98 -0
- package/rules/kutoten-consistency.yaml +53 -0
- package/rules/latin-spacing.yaml +23 -4
- package/rules/max-kanji-continuous.yaml +16 -0
- package/rules/max-paragraph-length.yaml +42 -2
- package/rules/max-sentence-length.yaml +36 -0
- package/rules/ngram-repetition.yaml +29 -2
- package/rules/no-doubled-joshi.yaml +16 -0
- package/rules/no-em-dash.yaml +25 -0
- package/rules/no-mixed-desumasu.yaml +27 -2
- package/rules/no-nakaguro-parallel.yaml +20 -0
- package/rules/numbering-gap.yaml +53 -1
- package/rules/oxford-comma-consistency.yaml +19 -1
- package/rules/padded-intro.yaml +19 -0
- package/rules/paragraph-length-variance.yaml +49 -0
- package/rules/percent-sum-mismatch.yaml +58 -0
- package/rules/preamble-length.yaml +56 -0
- package/rules/preferred-term.yaml +27 -0
- package/rules/proper-noun-density.yaml +26 -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/risk-disclosure.yaml +22 -0
- package/rules/rule-of-three.yaml +97 -0
- package/rules/sasete-itadaku.yaml +18 -0
- package/rules/section-length-uniformity.yaml +89 -0
- package/rules/sentence-initial-conjunction-run.yaml +18 -0
- package/rules/sentence-rhythm.yaml +25 -0
- package/rules/stock-transition.yaml +55 -0
- package/rules/stray-space.yaml +56 -0
- package/rules/taigen-dome-in-prose.yaml +19 -0
- package/rules/title-case-consistency.yaml +42 -0
- package/rules/total-mismatch.yaml +37 -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 +19 -0
- package/rules/unsourced-number.yaml +16 -0
- package/rules/url-run-on.yaml +45 -0
- package/skills/chaff/SKILL.md +70 -0
- package/src/announced-count.ts +148 -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 +33 -10
- package/src/cli-args.ts +6 -0
- package/src/cli-text.ts +8 -4
- package/src/cli.ts +37 -37
- package/src/closing-numbers.ts +72 -0
- package/src/commands/compare.ts +80 -0
- package/src/commands/eval.ts +19 -8
- package/src/commands/feedback.ts +12 -6
- package/src/commands/test.ts +20 -17
- package/src/commands/tree.ts +41 -5
- package/src/compare/atom.ts +33 -0
- package/src/compare/clock-time.ts +86 -0
- package/src/compare/extract.ts +78 -0
- package/src/compare/fact-text.ts +68 -0
- package/src/compare/markup-atoms.ts +29 -0
- package/src/compare/match.ts +105 -0
- package/src/compare/outcome.ts +70 -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 +95 -0
- package/src/compare/text.ts +120 -0
- package/src/compare/tree-atoms.ts +80 -0
- package/src/compare/written-names.ts +26 -0
- package/src/config/load.ts +21 -0
- package/src/config/option-problems.ts +70 -0
- package/src/config/read.ts +8 -0
- package/src/config/rule-problems.ts +12 -2
- package/src/config/style.ts +42 -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 +15 -0
- package/src/custom/parse.ts +274 -0
- package/src/custom/problems.ts +89 -0
- package/src/custom/regex-safety.ts +118 -0
- package/src/custom/token-pattern.ts +84 -0
- package/src/detect.ts +28 -2
- package/src/detectors/acronym-context.ts +32 -4
- package/src/detectors/acronym-expansion.ts +132 -1
- package/src/detectors/agreement-slip.ts +191 -0
- package/src/detectors/ai-phrasing.ts +137 -0
- package/src/detectors/announced-count.ts +25 -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/content-morphemes.ts +19 -0
- package/src/detectors/contrast-frame.ts +54 -0
- package/src/detectors/custom.ts +89 -0
- package/src/detectors/dangling-figure.ts +22 -0
- package/src/detectors/doubled-punctuation.ts +49 -0
- package/src/detectors/doubled-word.ts +19 -4
- package/src/detectors/en-shape.ts +0 -269
- package/src/detectors/enumerated-runs.ts +13 -4
- 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/heading-case.ts +30 -2
- package/src/detectors/heading-code-words.ts +35 -0
- package/src/detectors/heading-echo.ts +18 -22
- package/src/detectors/heading-level-skip.ts +19 -0
- package/src/detectors/heading-overlap.ts +65 -0
- package/src/detectors/image-alt-text.ts +11 -0
- package/src/detectors/index.ts +49 -2
- package/src/detectors/kutoten-consistency.ts +96 -0
- package/src/detectors/lead-in.ts +3 -1
- package/src/detectors/letter-joined-name.ts +15 -0
- package/src/detectors/lexicon-match.ts +9 -2
- package/src/detectors/lexicon.ts +6 -2
- 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 +157 -0
- package/src/detectors/list-view.ts +157 -0
- package/src/detectors/long-vowel.ts +66 -0
- package/src/detectors/markup-finding.ts +24 -0
- package/src/detectors/name-numeral.ts +4 -2
- package/src/detectors/orthography.ts +24 -18
- package/src/detectors/oxford-comma.ts +297 -0
- 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/register.ts +37 -10
- 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 +110 -53
- package/src/detectors/stacked-hedge.ts +6 -3
- package/src/detectors/stray-space.ts +40 -0
- package/src/detectors/structure-tree.ts +45 -1
- package/src/detectors/structure.ts +13 -6
- 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 +27 -0
- package/src/document-sections.ts +46 -0
- package/src/document.ts +116 -127
- package/src/email-parts.ts +269 -0
- package/src/eval.ts +14 -4
- package/src/figure-references.ts +112 -0
- package/src/files.ts +5 -0
- package/src/genre-parse.ts +30 -5
- package/src/genre-suggest.ts +15 -2
- package/src/heading-label.ts +55 -0
- package/src/in-page-nav.ts +48 -19
- package/src/joined-view.ts +1 -0
- package/src/levels.ts +14 -1
- package/src/line-paragraphs.ts +56 -10
- package/src/long-vowel.ts +99 -0
- package/src/markdown-node.ts +19 -0
- package/src/markdown-read.ts +44 -0
- package/src/markup.ts +210 -0
- package/src/mask.ts +10 -19
- package/src/number-name.ts +152 -25
- package/src/opening-line.ts +17 -0
- package/src/orthography.ts +20 -5
- package/src/page-furniture.ts +11 -2
- package/src/paragraph-length.ts +9 -0
- package/src/plain-source.ts +2 -1
- package/src/plugin.ts +107 -1
- package/src/profile/for-file.ts +3 -1
- package/src/quoted-span.ts +10 -4
- package/src/reasons.ts +9 -0
- package/src/reference-lists.ts +91 -0
- package/src/render/explain.ts +47 -13
- package/src/render/friendly.ts +20 -9
- package/src/render/options.ts +58 -0
- package/src/render/rules-json.ts +130 -14
- 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/text.ts +21 -7
- package/src/resolve-genre.ts +4 -1
- package/src/rule-genres.ts +25 -0
- package/src/rule-guide.ts +135 -0
- package/src/rule-load.ts +98 -33
- package/src/rule-options.ts +131 -0
- package/src/run-semantic.ts +28 -20
- package/src/run.ts +78 -11
- package/src/semantic.ts +11 -3
- package/src/sentence-shape.ts +4 -5
- package/src/setting-problems.ts +7 -1
- package/src/span-cut.ts +28 -0
- package/src/span-merge.ts +13 -0
- package/src/speaker-labels.ts +129 -0
- package/src/stray-space.ts +81 -0
- 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 +69 -0
- package/src/structure/known-mentions.ts +96 -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 +104 -42
- 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 +24 -4
- package/src/structure/wrapped-tail.ts +38 -13
- package/src/style-load.ts +28 -0
- package/src/style-parse.ts +77 -0
- package/src/subheading-line.ts +68 -0
- package/src/team-names.ts +13 -13
- 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 +29 -0
- package/styles/jis-z8301-2011.yaml +25 -0
|
@@ -1,7 +1,33 @@
|
|
|
1
|
+
import { straightApostrophes } from "../orthography.ts";
|
|
2
|
+
import { withoutCodeWords } from "./heading-code-words.ts";
|
|
3
|
+
|
|
4
|
+
/** 語の中のアポストロフィは ' に畳んでから読む(Fed’s)。’ を語の外に置くと、’s が小文字の語に見える。 */
|
|
1
5
|
const WORD = /[A-Za-z][A-Za-z'-]*/gu;
|
|
2
6
|
|
|
3
7
|
/** 小さい語は Title Case でも小文字のままなので、大文字化の判定から外す。 */
|
|
4
|
-
const
|
|
8
|
+
export const MINOR_WORDS: ReadonlySet<string> = new Set([
|
|
9
|
+
"a",
|
|
10
|
+
"an",
|
|
11
|
+
"the",
|
|
12
|
+
"and",
|
|
13
|
+
"or",
|
|
14
|
+
"but",
|
|
15
|
+
"of",
|
|
16
|
+
"in",
|
|
17
|
+
"on",
|
|
18
|
+
"at",
|
|
19
|
+
"to",
|
|
20
|
+
"for",
|
|
21
|
+
"with",
|
|
22
|
+
"as",
|
|
23
|
+
"by",
|
|
24
|
+
"from",
|
|
25
|
+
"is",
|
|
26
|
+
// 語の並び(WORD)は点を含まないので、vs. と v. は vs と v で拾う。
|
|
27
|
+
"vs",
|
|
28
|
+
"v",
|
|
29
|
+
"via",
|
|
30
|
+
]);
|
|
5
31
|
|
|
6
32
|
/** 大文字だけの語(PR・FCPs)は略語で、どちらの流儀でも大文字のまま。Title Case の証拠にならない。 */
|
|
7
33
|
const ACRONYM = /^[A-Z]{2,}s?$/u;
|
|
@@ -10,7 +36,9 @@ const TITLE_DEPTH = 1;
|
|
|
10
36
|
|
|
11
37
|
/** 見出しが Title Case か。判定できなければ undefined。 */
|
|
12
38
|
export const isTitleCase = (heading: string): boolean | undefined => {
|
|
13
|
-
const words = [...heading.matchAll(WORD)]
|
|
39
|
+
const words = [...withoutCodeWords(straightApostrophes(heading)).matchAll(WORD)]
|
|
40
|
+
.map((match) => match[0])
|
|
41
|
+
.filter((word) => !MINOR_WORDS.has(word.toLowerCase()) && !ACRONYM.test(word));
|
|
14
42
|
// 1 語の見出しは、どちらの流儀でも先頭が大文字になる。判定できない。
|
|
15
43
|
if (words.length < 2) return undefined;
|
|
16
44
|
const capitalized = words.filter((word) => word[0] === word[0]?.toUpperCase()).length;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// A code span closes at the next run of exactly as many backticks as opened it: ``a ` b`` is one span.
|
|
2
|
+
const CODE_SPAN = /(?<!`)(`+)(?!`)[\s\S]*?(?<!`)\1(?!`)/gu;
|
|
3
|
+
|
|
4
|
+
const OPENING = new Set([..."(\"'“‘["]);
|
|
5
|
+
const CLOSING = new Set([...")\"'”’].,:;!?"]);
|
|
6
|
+
|
|
7
|
+
/** The word without the punctuation around it: `(optional)` is `optional`, `Setup:` is `Setup`. */
|
|
8
|
+
const bareWord = (token: string): string => {
|
|
9
|
+
const chars = [...token];
|
|
10
|
+
const first = chars.findIndex((char) => !OPENING.has(char));
|
|
11
|
+
const last = chars.findLastIndex((char) => !CLOSING.has(char));
|
|
12
|
+
return first === -1 || last < first ? "" : chars.slice(first, last + 1).join("");
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** A mark a word of prose does not carry inside it: `config.yaml`, `snake_case`, `src/index`, `useEffect()`, `$HOME`. */
|
|
16
|
+
const CODE_MARK = /[._/\\=(){}[\]<>$@#*]/u;
|
|
17
|
+
|
|
18
|
+
/** A word that starts in lower case and has a capital after it (`useEffect`, `iPhone`): its case is its owner's. */
|
|
19
|
+
const CAMEL_CASE = /^[a-z]+[A-Z]/u;
|
|
20
|
+
|
|
21
|
+
const isCodeWord = (token: string): boolean => {
|
|
22
|
+
const bare = bareWord(token);
|
|
23
|
+
return bare.startsWith("-") || CAMEL_CASE.test(bare) || CODE_MARK.test(bare);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The heading without its code words: a code span, a flag (`--force`), a file name (`config.yaml`), an identifier
|
|
28
|
+
* (`useEffect`). They are written the same in Title Case and in sentence case, so they are evidence for neither.
|
|
29
|
+
*/
|
|
30
|
+
export const withoutCodeWords = (heading: string): string =>
|
|
31
|
+
heading
|
|
32
|
+
.replace(CODE_SPAN, " ")
|
|
33
|
+
.split(/\s+/u)
|
|
34
|
+
.filter((token) => !isCodeWord(token))
|
|
35
|
+
.join(" ");
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { lengthOf } from "../measure.ts";
|
|
1
|
+
import { lengthOf, proseText } from "../measure.ts";
|
|
2
|
+
import { newContentMorphemes } from "./content-morphemes.ts";
|
|
3
|
+
import { echoedHeadingUnits, trigrams } from "./heading-overlap.ts";
|
|
4
|
+
import { titleTokens } from "../heading-label.ts";
|
|
2
5
|
import { handsOver } from "./lead-in.ts";
|
|
3
6
|
import { withoutQuotedVariants } from "./quoted-variant.ts";
|
|
4
7
|
import type { Detector, Finding, LengthUnit, ProseDocument, Section } from "../plugin.ts";
|
|
@@ -6,17 +9,6 @@ import type { Detector, Finding, LengthUnit, ProseDocument, Section } from "../p
|
|
|
6
9
|
/** 見出しが短すぎると、偶然の一致で 100% になる。これ未満の見出しは見ない。 */
|
|
7
10
|
const MIN_GRAMS = 4;
|
|
8
11
|
|
|
9
|
-
/**
|
|
10
|
-
* 文字 3-gram で測る。
|
|
11
|
-
* 語 n-gram にすると wordSplit capability が要り、L1(言語を問わず動く)から外れる。
|
|
12
|
-
*/
|
|
13
|
-
const trigrams = (text: string): Set<string> => {
|
|
14
|
-
// 大文字小文字を畳む。英語では見出しが Title Case、本文が小文字になり、
|
|
15
|
-
// 同じ語でも一致しなくなる(Generating Output → generated output)。
|
|
16
|
-
const clean = [...text.toLowerCase().replace(/\s+/gu, "")];
|
|
17
|
-
return new Set(clean.slice(0, Math.max(0, clean.length - 2)).map((__char, index) => clean.slice(index, index + 3).join("")));
|
|
18
|
-
};
|
|
19
|
-
|
|
20
12
|
/**
|
|
21
13
|
* Jaccard ではなく包含率を使う。
|
|
22
14
|
*
|
|
@@ -39,18 +31,22 @@ const containment = (heading: Set<string>, sentence: Set<string>): number => {
|
|
|
39
31
|
*/
|
|
40
32
|
const NEW_MATERIAL = { word: 6, char: 20 };
|
|
41
33
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
/**
|
|
35
|
+
* 空白で語を分けない言語は、品詞が読めれば文字ではなく見出しに無い内容語で測る。文字数は中身の量を言わない:
|
|
36
|
+
* 「会社に勤めています」は 9 文字で 会社・勤める を足し、「について説明します」は同じ 9 文字で 説明 しか足さない。
|
|
37
|
+
* 内容語 2 つで足りる(こころさんのお父さんは、会社に勤めています。)。日本語の corpus で測った(yarn corpus)。
|
|
38
|
+
*/
|
|
39
|
+
const NEW_CONTENT_MORPHEMES = 1;
|
|
40
|
+
|
|
41
|
+
/** 重なりを測る見出し。頭の番号の札(例 3:、Step 3:、1.)は本文で繰り返されないので、数えると短い見出しほど重なりが下がる。 */
|
|
42
|
+
const measuredHeading = (section: Section): string => section.unlabeledHeading ?? section.heading;
|
|
49
43
|
|
|
50
44
|
const addsLittle = (section: Section, unit: LengthUnit): boolean => {
|
|
51
45
|
const first = section.firstSentence;
|
|
52
46
|
if (first === undefined) return false;
|
|
53
|
-
|
|
47
|
+
if (unit === "char" && first.tokens !== undefined && section.headingTokens !== undefined)
|
|
48
|
+
return newContentMorphemes(titleTokens(section.heading, measuredHeading(section), section.headingTokens), first.tokens) <= NEW_CONTENT_MORPHEMES;
|
|
49
|
+
return lengthOf(first, unit) - echoedHeadingUnits(measuredHeading(section), proseText(first), unit) <= NEW_MATERIAL[unit];
|
|
54
50
|
};
|
|
55
51
|
|
|
56
52
|
/** 最初の文が、同じ節の後ろ(箇条書き・表・コード)へ読者を渡している。 */
|
|
@@ -60,14 +56,14 @@ const leadsIn = (doc: ProseDocument, section: Section, phrases: readonly string[
|
|
|
60
56
|
};
|
|
61
57
|
|
|
62
58
|
/** 見出しとの重なりを測る文。用語集や表記の手引きは見出しの語の別の書き方を引用する(Not “datacentre”)ので、それは数えない。 */
|
|
63
|
-
const echoedText = (section: Section): string => withoutQuotedVariants(section.firstSentence?.text ?? "", section
|
|
59
|
+
const echoedText = (section: Section): string => withoutQuotedVariants(section.firstSentence?.text ?? "", measuredHeading(section));
|
|
64
60
|
|
|
65
61
|
export const headingEcho: Detector = (doc, options): Finding[] => {
|
|
66
62
|
const leadIns = (doc.lexicons["lead-in"] ?? []).map((entry) => entry.pattern);
|
|
67
63
|
return doc.sections
|
|
68
64
|
.filter((section) => section.heading.length > 0 && section.firstSentence !== undefined && addsLittle(section, doc.lengthUnit))
|
|
69
65
|
.filter((section) => !leadsIn(doc, section, leadIns))
|
|
70
|
-
.map((section) => ({ section, overlap: Math.round(containment(trigrams(section
|
|
66
|
+
.map((section) => ({ section, overlap: Math.round(containment(trigrams(measuredHeading(section)), trigrams(echoedText(section))) * 100) }))
|
|
71
67
|
.filter(({ overlap }) => overlap >= options.limit)
|
|
72
68
|
.map(({ section, overlap }) => ({
|
|
73
69
|
rule: "heading-echo",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Detector, Finding, MarkupHeading } from "../plugin.ts";
|
|
2
|
+
import { findingAt, markupOf } from "./markup-finding.ts";
|
|
3
|
+
|
|
4
|
+
export type SkippedHeading = { readonly heading: MarkupHeading; readonly from: number };
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 一つ前の見出しより二段以上深い見出し(## の次の ####)。最初の見出しは何段から始めてもよい。
|
|
8
|
+
* 飛んだ後は、飛んだ先の深さを基準にする(#### の次の #### は飛んでいない)。markdownlint の MD001 と同じ数え方。
|
|
9
|
+
*/
|
|
10
|
+
export const skippedHeadings = (headings: readonly MarkupHeading[]): SkippedHeading[] =>
|
|
11
|
+
headings.flatMap((heading, index) => {
|
|
12
|
+
const previous = headings[index - 1];
|
|
13
|
+
return previous !== undefined && heading.depth > previous.depth + 1 ? [{ heading, from: previous.depth }] : [];
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const headingLevelSkip: Detector = (doc): Finding[] =>
|
|
17
|
+
skippedHeadings(markupOf(doc)?.headings ?? []).map(({ heading, from }) =>
|
|
18
|
+
findingAt(doc, heading, { heading: heading.text, from, to: heading.depth, expected: from + 1 }),
|
|
19
|
+
);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// How much of a section's heading its first sentence takes up: the heading's character trigrams, and the part of the
|
|
2
|
+
// heading the sentence repeats, in the document's length unit. Pure; heading-echo decides with these.
|
|
3
|
+
import type { LengthUnit } from "../plugin.ts";
|
|
4
|
+
|
|
5
|
+
const foldedChars = (text: string): string[] => [...text.toLowerCase().replace(/\s+/gu, "")];
|
|
6
|
+
|
|
7
|
+
const trigramAt = (chars: readonly string[], index: number): string => chars.slice(index, index + 3).join("");
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 文字 3-gram で測る。
|
|
11
|
+
* 語 n-gram にすると wordSplit capability が要り、L1(言語を問わず動く)から外れる。
|
|
12
|
+
*/
|
|
13
|
+
export const trigrams = (text: string): Set<string> => {
|
|
14
|
+
// 大文字小文字を畳む。英語では見出しが Title Case、本文が小文字になり、
|
|
15
|
+
// 同じ語でも一致しなくなる(Generating Output → generated output)。
|
|
16
|
+
const clean = foldedChars(text);
|
|
17
|
+
return new Set(clean.slice(0, Math.max(0, clean.length - 2)).map((__char, index) => trigramAt(clean, index)));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** A word as compared across heading and sentence: case folded, the punctuation around it dropped ("Spacewalks?" is spacewalks). */
|
|
21
|
+
const foldedWord = (word: string): string => {
|
|
22
|
+
const chars = [...word.toLowerCase()];
|
|
23
|
+
const isWordChar = (char: string): boolean => /[\p{L}\p{N}]/u.test(char);
|
|
24
|
+
return chars.slice(chars.findIndex(isWordChar), chars.findLastIndex(isWordChar) + 1).join("");
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const headingWords = (heading: string): string[] =>
|
|
28
|
+
heading
|
|
29
|
+
.trim()
|
|
30
|
+
.split(/\s+/u)
|
|
31
|
+
.filter((word) => word.length > 0);
|
|
32
|
+
|
|
33
|
+
/** Below this length a word repeats another only as itself: "on" is not repeated by "one", nor "go" by "going". */
|
|
34
|
+
const MIN_STEM = 4;
|
|
35
|
+
|
|
36
|
+
/** The same word, or one of them the other with an ending added (level → levels, reference → references). */
|
|
37
|
+
const isSameWord = (headingWord: string, sentenceWord: string): boolean => {
|
|
38
|
+
if (headingWord === sentenceWord) return true;
|
|
39
|
+
const [shorter, longer] = headingWord.length < sentenceWord.length ? [headingWord, sentenceWord] : [sentenceWord, headingWord];
|
|
40
|
+
return shorter.length >= MIN_STEM && longer.startsWith(shorter);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** The heading's words that the sentence repeats; a word of punctuation alone is never repeated. */
|
|
44
|
+
const echoedWords = (heading: string, sentence: string): number => {
|
|
45
|
+
const said = sentence.split(/\s+/u).map(foldedWord);
|
|
46
|
+
return headingWords(heading)
|
|
47
|
+
.map(foldedWord)
|
|
48
|
+
.filter((word) => word !== "" && said.some((other) => isSameWord(word, other))).length;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** The heading's characters (spaces aside) that a trigram the sentence also has covers. */
|
|
52
|
+
const echoedChars = (heading: string, sentence: string): number => {
|
|
53
|
+
const said = trigrams(sentence);
|
|
54
|
+
const clean = foldedChars(heading);
|
|
55
|
+
const covered = new Set(clean.flatMap((__char, index) => (said.has(trigramAt(clean, index)) ? [index, index + 1, index + 2] : [])));
|
|
56
|
+
return covered.size;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* How much of the heading the sentence repeats, in the document's length unit. A sentence that repeats only part of it
|
|
61
|
+
* ("How Do Astronauts Go on Spacewalks?" → "When astronauts go on spacewalks, they wear spacesuits…") keeps the rest of
|
|
62
|
+
* its length as its own material.
|
|
63
|
+
*/
|
|
64
|
+
export const echoedHeadingUnits = (heading: string, sentence: string, unit: LengthUnit): number =>
|
|
65
|
+
unit === "word" ? echoedWords(heading, sentence) : echoedChars(heading, sentence);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Detector, Finding, MarkupImage } from "../plugin.ts";
|
|
2
|
+
import { findingAt, markupOf, quoteOf } from "./markup-finding.ts";
|
|
3
|
+
|
|
4
|
+
/** 代替テキストの無い画像。Markdown の `` は alt が空、HTML の `<img>` は alt 属性が無いもの。`alt=""` は飾りと明示したので数えない。 */
|
|
5
|
+
const lacksAlt = (source: string, image: MarkupImage): boolean => {
|
|
6
|
+
if (image.alt === undefined) return true;
|
|
7
|
+
return image.alt.trim() === "" && !source.startsWith("<", image.start);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const imageAltText: Detector = (doc): Finding[] =>
|
|
11
|
+
(markupOf(doc)?.images ?? []).filter((image) => lacksAlt(doc.source, image)).map((image) => findingAt(doc, image, { image: quoteOf(doc.source, image) }));
|
package/src/detectors/index.ts
CHANGED
|
@@ -7,16 +7,40 @@ import { sentenceRhythm } from "./sentence-rhythm.ts";
|
|
|
7
7
|
import { phraseCount, phraseMatch } from "./phrase-match.ts";
|
|
8
8
|
import { agentlessPassive } from "./agentless-passive.ts";
|
|
9
9
|
import { doubledWord } from "./doubled-word.ts";
|
|
10
|
+
import { agreementSlip } from "./agreement-slip.ts";
|
|
10
11
|
import { sentenceEnding } from "./sentence-ending.ts";
|
|
11
12
|
import { doubledParticle, nounEnding } from "./token-shape.ts";
|
|
12
13
|
import { kanjiRun, middleDot } from "./char-shape.ts";
|
|
13
|
-
import { adverbDensity, conjunctionRun, expletive,
|
|
14
|
+
import { adverbDensity, conjunctionRun, expletive, titleCaseMix } from "./en-shape.ts";
|
|
15
|
+
import { oxfordComma } from "./oxford-comma.ts";
|
|
14
16
|
import { paragraphLength, paragraphVariance, preambleLength, ruleOfThree, sectionUniformity } from "./structure.ts";
|
|
15
17
|
import { concreteEvidence, dashDensity, emojiDensity, ngramRepetition, undefinedAcronym } from "./signals.ts";
|
|
16
18
|
import { aiTell, contractionMix, cushionDensity, hedging, repeatedConjunction, unqualifiedSuperlative } from "./lexicon.ts";
|
|
17
19
|
import { internalJargon, properNounDensity, requiredSections } from "./team.ts";
|
|
18
20
|
import { latinSpacing, preferredTerm } from "./orthography.ts";
|
|
19
|
-
import {
|
|
21
|
+
import { straySpace } from "./stray-space.ts";
|
|
22
|
+
import { announcedCount } from "./announced-count.ts";
|
|
23
|
+
import { danglingFigure } from "./dangling-figure.ts";
|
|
24
|
+
import {
|
|
25
|
+
danglingReference,
|
|
26
|
+
dateOrder,
|
|
27
|
+
dateRangeReversed,
|
|
28
|
+
dateWeekdayMismatch,
|
|
29
|
+
duplicateDefinition,
|
|
30
|
+
numberingGap,
|
|
31
|
+
percentSumMismatch,
|
|
32
|
+
totalMismatch,
|
|
33
|
+
} from "./structure-tree.ts";
|
|
34
|
+
import { headingLevelSkip } from "./heading-level-skip.ts";
|
|
35
|
+
import { imageAltText } from "./image-alt-text.ts";
|
|
36
|
+
import { brokenLink } from "./broken-link.ts";
|
|
37
|
+
import { urlRunOn } from "./url-run-on.ts";
|
|
38
|
+
import { unbalancedBracket } from "./unbalanced-bracket.ts";
|
|
39
|
+
import { doubledPunctuation } from "./doubled-punctuation.ts";
|
|
40
|
+
import { kutotenConsistency } from "./kutoten-consistency.ts";
|
|
41
|
+
import { katakanaLongVowel } from "./long-vowel.ts";
|
|
42
|
+
import { customPattern, customTokens, customWords } from "./custom.ts";
|
|
43
|
+
import { assistantResidue, colonLeadIn, contrastFraming, openerDensity, openerPile, unfilledPlaceholder } from "./ai-phrasing.ts";
|
|
20
44
|
|
|
21
45
|
/** rule 定義の how_to_find がここを引く。rule 側は実装を知らない。 */
|
|
22
46
|
export const DETECTORS: Readonly<Record<string, Detector>> = {
|
|
@@ -32,6 +56,7 @@ export const DETECTORS: Readonly<Record<string, Detector>> = {
|
|
|
32
56
|
"noun-ending": nounEnding,
|
|
33
57
|
"doubled-particle": doubledParticle,
|
|
34
58
|
"doubled-word": doubledWord,
|
|
59
|
+
"agreement-slip": agreementSlip,
|
|
35
60
|
"kanji-run": kanjiRun,
|
|
36
61
|
"middle-dot": middleDot,
|
|
37
62
|
"adverb-density": adverbDensity,
|
|
@@ -54,16 +79,38 @@ export const DETECTORS: Readonly<Record<string, Detector>> = {
|
|
|
54
79
|
"unqualified-superlative": unqualifiedSuperlative,
|
|
55
80
|
"repeated-conjunction": repeatedConjunction,
|
|
56
81
|
"ai-tell": aiTell,
|
|
82
|
+
"contrast-framing": contrastFraming,
|
|
83
|
+
"stock-transition": openerDensity,
|
|
84
|
+
"opener-pile": openerPile,
|
|
85
|
+
"colon-lead-in": colonLeadIn,
|
|
86
|
+
"assistant-residue": assistantResidue,
|
|
87
|
+
"unfilled-placeholder": unfilledPlaceholder,
|
|
57
88
|
"contraction-mix": contractionMix,
|
|
58
89
|
"internal-jargon": internalJargon,
|
|
59
90
|
"required-sections": requiredSections,
|
|
60
91
|
"proper-noun-density": properNounDensity,
|
|
61
92
|
"preferred-term": preferredTerm,
|
|
62
93
|
"latin-spacing": latinSpacing,
|
|
94
|
+
"stray-space": straySpace,
|
|
95
|
+
"katakana-long-vowel": katakanaLongVowel,
|
|
96
|
+
"custom-words": customWords,
|
|
97
|
+
"custom-pattern": customPattern,
|
|
98
|
+
"custom-tokens": customTokens,
|
|
63
99
|
"dangling-reference": danglingReference,
|
|
64
100
|
"date-weekday-mismatch": dateWeekdayMismatch,
|
|
65
101
|
"date-order": dateOrder,
|
|
66
102
|
"total-mismatch": totalMismatch,
|
|
67
103
|
"numbering-gap": numberingGap,
|
|
68
104
|
"duplicate-definition": duplicateDefinition,
|
|
105
|
+
"announced-count": announcedCount,
|
|
106
|
+
"dangling-figure": danglingFigure,
|
|
107
|
+
"date-range-reversed": dateRangeReversed,
|
|
108
|
+
"percent-sum-mismatch": percentSumMismatch,
|
|
109
|
+
"heading-level-skip": headingLevelSkip,
|
|
110
|
+
"image-alt-text": imageAltText,
|
|
111
|
+
"broken-link": brokenLink,
|
|
112
|
+
"url-run-on": urlRunOn,
|
|
113
|
+
"unbalanced-bracket": unbalancedBracket,
|
|
114
|
+
"doubled-punctuation": doubledPunctuation,
|
|
115
|
+
"kutoten-consistency": kutotenConsistency,
|
|
69
116
|
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Detector, Finding, Sentence, Span } from "../plugin.ts";
|
|
2
|
+
import { minorityStyle } from "../orthography.ts";
|
|
3
|
+
import { isWithinAny, quotedSpans } from "../quoted-span.ts";
|
|
4
|
+
|
|
5
|
+
/** 日本語の読点と句点の、二つの書き方。「、。」と、横書きの論文や公用文に多い「,.」。どちらが正しいかは決めない。 */
|
|
6
|
+
type Kind = { readonly id: "comma" | "period"; readonly usual: string; readonly western: string };
|
|
7
|
+
|
|
8
|
+
const KINDS: readonly Kind[] = [
|
|
9
|
+
{ id: "comma", usual: "、", western: "," },
|
|
10
|
+
{ id: "period", usual: "。", western: "." },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const MARKS = /[、,。.]/gu;
|
|
14
|
+
|
|
15
|
+
const DIGIT = /[\d0-9]/u;
|
|
16
|
+
|
|
17
|
+
/** 番号の印(行の頭や読点・空白・括弧の後ろの「1.」「2.」)。文の中の数の後ろの点(締切は10.)は文の終わり。 */
|
|
18
|
+
const LIST_NUMBER = /(?:^|[\s、,,((])[\d0-9]{1,3}$/u;
|
|
19
|
+
const LIST_NUMBER_REACH = 4;
|
|
20
|
+
|
|
21
|
+
/** 一、二文字の英字だけの印(Q.、No.)。「API.」のような語の後ろの点は文の終わり。 */
|
|
22
|
+
const LATIN_LABEL = /(?:^|[^A-Za-zA-Za-z])[A-Za-zA-Za-z]{1,2}$/u;
|
|
23
|
+
const LATIN_LABEL_REACH = 3;
|
|
24
|
+
|
|
25
|
+
const isInsideNumber = (text: string, at: number): boolean => DIGIT.test(text.charAt(at - 1)) && DIGIT.test(text.charAt(at + 1));
|
|
26
|
+
|
|
27
|
+
const isLabelPeriod = (text: string, at: number): boolean =>
|
|
28
|
+
LIST_NUMBER.test(text.slice(Math.max(0, at - LIST_NUMBER_REACH), at)) || LATIN_LABEL.test(text.slice(Math.max(0, at - LATIN_LABEL_REACH), at));
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 句読点として数えない「,」「.」。数の中の桁の区切りと小数点(1,000、3.5)、番号の印の点(1.はじめに、、2.確認)、
|
|
32
|
+
* 一、二文字の英字の印の後ろの点(Q.、No.)は、日本語の文の区切りではない。
|
|
33
|
+
*/
|
|
34
|
+
const isNotPunctuation = (text: string, at: number, mark: string): boolean => {
|
|
35
|
+
if (mark === ".") return isInsideNumber(text, at) || isLabelPeriod(text, at);
|
|
36
|
+
if (mark === ",") return isInsideNumber(text, at);
|
|
37
|
+
return false;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type Mark = { readonly kind: Kind["id"]; readonly western: boolean; readonly mark: string; readonly offset: number };
|
|
41
|
+
|
|
42
|
+
/** 文の中の句読点。鉤括弧で引いたものの中は、引いた元の書き方なので数えない。offset は文書の中の位置。 */
|
|
43
|
+
export const marksIn = (sentence: Sentence): Mark[] => {
|
|
44
|
+
const quoted: readonly Span[] = quotedSpans(sentence.text);
|
|
45
|
+
return [...sentence.text.matchAll(MARKS)]
|
|
46
|
+
.filter((match) => !isNotPunctuation(sentence.text, match.index, match[0]))
|
|
47
|
+
.filter((match) => !isWithinAny(quoted, { start: match.index, end: match.index }))
|
|
48
|
+
.map((match) => {
|
|
49
|
+
const western = match[0] === "," || match[0] === ".";
|
|
50
|
+
const kind = match[0] === "、" || match[0] === "," ? "comma" : "period";
|
|
51
|
+
return { kind, western, mark: match[0], offset: sentence.span.start + match.index };
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 注や文献の番号と空白で始まる行(白書の「2 亀田健司,「…」,2018年」、「[1] 山田太郎,…」「注1 …」「※1 …」)。
|
|
57
|
+
* 白書や論文の注と文献は、本文と違う区切り方で書く決まりがある。
|
|
58
|
+
*/
|
|
59
|
+
const NOTE_NUMBER = /^(?:[\d0-9]{1,3}|[[[][\d0-9]{1,3}[\]]]|注[\d0-9]{1,3}|※[\d0-9]{0,3})[\u3000 ]/u;
|
|
60
|
+
|
|
61
|
+
const URL_SCHEME = /https?:\/\//u;
|
|
62
|
+
|
|
63
|
+
/** 文献や出典を挙げた文。注の番号で始まるか、URL を含む。区切りは引いた元や文献の書き方に従う。 */
|
|
64
|
+
export const isCitation = (sentence: Sentence, source: string): boolean =>
|
|
65
|
+
NOTE_NUMBER.test(sentence.text.trimStart()) || URL_SCHEME.test(source.slice(sentence.span.start, sentence.span.end));
|
|
66
|
+
|
|
67
|
+
type Tally = { readonly count: number; readonly of: number; readonly limit: number };
|
|
68
|
+
|
|
69
|
+
const findingOf = (sentence: Sentence, entry: Mark, kind: Kind, tally: Tally): Finding => ({
|
|
70
|
+
rule: "",
|
|
71
|
+
severity: "warning",
|
|
72
|
+
line: 0,
|
|
73
|
+
column: 0,
|
|
74
|
+
quote: sentence.text.trim(),
|
|
75
|
+
values: { mark: entry.mark, usual: entry.western ? kind.usual : kind.western, ...tally, offset: entry.offset },
|
|
76
|
+
variant: entry.kind,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 読点(、と,)と句点(。と.)を、それぞれ文書の中でどちらかにそろえているか。混ざっていれば少ないほうを指摘する。
|
|
81
|
+
* latin-spacing と同じく、同数なら文書が先に使った書き方をその文書の書き方とする。
|
|
82
|
+
*/
|
|
83
|
+
export const kutotenConsistency: Detector = (doc, options): Finding[] => {
|
|
84
|
+
const located = doc.sentences
|
|
85
|
+
.filter((sentence) => !isCitation(sentence, doc.source))
|
|
86
|
+
.flatMap((sentence) => marksIn(sentence).map((entry) => ({ sentence, entry })));
|
|
87
|
+
return KINDS.flatMap((kind) => {
|
|
88
|
+
const ofKind = located.filter(({ entry }) => entry.kind === kind.id);
|
|
89
|
+
const minority = minorityStyle(ofKind.map(({ entry }) => ({ spaced: entry.western })));
|
|
90
|
+
if (minority === undefined) return [];
|
|
91
|
+
const odd = ofKind.filter(({ entry }) => entry.western === minority);
|
|
92
|
+
if (odd.length < options.limit) return [];
|
|
93
|
+
const tally = { count: odd.length, of: ofKind.length, limit: options.limit };
|
|
94
|
+
return odd.map(({ sentence, entry }) => findingOf(sentence, entry, kind, tally));
|
|
95
|
+
});
|
|
96
|
+
};
|
package/src/detectors/lead-in.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/** 文末のコロン。後ろに強調の印(**・_)や空白が残っていても見る。 */
|
|
2
2
|
const ENDS_WITH_COLON = /[::][\s*_]*$/u;
|
|
3
3
|
|
|
4
|
+
export const endsWithColon = (sentence: string): boolean => ENDS_WITH_COLON.test(sentence.trim());
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* 後ろの箇条書きや表へ読者を渡す文(「次のとおりとする。」「The following expenses require receipts:」)。
|
|
6
8
|
* 見出しの語を繰り返していても、中身は後ろにある。言い回しは言語パッケージの語彙表 lead-in が持つ。
|
|
7
9
|
*/
|
|
8
10
|
export const isLeadIn = (sentence: string, phrases: readonly string[]): boolean => {
|
|
9
11
|
const text = sentence.trim().toLowerCase();
|
|
10
|
-
return
|
|
12
|
+
return endsWithColon(text) || phrases.some((phrase) => phrase !== "" && text.includes(phrase.toLowerCase()));
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
/** 渡す先(following: 同じ節の、その文より後ろ)が空なら、渡す文ではなくただの繰り返し。 */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 一文字を - で語の前に繋いだ名前(J-STAGE、X-RAY、T-Mobile、e-Gov)。前の一文字が新しい名前を作るので、中の大文字の語は
|
|
3
|
+
* 略語ではない(J-STAGE は STAGE の説明を待たない)。後ろに一文字を繋いだ語(ITU-T、GOODS-S)は略語の一種で、略語は
|
|
4
|
+
* 説明を待つまま。部品が二つとも二文字以上(RT-PCR)なら繋いだ略語のまま。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
type Span = { readonly start: number; readonly end: number };
|
|
8
|
+
|
|
9
|
+
// 語を空白で区切る文字(é、α、分けて書いた e と ́)や数字が接していれば長い語の一部。仮名や漢字は接していてよい(論文はJ-STAGEで)。
|
|
10
|
+
const SPACED_WORD_CHAR = String.raw`\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}\p{M}\p{N}_&`;
|
|
11
|
+
const LETTER_JOINED_NAME = new RegExp(String.raw`(?<![${SPACED_WORD_CHAR}.-])[A-Za-z]-[A-Za-z]{2,}(?![${SPACED_WORD_CHAR}-]|\.[A-Za-z0-9])`, "gu");
|
|
12
|
+
|
|
13
|
+
/** 文の中の、一文字を - で語の前に繋いだ名前の範囲。 */
|
|
14
|
+
export const letterJoinedNameSpans = (text: string): Span[] =>
|
|
15
|
+
[...text.matchAll(LETTER_JOINED_NAME)].map((match) => ({ start: match.index, end: match.index + match[0].length }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LexiconEntry, Sentence, Token } from "../plugin.ts";
|
|
2
2
|
import { proseText } from "../measure.ts";
|
|
3
|
+
import { straightApostrophes } from "../orthography.ts";
|
|
3
4
|
|
|
4
5
|
/** 活用する品詞。"best" を "good" と同じ語にはしない。 */
|
|
5
6
|
const INFLECTING = new Set(["VERB", "AUX"]);
|
|
@@ -15,6 +16,12 @@ const sameWord = (written: Token, entry: Token): boolean => {
|
|
|
15
16
|
return inflects && entry.lemma?.toLowerCase() === surface && written.lemma?.toLowerCase() === surface;
|
|
16
17
|
};
|
|
17
18
|
|
|
19
|
+
/** 品詞が無いときに照らす形。大文字小文字と、アポストロフィの形(it’s と it's)は語を変えない。 */
|
|
20
|
+
export const comparableWords = (text: string): string => straightApostrophes(text).toLowerCase();
|
|
21
|
+
|
|
22
|
+
/** 文を、品詞が無いときに照らす形に。行の折り返しの空白はまとめる。 */
|
|
23
|
+
export const comparableText = (sentence: Sentence): string => comparableWords(proseText(sentence));
|
|
24
|
+
|
|
18
25
|
const runsAt = (tokens: readonly Token[], entry: readonly Token[], start: number): boolean =>
|
|
19
26
|
entry.every((word, offset) => {
|
|
20
27
|
const written = tokens[start + offset];
|
|
@@ -28,7 +35,7 @@ const runsAt = (tokens: readonly Token[], entry: readonly Token[], start: number
|
|
|
28
35
|
export const entryIn = (sentence: Sentence, entry: LexiconEntry): boolean => {
|
|
29
36
|
const tokens = sentence.tokens;
|
|
30
37
|
const words = entry.tokens;
|
|
31
|
-
if (tokens === undefined || words === undefined || words.length === 0) return
|
|
38
|
+
if (tokens === undefined || words === undefined || words.length === 0) return comparableText(sentence).includes(comparableWords(entry.pattern));
|
|
32
39
|
return tokens.some((_token, start) => runsAt(tokens, words, start));
|
|
33
40
|
};
|
|
34
41
|
|
|
@@ -48,7 +55,7 @@ const LEADING_MARK = new Set(["PUNCT", "SYM"]);
|
|
|
48
55
|
export const entryOpens = (sentence: Sentence, entry: LexiconEntry): boolean => {
|
|
49
56
|
const tokens = sentence.tokens;
|
|
50
57
|
const words = entry.tokens;
|
|
51
|
-
if (tokens === undefined || words === undefined || words.length === 0) return
|
|
58
|
+
if (tokens === undefined || words === undefined || words.length === 0) return comparableText(sentence).startsWith(comparableWords(entry.pattern));
|
|
52
59
|
const first = tokens.findIndex((token) => !LEADING_MARK.has(token.pos));
|
|
53
60
|
return runsAt(tokens, words, first);
|
|
54
61
|
};
|
package/src/detectors/lexicon.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { joinWords } from "./word-list.ts";
|
|
2
|
+
import { straightApostrophes } from "../orthography.ts";
|
|
2
3
|
import { wordsOf } from "./structure.ts";
|
|
3
4
|
import type { Detector, Finding, Lexicon, LexiconEntry, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
4
5
|
import { entryIn, entryOpens, entryRanges, type TokenRange } from "./lexicon-match.ts";
|
|
@@ -227,9 +228,12 @@ export const aiTell: Detector = (doc, options): Finding[] => {
|
|
|
227
228
|
*/
|
|
228
229
|
const containsWord = (text: string, word: string): boolean => new RegExp(`\\b${word.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&")}\\b`, "u").test(text);
|
|
229
230
|
|
|
231
|
+
/** アポストロフィの形(don’t と don't)は短縮形かどうかを変えない。違うのは印刷の形で、文体ではない。 */
|
|
232
|
+
const comparableText = (sentence: Sentence): string => straightApostrophes(sentence.text).toLowerCase();
|
|
233
|
+
|
|
230
234
|
export const contractionMix: Detector = (doc, options): Finding[] => {
|
|
231
235
|
const pairs = (options.lexicon ?? []).flatMap((entry) => (entry.instead_of === undefined ? [] : [{ short: entry.pattern, long: entry.instead_of }]));
|
|
232
|
-
const body = doc.sentences.map(
|
|
236
|
+
const body = doc.sentences.map(comparableText).join(" ");
|
|
233
237
|
const used = pairs.filter((pair) => containsWord(body, pair.short.toLowerCase()));
|
|
234
238
|
const spelled = pairs.filter((pair) => containsWord(body, pair.long.toLowerCase()));
|
|
235
239
|
// 片方しか無ければ一貫している。両方あるときだけ、少数派を指摘する。
|
|
@@ -239,7 +243,7 @@ export const contractionMix: Detector = (doc, options): Finding[] => {
|
|
|
239
243
|
if (few.length > options.limit) return [];
|
|
240
244
|
const wanted = few.map((pair) => (minorityIsShort ? pair.short : pair.long).toLowerCase());
|
|
241
245
|
const hits = doc.sentences.flatMap((sentence) => {
|
|
242
|
-
const text = sentence
|
|
246
|
+
const text = comparableText(sentence);
|
|
243
247
|
const matched = wanted.find((word) => containsWord(text, word));
|
|
244
248
|
return matched === undefined ? [] : [{ sentence, matched }];
|
|
245
249
|
});
|