chaffjs 0.50.0 → 0.51.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.ja.md +30 -3
- package/README.md +30 -2
- package/dist/allow.d.ts +49 -0
- package/dist/allow.d.ts.map +1 -0
- package/dist/allow.js +111 -0
- package/dist/allow.js.map +1 -0
- package/dist/check-source.d.ts +13 -3
- package/dist/check-source.d.ts.map +1 -1
- package/dist/check-source.js +23 -6
- package/dist/check-source.js.map +1 -1
- package/dist/cli-text.d.ts +7 -1
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +8 -2
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +12 -11
- package/dist/cli.js.map +1 -1
- package/dist/commands/eval.js +1 -1
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/suppressions.d.ts +4 -1
- package/dist/commands/suppressions.d.ts.map +1 -1
- package/dist/commands/suppressions.js +2 -2
- package/dist/commands/suppressions.js.map +1 -1
- package/dist/commands/test.js +1 -1
- package/dist/commands/test.js.map +1 -1
- package/dist/compound-head.d.ts +5 -2
- package/dist/compound-head.d.ts.map +1 -1
- package/dist/compound-head.js +17 -8
- package/dist/compound-head.js.map +1 -1
- package/dist/config/allow-problems.d.ts +8 -0
- package/dist/config/allow-problems.d.ts.map +1 -0
- package/dist/config/allow-problems.js +61 -0
- package/dist/config/allow-problems.js.map +1 -0
- package/dist/config/by-path-problems.d.ts +3 -0
- package/dist/config/by-path-problems.d.ts.map +1 -1
- package/dist/config/by-path-problems.js +21 -2
- package/dist/config/by-path-problems.js.map +1 -1
- package/dist/config/by-path-rules.d.ts +34 -0
- package/dist/config/by-path-rules.d.ts.map +1 -0
- package/dist/config/by-path-rules.js +53 -0
- package/dist/config/by-path-rules.js.map +1 -0
- package/dist/config/by-path.d.ts +15 -0
- package/dist/config/by-path.d.ts.map +1 -1
- package/dist/config/by-path.js.map +1 -1
- package/dist/config/consistent-problems.d.ts +5 -0
- package/dist/config/consistent-problems.d.ts.map +1 -0
- package/dist/config/consistent-problems.js +24 -0
- package/dist/config/consistent-problems.js.map +1 -0
- package/dist/config/load.d.ts +23 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +63 -10
- package/dist/config/load.js.map +1 -1
- package/dist/config/option-problems.d.ts +6 -4
- package/dist/config/option-problems.d.ts.map +1 -1
- package/dist/config/option-problems.js +5 -2
- package/dist/config/option-problems.js.map +1 -1
- package/dist/config/prefer-problems.d.ts +5 -0
- package/dist/config/prefer-problems.d.ts.map +1 -0
- package/dist/config/prefer-problems.js +15 -0
- package/dist/config/prefer-problems.js.map +1 -0
- package/dist/config/prefer.d.ts +21 -0
- package/dist/config/prefer.d.ts.map +1 -0
- package/dist/config/prefer.js +35 -0
- package/dist/config/prefer.js.map +1 -0
- package/dist/config/term-problems.d.ts +5 -0
- package/dist/config/term-problems.d.ts.map +1 -0
- package/dist/config/term-problems.js +25 -0
- package/dist/config/term-problems.js.map +1 -0
- package/dist/config/warnings.d.ts +1 -1
- package/dist/config/warnings.d.ts.map +1 -1
- package/dist/config/warnings.js +9 -2
- package/dist/config/warnings.js.map +1 -1
- package/dist/cross-variants.d.ts +1 -1
- package/dist/cross-variants.d.ts.map +1 -1
- package/dist/cross-variants.js +4 -8
- package/dist/cross-variants.js.map +1 -1
- package/dist/cross-votes.d.ts +13 -0
- package/dist/cross-votes.d.ts.map +1 -1
- package/dist/cross-votes.js +25 -2
- package/dist/cross-votes.js.map +1 -1
- package/dist/custom/parse.d.ts +9 -0
- package/dist/custom/parse.d.ts.map +1 -1
- package/dist/custom/parse.js +11 -2
- package/dist/custom/parse.js.map +1 -1
- package/dist/custom/problems.d.ts.map +1 -1
- package/dist/custom/problems.js +9 -3
- package/dist/custom/problems.js.map +1 -1
- package/dist/custom/scope-field.d.ts +7 -0
- package/dist/custom/scope-field.d.ts.map +1 -0
- package/dist/custom/scope-field.js +14 -0
- package/dist/custom/scope-field.js.map +1 -0
- package/dist/date-format.d.ts +5 -3
- package/dist/date-format.d.ts.map +1 -1
- package/dist/date-format.js +30 -5
- package/dist/date-format.js.map +1 -1
- package/dist/derived/elapsed.d.ts +4 -1
- package/dist/derived/elapsed.d.ts.map +1 -1
- package/dist/derived/elapsed.js +11 -1
- package/dist/derived/elapsed.js.map +1 -1
- package/dist/detectors/acronym-context.d.ts +3 -1
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +7 -1
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/acronym-gloss.d.ts +20 -7
- package/dist/detectors/acronym-gloss.d.ts.map +1 -1
- package/dist/detectors/acronym-gloss.js +50 -13
- package/dist/detectors/acronym-gloss.js.map +1 -1
- package/dist/detectors/bare-comparative.d.ts +4 -0
- package/dist/detectors/bare-comparative.d.ts.map +1 -1
- package/dist/detectors/bare-comparative.js +27 -3
- package/dist/detectors/bare-comparative.js.map +1 -1
- package/dist/detectors/blank-structure.d.ts +5 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +13 -7
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/bold-label.d.ts.map +1 -1
- package/dist/detectors/bold-label.js +12 -6
- package/dist/detectors/bold-label.js.map +1 -1
- package/dist/detectors/bracket-title-date.d.ts +6 -0
- package/dist/detectors/bracket-title-date.d.ts.map +1 -0
- package/dist/detectors/bracket-title-date.js +29 -0
- package/dist/detectors/bracket-title-date.js.map +1 -0
- package/dist/detectors/broken-link.d.ts.map +1 -1
- package/dist/detectors/broken-link.js +12 -1
- package/dist/detectors/broken-link.js.map +1 -1
- package/dist/detectors/capitalised-term.d.ts.map +1 -1
- package/dist/detectors/capitalised-term.js +24 -11
- package/dist/detectors/capitalised-term.js.map +1 -1
- package/dist/detectors/change-rate.d.ts.map +1 -1
- package/dist/detectors/change-rate.js +27 -4
- package/dist/detectors/change-rate.js.map +1 -1
- package/dist/detectors/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +12 -17
- package/dist/detectors/char-shape.js.map +1 -1
- package/dist/detectors/clause-shape.d.ts +4 -2
- package/dist/detectors/clause-shape.d.ts.map +1 -1
- package/dist/detectors/clause-shape.js +8 -4
- package/dist/detectors/clause-shape.js.map +1 -1
- package/dist/detectors/contraction-mix.d.ts.map +1 -1
- package/dist/detectors/contraction-mix.js +3 -2
- package/dist/detectors/contraction-mix.js.map +1 -1
- package/dist/detectors/contraction-set-apart.d.ts +7 -1
- package/dist/detectors/contraction-set-apart.d.ts.map +1 -1
- package/dist/detectors/contraction-set-apart.js +14 -1
- package/dist/detectors/contraction-set-apart.js.map +1 -1
- package/dist/detectors/coordinate-adjective.d.ts +5 -3
- package/dist/detectors/coordinate-adjective.d.ts.map +1 -1
- package/dist/detectors/coordinate-adjective.js +49 -1
- package/dist/detectors/coordinate-adjective.js.map +1 -1
- package/dist/detectors/count-per-section.d.ts.map +1 -1
- package/dist/detectors/count-per-section.js +29 -23
- package/dist/detectors/count-per-section.js.map +1 -1
- package/dist/detectors/counter-edge.d.ts +11 -0
- package/dist/detectors/counter-edge.d.ts.map +1 -1
- package/dist/detectors/counter-edge.js +17 -0
- package/dist/detectors/counter-edge.js.map +1 -1
- package/dist/detectors/cross-variant.d.ts.map +1 -1
- package/dist/detectors/cross-variant.js +14 -2
- package/dist/detectors/cross-variant.js.map +1 -1
- package/dist/detectors/custom.d.ts.map +1 -1
- package/dist/detectors/custom.js +6 -4
- package/dist/detectors/custom.js.map +1 -1
- package/dist/detectors/date-format.js +1 -1
- package/dist/detectors/date-format.js.map +1 -1
- package/dist/detectors/date-repeated-day.d.ts +11 -0
- package/dist/detectors/date-repeated-day.d.ts.map +1 -0
- package/dist/detectors/date-repeated-day.js +15 -0
- package/dist/detectors/date-repeated-day.js.map +1 -0
- package/dist/detectors/date-year.d.ts.map +1 -1
- package/dist/detectors/date-year.js +8 -1
- package/dist/detectors/date-year.js.map +1 -1
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +6 -3
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +7 -1
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +1 -0
- package/dist/detectors/derived-numbers.js.map +1 -1
- package/dist/detectors/document-shape.d.ts +1 -1
- package/dist/detectors/document-shape.d.ts.map +1 -1
- package/dist/detectors/document-shape.js +4 -1
- package/dist/detectors/document-shape.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +3 -1
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +4 -2
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/empty-section.d.ts +1 -0
- package/dist/detectors/empty-section.d.ts.map +1 -1
- package/dist/detectors/empty-section.js +10 -1
- package/dist/detectors/empty-section.js.map +1 -1
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +15 -1
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/enumeration-marker.d.ts +7 -0
- package/dist/detectors/enumeration-marker.d.ts.map +1 -0
- package/dist/detectors/enumeration-marker.js +8 -0
- package/dist/detectors/enumeration-marker.js.map +1 -0
- package/dist/detectors/event-title-item.d.ts +8 -0
- package/dist/detectors/event-title-item.d.ts.map +1 -0
- package/dist/detectors/event-title-item.js +45 -0
- package/dist/detectors/event-title-item.js.map +1 -0
- package/dist/detectors/example-baseline.d.ts +5 -0
- package/dist/detectors/example-baseline.d.ts.map +1 -1
- package/dist/detectors/example-baseline.js +15 -1
- package/dist/detectors/example-baseline.js.map +1 -1
- package/dist/detectors/filler-word.d.ts +11 -0
- package/dist/detectors/filler-word.d.ts.map +1 -0
- package/dist/detectors/filler-word.js +73 -0
- package/dist/detectors/filler-word.js.map +1 -0
- package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
- package/dist/detectors/fullwidth-alnum.js +19 -0
- package/dist/detectors/fullwidth-alnum.js.map +1 -1
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +6 -1
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/heading-marker-no-space.d.ts +3 -0
- package/dist/detectors/heading-marker-no-space.d.ts.map +1 -0
- package/dist/detectors/heading-marker-no-space.js +49 -0
- package/dist/detectors/heading-marker-no-space.js.map +1 -0
- package/dist/detectors/hyphen-name-suffix.d.ts.map +1 -1
- package/dist/detectors/hyphen-name-suffix.js +3 -2
- package/dist/detectors/hyphen-name-suffix.js.map +1 -1
- package/dist/detectors/inline-item-label.d.ts +6 -0
- package/dist/detectors/inline-item-label.d.ts.map +1 -0
- package/dist/detectors/inline-item-label.js +68 -0
- package/dist/detectors/inline-item-label.js.map +1 -0
- package/dist/detectors/kanji-name-edge.d.ts +5 -0
- package/dist/detectors/kanji-name-edge.d.ts.map +1 -1
- package/dist/detectors/kanji-name-edge.js +9 -0
- package/dist/detectors/kanji-name-edge.js.map +1 -1
- package/dist/detectors/known-correction.d.ts.map +1 -1
- package/dist/detectors/known-correction.js +13 -1
- package/dist/detectors/known-correction.js.map +1 -1
- package/dist/detectors/link-definition.d.ts +3 -0
- package/dist/detectors/link-definition.d.ts.map +1 -0
- package/dist/detectors/link-definition.js +78 -0
- package/dist/detectors/link-definition.js.map +1 -0
- package/dist/detectors/list-item-asides.d.ts +7 -0
- package/dist/detectors/list-item-asides.d.ts.map +1 -0
- package/dist/detectors/list-item-asides.js +25 -0
- package/dist/detectors/list-item-asides.js.map +1 -0
- package/dist/detectors/list-item.d.ts +2 -0
- package/dist/detectors/list-item.d.ts.map +1 -1
- package/dist/detectors/list-item.js +6 -0
- package/dist/detectors/list-item.js.map +1 -1
- package/dist/detectors/list-items.d.ts.map +1 -1
- package/dist/detectors/list-items.js +12 -3
- package/dist/detectors/list-items.js.map +1 -1
- package/dist/detectors/list-opening-conjunction.d.ts +7 -0
- package/dist/detectors/list-opening-conjunction.d.ts.map +1 -0
- package/dist/detectors/list-opening-conjunction.js +22 -0
- package/dist/detectors/list-opening-conjunction.js.map +1 -0
- package/dist/detectors/list-parallel.d.ts.map +1 -1
- package/dist/detectors/list-parallel.js +11 -14
- package/dist/detectors/list-parallel.js.map +1 -1
- package/dist/detectors/list-run.d.ts.map +1 -1
- package/dist/detectors/list-run.js +15 -3
- package/dist/detectors/list-run.js.map +1 -1
- package/dist/detectors/list-verb-series.d.ts +6 -0
- package/dist/detectors/list-verb-series.d.ts.map +1 -0
- package/dist/detectors/list-verb-series.js +20 -0
- package/dist/detectors/list-verb-series.js.map +1 -0
- package/dist/detectors/mark-shape.d.ts +5 -2
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +12 -15
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/markdown-slip.d.ts +5 -0
- package/dist/detectors/markdown-slip.d.ts.map +1 -1
- package/dist/detectors/markdown-slip.js +23 -0
- package/dist/detectors/markdown-slip.js.map +1 -1
- package/dist/detectors/marked-word.d.ts +10 -0
- package/dist/detectors/marked-word.d.ts.map +1 -0
- package/dist/detectors/marked-word.js +30 -0
- package/dist/detectors/marked-word.js.map +1 -0
- package/dist/detectors/middle-dot.d.ts +1 -1
- package/dist/detectors/middle-dot.d.ts.map +1 -1
- package/dist/detectors/middle-dot.js +21 -2
- package/dist/detectors/middle-dot.js.map +1 -1
- package/dist/detectors/missing-final-period.d.ts.map +1 -1
- package/dist/detectors/missing-final-period.js +8 -1
- package/dist/detectors/missing-final-period.js.map +1 -1
- package/dist/detectors/name-variant-two-things.d.ts +2 -1
- package/dist/detectors/name-variant-two-things.d.ts.map +1 -1
- package/dist/detectors/name-variant-two-things.js +30 -2
- package/dist/detectors/name-variant-two-things.js.map +1 -1
- package/dist/detectors/net-amount-mismatch.d.ts.map +1 -1
- package/dist/detectors/net-amount-mismatch.js +26 -4
- package/dist/detectors/net-amount-mismatch.js.map +1 -1
- package/dist/detectors/nominalization.d.ts.map +1 -1
- package/dist/detectors/nominalization.js +6 -1
- package/dist/detectors/nominalization.js.map +1 -1
- package/dist/detectors/number-style.d.ts +2 -0
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +5 -0
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/ordinary-phrase.d.ts +5 -0
- package/dist/detectors/ordinary-phrase.d.ts.map +1 -1
- package/dist/detectors/ordinary-phrase.js +12 -0
- package/dist/detectors/ordinary-phrase.js.map +1 -1
- package/dist/detectors/organisation-run.d.ts +2 -0
- package/dist/detectors/organisation-run.d.ts.map +1 -1
- package/dist/detectors/organisation-run.js +7 -0
- package/dist/detectors/organisation-run.js.map +1 -1
- package/dist/detectors/orthographic-variant-kanji-word.d.ts +22 -0
- package/dist/detectors/orthographic-variant-kanji-word.d.ts.map +1 -0
- package/dist/detectors/orthographic-variant-kanji-word.js +27 -0
- package/dist/detectors/orthographic-variant-kanji-word.js.map +1 -0
- package/dist/detectors/orthographic-variant-open.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant-open.js +2 -1
- package/dist/detectors/orthographic-variant-open.js.map +1 -1
- package/dist/detectors/orthographic-variant-text.d.ts +7 -0
- package/dist/detectors/orthographic-variant-text.d.ts.map +1 -0
- package/dist/detectors/orthographic-variant-text.js +14 -0
- package/dist/detectors/orthographic-variant-text.js.map +1 -0
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +22 -23
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +12 -2
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +14 -3
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/paragraph-run.d.ts +1 -1
- package/dist/detectors/paragraph-run.d.ts.map +1 -1
- package/dist/detectors/paragraph-run.js +4 -2
- package/dist/detectors/paragraph-run.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts.map +1 -1
- package/dist/detectors/placeholder-text.js +12 -4
- package/dist/detectors/placeholder-text.js.map +1 -1
- package/dist/detectors/placeholder.d.ts +1 -0
- package/dist/detectors/placeholder.d.ts.map +1 -1
- package/dist/detectors/placeholder.js +8 -0
- package/dist/detectors/placeholder.js.map +1 -1
- package/dist/detectors/pseudo-heading.d.ts +9 -0
- package/dist/detectors/pseudo-heading.d.ts.map +1 -0
- package/dist/detectors/pseudo-heading.js +54 -0
- package/dist/detectors/pseudo-heading.js.map +1 -0
- package/dist/detectors/quote-around.d.ts +1 -1
- package/dist/detectors/quote-around.d.ts.map +1 -1
- package/dist/detectors/quote-around.js +26 -5
- package/dist/detectors/quote-around.js.map +1 -1
- package/dist/detectors/quoted-label.d.ts +8 -0
- package/dist/detectors/quoted-label.d.ts.map +1 -0
- package/dist/detectors/quoted-label.js +18 -0
- package/dist/detectors/quoted-label.js.map +1 -0
- package/dist/detectors/ra-nuki.d.ts +1 -7
- package/dist/detectors/ra-nuki.d.ts.map +1 -1
- package/dist/detectors/ra-nuki.js +2 -27
- package/dist/detectors/ra-nuki.js.map +1 -1
- package/dist/detectors/register-required.d.ts +27 -0
- package/dist/detectors/register-required.d.ts.map +1 -0
- package/dist/detectors/register-required.js +33 -0
- package/dist/detectors/register-required.js.map +1 -0
- package/dist/detectors/register-voice.d.ts +13 -1
- package/dist/detectors/register-voice.d.ts.map +1 -1
- package/dist/detectors/register-voice.js +27 -0
- package/dist/detectors/register-voice.js.map +1 -1
- package/dist/detectors/registry/enumeration-marker.d.ts +3 -0
- package/dist/detectors/registry/enumeration-marker.d.ts.map +1 -0
- package/dist/detectors/registry/enumeration-marker.js +3 -0
- package/dist/detectors/registry/enumeration-marker.js.map +1 -0
- package/dist/detectors/registry/filler-word.d.ts +3 -0
- package/dist/detectors/registry/filler-word.d.ts.map +1 -0
- package/dist/detectors/registry/filler-word.js +3 -0
- package/dist/detectors/registry/filler-word.js.map +1 -0
- package/dist/detectors/registry/heading-marker-no-space.d.ts +3 -0
- package/dist/detectors/registry/heading-marker-no-space.d.ts.map +1 -0
- package/dist/detectors/registry/heading-marker-no-space.js +3 -0
- package/dist/detectors/registry/heading-marker-no-space.js.map +1 -0
- package/dist/detectors/registry/link-definition-unused.d.ts +3 -0
- package/dist/detectors/registry/link-definition-unused.d.ts.map +1 -0
- package/dist/detectors/registry/link-definition-unused.js +3 -0
- package/dist/detectors/registry/link-definition-unused.js.map +1 -0
- package/dist/detectors/registry/pseudo-heading.d.ts +3 -0
- package/dist/detectors/registry/pseudo-heading.d.ts.map +1 -0
- package/dist/detectors/registry/pseudo-heading.js +3 -0
- package/dist/detectors/registry/pseudo-heading.js.map +1 -0
- package/dist/detectors/registry/reversed-link.d.ts +3 -0
- package/dist/detectors/registry/reversed-link.d.ts.map +1 -0
- package/dist/detectors/registry/reversed-link.js +3 -0
- package/dist/detectors/registry/reversed-link.js.map +1 -0
- package/dist/detectors/registry/sa-ire.d.ts +3 -0
- package/dist/detectors/registry/sa-ire.d.ts.map +1 -0
- package/dist/detectors/registry/sa-ire.js +3 -0
- package/dist/detectors/registry/sa-ire.js.map +1 -0
- package/dist/detectors/registry/table-absorbed-line.d.ts +3 -0
- package/dist/detectors/registry/table-absorbed-line.d.ts.map +1 -0
- package/dist/detectors/registry/table-absorbed-line.js +3 -0
- package/dist/detectors/registry/table-absorbed-line.js.map +1 -0
- package/dist/detectors/registry/term-consistency.d.ts +3 -0
- package/dist/detectors/registry/term-consistency.d.ts.map +1 -0
- package/dist/detectors/registry/term-consistency.js +3 -0
- package/dist/detectors/registry/term-consistency.js.map +1 -0
- package/dist/detectors/registry/term-form.d.ts +3 -0
- package/dist/detectors/registry/term-form.d.ts.map +1 -0
- package/dist/detectors/registry/term-form.js +3 -0
- package/dist/detectors/registry/term-form.js.map +1 -0
- package/dist/detectors/relative-pronoun-mix.d.ts +1 -1
- package/dist/detectors/relative-pronoun-mix.d.ts.map +1 -1
- package/dist/detectors/relative-pronoun-mix.js +14 -3
- package/dist/detectors/relative-pronoun-mix.js.map +1 -1
- package/dist/detectors/release-notes.d.ts +7 -0
- package/dist/detectors/release-notes.d.ts.map +1 -0
- package/dist/detectors/release-notes.js +12 -0
- package/dist/detectors/release-notes.js.map +1 -0
- package/dist/detectors/request-owner.d.ts +5 -1
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +53 -1
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/reversed-link.d.ts +3 -0
- package/dist/detectors/reversed-link.d.ts.map +1 -0
- package/dist/detectors/reversed-link.js +31 -0
- package/dist/detectors/reversed-link.js.map +1 -0
- package/dist/detectors/sa-ire.d.ts +3 -0
- package/dist/detectors/sa-ire.d.ts.map +1 -0
- package/dist/detectors/sa-ire.js +5 -0
- package/dist/detectors/sa-ire.js.map +1 -0
- package/dist/detectors/sentence-counts.d.ts.map +1 -1
- package/dist/detectors/sentence-counts.js +19 -6
- package/dist/detectors/sentence-counts.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +35 -11
- 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 +11 -1
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/sentence-rhythm.d.ts.map +1 -1
- package/dist/detectors/sentence-rhythm.js +6 -2
- package/dist/detectors/sentence-rhythm.js.map +1 -1
- package/dist/detectors/signals.js +2 -2
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/structure.d.ts +1 -0
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +5 -0
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/technical-docs.d.ts +8 -1
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +16 -3
- package/dist/detectors/technical-docs.js.map +1 -1
- package/dist/detectors/term-consistency.d.ts +4 -0
- package/dist/detectors/term-consistency.d.ts.map +1 -0
- package/dist/detectors/term-consistency.js +35 -0
- package/dist/detectors/term-consistency.js.map +1 -0
- package/dist/detectors/term-form.d.ts +4 -0
- package/dist/detectors/term-form.d.ts.map +1 -0
- package/dist/detectors/term-form.js +17 -0
- package/dist/detectors/term-form.js.map +1 -0
- package/dist/detectors/token-shape.d.ts.map +1 -1
- package/dist/detectors/token-shape.js +4 -1
- package/dist/detectors/token-shape.js.map +1 -1
- package/dist/detectors/unbalanced-bracket.d.ts +1 -1
- package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
- package/dist/detectors/unbalanced-bracket.js +4 -2
- package/dist/detectors/unbalanced-bracket.js.map +1 -1
- package/dist/detectors/unknown-word-context.d.ts +2 -0
- package/dist/detectors/unknown-word-context.d.ts.map +1 -1
- package/dist/detectors/unknown-word-context.js +3 -0
- package/dist/detectors/unknown-word-context.js.map +1 -1
- package/dist/detectors/unknown-word.d.ts.map +1 -1
- package/dist/detectors/unknown-word.js +7 -2
- package/dist/detectors/unknown-word.js.map +1 -1
- package/dist/detectors/vague-density.d.ts.map +1 -1
- package/dist/detectors/vague-density.js +10 -2
- package/dist/detectors/vague-density.js.map +1 -1
- package/dist/detectors/version-mismatch.d.ts.map +1 -1
- package/dist/detectors/version-mismatch.js +5 -1
- package/dist/detectors/version-mismatch.js.map +1 -1
- package/dist/detectors/weasel-word.d.ts.map +1 -1
- package/dist/detectors/weasel-word.js +11 -2
- package/dist/detectors/weasel-word.js.map +1 -1
- package/dist/document-prose.d.ts +17 -0
- package/dist/document-prose.d.ts.map +1 -0
- package/dist/document-prose.js +35 -0
- package/dist/document-prose.js.map +1 -0
- package/dist/document-scope.d.ts +16 -0
- package/dist/document-scope.d.ts.map +1 -0
- package/dist/document-scope.js +51 -0
- package/dist/document-scope.js.map +1 -0
- package/dist/document.d.ts +10 -1
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +26 -37
- package/dist/document.js.map +1 -1
- package/dist/enumeration-marks.d.ts +23 -0
- package/dist/enumeration-marks.d.ts.map +1 -0
- package/dist/enumeration-marks.js +184 -0
- package/dist/enumeration-marks.js.map +1 -0
- package/dist/facts/cross-facts.d.ts +1 -1
- package/dist/facts/cross-facts.d.ts.map +1 -1
- package/dist/facts/cross-facts.js +8 -3
- package/dist/facts/cross-facts.js.map +1 -1
- package/dist/facts/labelled-facts.d.ts.map +1 -1
- package/dist/facts/labelled-facts.js +7 -4
- package/dist/facts/labelled-facts.js.map +1 -1
- package/dist/file-header.d.ts +2 -6
- package/dist/file-header.d.ts.map +1 -1
- package/dist/file-header.js +1 -1
- package/dist/file-header.js.map +1 -1
- package/dist/files.d.ts +18 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +58 -8
- package/dist/files.js.map +1 -1
- package/dist/gitignore.d.ts +30 -0
- package/dist/gitignore.d.ts.map +1 -0
- package/dist/gitignore.js +68 -0
- package/dist/gitignore.js.map +1 -0
- package/dist/grade/stamp.d.ts.map +1 -1
- package/dist/grade/stamp.js +5 -0
- package/dist/grade/stamp.js.map +1 -1
- package/dist/latin-word-boundary.d.ts +5 -0
- package/dist/latin-word-boundary.d.ts.map +1 -1
- package/dist/latin-word-boundary.js +11 -0
- package/dist/latin-word-boundary.js.map +1 -1
- package/dist/markdown-node.d.ts +1 -0
- package/dist/markdown-node.d.ts.map +1 -1
- package/dist/markdown-node.js.map +1 -1
- package/dist/name-separator.d.ts.map +1 -1
- package/dist/name-separator.js +27 -5
- package/dist/name-separator.js.map +1 -1
- package/dist/news-dateline.d.ts +7 -0
- package/dist/news-dateline.d.ts.map +1 -0
- package/dist/news-dateline.js +24 -0
- package/dist/news-dateline.js.map +1 -0
- package/dist/plugin.d.ts +24 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/reasons.d.ts +4 -0
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +4 -0
- package/dist/reasons.js.map +1 -1
- package/dist/render/explain.d.ts +3 -0
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +19 -1
- package/dist/render/explain.js.map +1 -1
- package/dist/render/rules-json.d.ts.map +1 -1
- package/dist/render/rules-json.js +12 -2
- package/dist/render/rules-json.js.map +1 -1
- package/dist/render/summary.d.ts +5 -2
- package/dist/render/summary.d.ts.map +1 -1
- package/dist/render/summary.js +25 -4
- package/dist/render/summary.js.map +1 -1
- package/dist/render/suppressions.d.ts +6 -1
- package/dist/render/suppressions.d.ts.map +1 -1
- package/dist/render/suppressions.js +76 -3
- package/dist/render/suppressions.js.map +1 -1
- package/dist/rule-load.d.ts.map +1 -1
- package/dist/rule-load.js +2 -1
- package/dist/rule-load.js.map +1 -1
- package/dist/run-in-title.d.ts +4 -0
- package/dist/run-in-title.d.ts.map +1 -0
- package/dist/run-in-title.js +82 -0
- package/dist/run-in-title.js.map +1 -0
- package/dist/run.d.ts +2 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +20 -8
- package/dist/run.js.map +1 -1
- package/dist/scope-markers.d.ts +9 -0
- package/dist/scope-markers.d.ts.map +1 -0
- package/dist/scope-markers.js +19 -0
- package/dist/scope-markers.js.map +1 -0
- package/dist/scope-problem-text.d.ts +4 -0
- package/dist/scope-problem-text.d.ts.map +1 -0
- package/dist/scope-problem-text.js +17 -0
- package/dist/scope-problem-text.js.map +1 -0
- package/dist/scoped-sentences.d.ts +21 -0
- package/dist/scoped-sentences.d.ts.map +1 -0
- package/dist/scoped-sentences.js +21 -0
- package/dist/scoped-sentences.js.map +1 -0
- package/dist/setting-problems.d.ts.map +1 -1
- package/dist/setting-problems.js +4 -0
- package/dist/setting-problems.js.map +1 -1
- package/dist/spelling.js +4 -4
- package/dist/spelling.js.map +1 -1
- package/dist/stet-body.d.ts +13 -0
- package/dist/stet-body.d.ts.map +1 -0
- package/dist/stet-body.js +49 -0
- package/dist/stet-body.js.map +1 -0
- package/dist/stet.d.ts +30 -4
- package/dist/stet.d.ts.map +1 -1
- package/dist/stet.js +78 -28
- package/dist/stet.js.map +1 -1
- package/dist/structure/alert-lines.d.ts +4 -0
- package/dist/structure/alert-lines.d.ts.map +1 -0
- package/dist/structure/alert-lines.js +19 -0
- package/dist/structure/alert-lines.js.map +1 -0
- package/dist/structure/catch-all-row-blank.d.ts +9 -0
- package/dist/structure/catch-all-row-blank.d.ts.map +1 -0
- package/dist/structure/catch-all-row-blank.js +19 -0
- package/dist/structure/catch-all-row-blank.js.map +1 -0
- package/dist/structure/change-rate-tied.d.ts +22 -0
- package/dist/structure/change-rate-tied.d.ts.map +1 -0
- package/dist/structure/change-rate-tied.js +85 -0
- package/dist/structure/change-rate-tied.js.map +1 -0
- package/dist/structure/cross-definitions.d.ts +1 -1
- package/dist/structure/cross-definitions.d.ts.map +1 -1
- package/dist/structure/cross-definitions.js +3 -9
- package/dist/structure/cross-definitions.js.map +1 -1
- package/dist/structure/defining-names.d.ts +1 -1
- package/dist/structure/defining-names.d.ts.map +1 -1
- package/dist/structure/defining-names.js +12 -1
- package/dist/structure/defining-names.js.map +1 -1
- package/dist/structure/net-amount.d.ts +16 -0
- package/dist/structure/net-amount.d.ts.map +1 -1
- package/dist/structure/net-amount.js +28 -1
- package/dist/structure/net-amount.js.map +1 -1
- package/dist/structure/period-label-conflict.d.ts +2 -2
- package/dist/structure/period-label-conflict.d.ts.map +1 -1
- package/dist/structure/period-label-conflict.js +17 -3
- package/dist/structure/period-label-conflict.js.map +1 -1
- package/dist/structure/serial-range.d.ts.map +1 -1
- package/dist/structure/serial-range.js +14 -6
- package/dist/structure/serial-range.js.map +1 -1
- package/dist/structure/version-mismatch.d.ts +6 -1
- package/dist/structure/version-mismatch.d.ts.map +1 -1
- package/dist/structure/version-mismatch.js +28 -6
- package/dist/structure/version-mismatch.js.map +1 -1
- package/dist/structure/weekday.d.ts.map +1 -1
- package/dist/structure/weekday.js +14 -1
- package/dist/structure/weekday.js.map +1 -1
- package/dist/table-cells.d.ts +1 -1
- package/dist/table-cells.d.ts.map +1 -1
- package/dist/table-cells.js.map +1 -1
- package/dist/term-form.d.ts +15 -0
- package/dist/term-form.d.ts.map +1 -0
- package/dist/term-form.js +72 -0
- package/dist/term-form.js.map +1 -0
- package/dist/term-groups.d.ts +33 -0
- package/dist/term-groups.d.ts.map +1 -0
- package/dist/term-groups.js +46 -0
- package/dist/term-groups.js.map +1 -0
- package/dist/text-scope.d.ts +35 -0
- package/dist/text-scope.d.ts.map +1 -0
- package/dist/text-scope.js +55 -0
- package/dist/text-scope.js.map +1 -0
- package/dist/topic-clause.d.ts.map +1 -1
- package/dist/topic-clause.js +85 -16
- package/dist/topic-clause.js.map +1 -1
- package/dist/unclosed-code-quote.d.ts +7 -0
- package/dist/unclosed-code-quote.d.ts.map +1 -0
- package/dist/unclosed-code-quote.js +37 -0
- package/dist/unclosed-code-quote.js.map +1 -0
- package/package.json +4 -3
- package/rules/adverb-overuse.yaml +2 -2
- package/rules/bold-density.yaml +2 -2
- package/rules/bold-label-list.yaml +2 -2
- package/rules/bracket-width-consistency.yaml +2 -2
- package/rules/broken-link.yaml +2 -2
- package/rules/change-rate-mismatch.yaml +2 -2
- package/rules/code-fence-language-mix.yaml +2 -2
- package/rules/comparative-without-baseline.yaml +2 -2
- package/rules/contraction-consistency.yaml +3 -3
- package/rules/cross-doc-duplicate-definition.yaml +2 -2
- package/rules/cross-doc-fact-conflict.yaml +2 -2
- package/rules/cross-doc-term-variant.yaml +4 -4
- package/rules/date-format-consistency.yaml +2 -2
- package/rules/date-weekday-mismatch.yaml +2 -2
- package/rules/date-without-year.yaml +2 -2
- package/rules/defined-term-form.yaml +2 -2
- package/rules/elapsed-years-mismatch.yaml +2 -2
- package/rules/empty-section.yaml +2 -2
- package/rules/empty-table-cell.yaml +2 -2
- package/rules/enumeration-marker-mix.yaml +102 -0
- package/rules/filler-word.yaml +74 -0
- package/rules/fullwidth-alnum-consistency.yaml +2 -2
- package/rules/heading-marker-no-space.yaml +79 -0
- package/rules/hyphen-as-dash.yaml +2 -2
- package/rules/known-misspelling.yaml +2 -2
- package/rules/latin-spacing.yaml +4 -4
- package/rules/link-definition-unused.yaml +107 -0
- package/rules/list-item-form-mix.yaml +2 -2
- package/rules/max-kanji-continuous.yaml +5 -2
- package/rules/max-sentence-length.yaml +2 -2
- package/rules/missing-final-period.yaml +2 -2
- package/rules/name-variant.yaml +2 -2
- package/rules/net-amount-mismatch.yaml +5 -5
- package/rules/no-doubled-joshi.yaml +2 -2
- package/rules/no-mixed-desumasu.yaml +62 -2
- package/rules/no-nakaguro-parallel.yaml +2 -2
- package/rules/nominalization.yaml +2 -2
- package/rules/number-style-consistency.yaml +2 -2
- package/rules/obligation-without-deadline.yaml +2 -2
- package/rules/one-sentence-paragraph-run.yaml +2 -2
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/oxford-comma-consistency.yaml +2 -2
- package/rules/period-label-conflict.yaml +2 -2
- package/rules/preamble-length.yaml +2 -2
- package/rules/pseudo-heading.yaml +79 -0
- package/rules/quote-without-source.yaml +2 -2
- package/rules/repeated-sentence-ending.yaml +2 -2
- package/rules/request-without-deadline.yaml +2 -2
- package/rules/reversed-link.yaml +78 -0
- package/rules/sa-ire.yaml +43 -0
- package/rules/sentence-rhythm.yaml +2 -2
- package/rules/serial-range-reversed.yaml +4 -4
- package/rules/shell-prompt-mix.yaml +2 -2
- package/rules/table-absorbed-line.yaml +88 -0
- package/rules/teki-overuse.yaml +2 -2
- package/rules/term-consistency.yaml +56 -0
- package/rules/term-form.yaml +56 -0
- package/rules/title-case-consistency.yaml +4 -4
- package/rules/title-length.yaml +2 -2
- package/rules/topic-predicate-distance.yaml +2 -2
- package/rules/unbalanced-bracket.yaml +2 -2
- package/rules/undefined-acronym.yaml +4 -2
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +2 -2
- package/rules/unknown-word.yaml +2 -2
- package/rules/use-before-definition.yaml +2 -2
- package/rules/vague-word-density.yaml +2 -2
- package/rules/version-mismatch.yaml +2 -2
- package/rules/weasel-word.yaml +3 -3
- package/rules/which-that-consistency.yaml +2 -2
- package/skills/chaff/SKILL.md +51 -7
- package/src/allow.ts +146 -0
- package/src/check-source.ts +33 -9
- package/src/cli-text.ts +13 -4
- package/src/cli.ts +16 -15
- package/src/commands/eval.ts +1 -1
- package/src/commands/suppressions.ts +3 -3
- package/src/commands/test.ts +1 -1
- package/src/compound-head.ts +17 -8
- package/src/config/allow-problems.ts +75 -0
- package/src/config/by-path-problems.ts +29 -3
- package/src/config/by-path-rules.ts +78 -0
- package/src/config/by-path.ts +9 -0
- package/src/config/consistent-problems.ts +36 -0
- package/src/config/load.ts +87 -15
- package/src/config/option-problems.ts +8 -5
- package/src/config/prefer-problems.ts +22 -0
- package/src/config/prefer.ts +52 -0
- package/src/config/term-problems.ts +38 -0
- package/src/config/warnings.ts +9 -2
- package/src/cross-variants.ts +4 -7
- package/src/cross-votes.ts +35 -4
- package/src/custom/parse.ts +16 -3
- package/src/custom/problems.ts +9 -3
- package/src/custom/scope-field.ts +16 -0
- package/src/date-format.ts +43 -8
- package/src/derived/elapsed.ts +17 -2
- package/src/detectors/acronym-context.ts +7 -1
- package/src/detectors/acronym-gloss.ts +59 -11
- package/src/detectors/bare-comparative.ts +35 -3
- package/src/detectors/blank-structure.ts +18 -9
- package/src/detectors/bold-label.ts +7 -2
- package/src/detectors/bracket-title-date.ts +36 -0
- package/src/detectors/broken-link.ts +14 -1
- package/src/detectors/capitalised-term.ts +18 -4
- package/src/detectors/change-rate.ts +29 -4
- package/src/detectors/char-shape.ts +13 -17
- package/src/detectors/clause-shape.ts +8 -4
- package/src/detectors/contraction-mix.ts +8 -2
- package/src/detectors/contraction-set-apart.ts +22 -2
- package/src/detectors/coordinate-adjective.ts +54 -1
- package/src/detectors/count-per-section.ts +13 -8
- package/src/detectors/counter-edge.ts +20 -0
- package/src/detectors/cross-variant.ts +16 -2
- package/src/detectors/custom.ts +6 -4
- package/src/detectors/date-format.ts +1 -1
- package/src/detectors/date-repeated-day.ts +20 -0
- package/src/detectors/date-year.ts +8 -1
- package/src/detectors/defined-term-form.ts +6 -3
- package/src/detectors/definition-use.ts +7 -1
- package/src/detectors/derived-numbers.ts +1 -0
- package/src/detectors/document-shape.ts +4 -1
- package/src/detectors/email-letter.ts +6 -2
- package/src/detectors/empty-section.ts +10 -2
- package/src/detectors/en-shape.ts +17 -1
- package/src/detectors/enumeration-marker.ts +14 -0
- package/src/detectors/event-title-item.ts +57 -0
- package/src/detectors/example-baseline.ts +16 -1
- package/src/detectors/filler-word.ts +96 -0
- package/src/detectors/fullwidth-alnum.ts +24 -0
- package/src/detectors/heading-case.ts +7 -1
- package/src/detectors/heading-marker-no-space.ts +62 -0
- package/src/detectors/hyphen-name-suffix.ts +3 -2
- package/src/detectors/inline-item-label.ts +98 -0
- package/src/detectors/kanji-name-edge.ts +11 -0
- package/src/detectors/known-correction.ts +17 -1
- package/src/detectors/link-definition.ts +91 -0
- package/src/detectors/list-item-asides.ts +29 -0
- package/src/detectors/list-item.ts +7 -0
- package/src/detectors/list-items.ts +13 -2
- package/src/detectors/list-opening-conjunction.ts +22 -0
- package/src/detectors/list-parallel.ts +11 -15
- package/src/detectors/list-run.ts +16 -3
- package/src/detectors/list-verb-series.ts +24 -0
- package/src/detectors/mark-shape.ts +15 -19
- package/src/detectors/markdown-slip.ts +25 -1
- package/src/detectors/marked-word.ts +40 -0
- package/src/detectors/middle-dot.ts +27 -2
- package/src/detectors/missing-final-period.ts +9 -1
- package/src/detectors/name-variant-two-things.ts +37 -2
- package/src/detectors/net-amount-mismatch.ts +41 -4
- package/src/detectors/nominalization.ts +8 -1
- package/src/detectors/number-style.ts +8 -0
- package/src/detectors/ordinary-phrase.ts +13 -0
- package/src/detectors/organisation-run.ts +9 -0
- package/src/detectors/orthographic-variant-kanji-word.ts +33 -0
- package/src/detectors/orthographic-variant-open.ts +2 -1
- package/src/detectors/orthographic-variant-text.ts +20 -0
- package/src/detectors/orthographic-variant.ts +25 -32
- package/src/detectors/orthography.ts +18 -2
- package/src/detectors/oxford-comma.ts +14 -2
- package/src/detectors/paragraph-run.ts +7 -10
- package/src/detectors/placeholder-text.ts +22 -5
- package/src/detectors/placeholder.ts +10 -0
- package/src/detectors/pseudo-heading.ts +59 -0
- package/src/detectors/quote-around.ts +31 -6
- package/src/detectors/quoted-label.ts +22 -0
- package/src/detectors/ra-nuki.ts +3 -34
- package/src/detectors/register-required.ts +56 -0
- package/src/detectors/register-voice.ts +36 -1
- package/src/detectors/registry/enumeration-marker.ts +4 -0
- package/src/detectors/registry/filler-word.ts +4 -0
- package/src/detectors/registry/heading-marker-no-space.ts +4 -0
- package/src/detectors/registry/link-definition-unused.ts +4 -0
- package/src/detectors/registry/pseudo-heading.ts +4 -0
- package/src/detectors/registry/reversed-link.ts +4 -0
- package/src/detectors/registry/sa-ire.ts +4 -0
- package/src/detectors/registry/table-absorbed-line.ts +4 -0
- package/src/detectors/registry/term-consistency.ts +4 -0
- package/src/detectors/registry/term-form.ts +4 -0
- package/src/detectors/relative-pronoun-mix.ts +18 -3
- package/src/detectors/release-notes.ts +19 -0
- package/src/detectors/request-owner.ts +62 -2
- package/src/detectors/reversed-link.ts +39 -0
- package/src/detectors/sa-ire.ts +7 -0
- package/src/detectors/sentence-counts.ts +28 -9
- package/src/detectors/sentence-ending.ts +53 -12
- package/src/detectors/sentence-length.ts +16 -2
- package/src/detectors/sentence-rhythm.ts +6 -2
- package/src/detectors/signals.ts +2 -2
- package/src/detectors/structure.ts +4 -0
- package/src/detectors/technical-docs.ts +27 -3
- package/src/detectors/term-consistency.ts +41 -0
- package/src/detectors/term-form.ts +17 -0
- package/src/detectors/token-shape.ts +4 -1
- package/src/detectors/unbalanced-bracket.ts +4 -2
- package/src/detectors/unknown-word-context.ts +6 -0
- package/src/detectors/unknown-word.ts +7 -1
- package/src/detectors/vague-density.ts +10 -2
- package/src/detectors/version-mismatch.ts +7 -1
- package/src/detectors/weasel-word.ts +13 -2
- package/src/document-prose.ts +43 -0
- package/src/document-scope.ts +66 -0
- package/src/document.ts +43 -50
- package/src/enumeration-marks.ts +233 -0
- package/src/facts/cross-facts.ts +10 -4
- package/src/facts/labelled-facts.ts +7 -4
- package/src/file-header.ts +3 -5
- package/src/files.ts +87 -8
- package/src/gitignore.ts +83 -0
- package/src/grade/stamp.ts +5 -0
- package/src/latin-word-boundary.ts +12 -0
- package/src/markdown-node.ts +1 -0
- package/src/name-separator.ts +29 -7
- package/src/news-dateline.ts +29 -0
- package/src/plugin.ts +21 -3
- package/src/reasons.ts +8 -0
- package/src/render/explain.ts +26 -1
- package/src/render/rules-json.ts +16 -2
- package/src/render/summary.ts +33 -4
- package/src/render/suppressions.ts +101 -4
- package/src/rule-load.ts +3 -2
- package/src/run-in-title.ts +91 -0
- package/src/run.ts +21 -8
- package/src/scope-markers.ts +25 -0
- package/src/scope-problem-text.ts +21 -0
- package/src/scoped-sentences.ts +41 -0
- package/src/setting-problems.ts +4 -0
- package/src/spelling.ts +4 -4
- package/src/stet-body.ts +74 -0
- package/src/stet.ts +113 -32
- package/src/structure/alert-lines.ts +19 -0
- package/src/structure/catch-all-row-blank.ts +22 -0
- package/src/structure/change-rate-tied.ts +113 -0
- package/src/structure/cross-definitions.ts +6 -9
- package/src/structure/defining-names.ts +14 -1
- package/src/structure/net-amount.ts +44 -5
- package/src/structure/period-label-conflict.ts +22 -7
- package/src/structure/serial-range.ts +14 -6
- package/src/structure/version-mismatch.ts +41 -8
- package/src/structure/weekday.ts +14 -1
- package/src/table-cells.ts +2 -2
- package/src/term-form.ts +99 -0
- package/src/term-groups.ts +68 -0
- package/src/text-scope.ts +79 -0
- package/src/topic-clause.ts +96 -17
- package/src/unclosed-code-quote.ts +42 -0
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
lastNoun,
|
|
25
25
|
openingKind,
|
|
26
26
|
openingOf,
|
|
27
|
+
opensAsPreposition,
|
|
27
28
|
participleOpening,
|
|
28
29
|
shapeOf,
|
|
29
30
|
shapeOfHead,
|
|
@@ -58,6 +59,7 @@ import { listContinues, walker, type Walk } from "./list-run.ts";
|
|
|
58
59
|
import { joinsUnfinished, repeatsConjunction } from "./list-joint.ts";
|
|
59
60
|
import { insideSentenceCaseTitle } from "./title-list.ts";
|
|
60
61
|
import { insideByline } from "./byline-list.ts";
|
|
62
|
+
import { withoutOpeningConjunction } from "./list-opening-conjunction.ts";
|
|
61
63
|
|
|
62
64
|
const EMPTY: TokenRange = { start: 0, end: 0 };
|
|
63
65
|
|
|
@@ -99,6 +101,8 @@ const withoutSequenceWord = (view: View): View | undefined => {
|
|
|
99
101
|
const withoutLead = (view: View): View => {
|
|
100
102
|
const afterSequence = withoutSequenceWord(view);
|
|
101
103
|
if (afterSequence !== undefined) return withoutLead(afterSequence);
|
|
104
|
+
const afterConjunction = withoutOpeningConjunction(view);
|
|
105
|
+
if (afterConjunction !== undefined) return withoutLead(afterConjunction);
|
|
102
106
|
const { scope } = view.list;
|
|
103
107
|
const [first, second] = [firstOf(view), secondOf(view)];
|
|
104
108
|
const opening = first === undefined ? undefined : openingOf(scope, first.item);
|
|
@@ -131,7 +135,7 @@ const afterClosedList = (view: View): View => {
|
|
|
131
135
|
const afterVerbAside = (view: View): View => {
|
|
132
136
|
const { scope } = view.list;
|
|
133
137
|
const [verb, aside] = [firstOf(view), secondOf(view)];
|
|
134
|
-
if (verb === undefined || aside === undefined || lastContent(scope, verb.item)?.pos !== "VERB" ||
|
|
138
|
+
if (verb === undefined || aside === undefined || lastContent(scope, verb.item)?.pos !== "VERB" || !opensAsPreposition(scope, aside.item)) return view;
|
|
135
139
|
const object = firstOf(after(view, aside));
|
|
136
140
|
return object !== undefined && opensAsNoun(scope, object.item) ? after(view, aside) : view;
|
|
137
141
|
};
|
|
@@ -164,6 +168,12 @@ const opensAsNoun = (scope: ItemScope, item: TokenRange): boolean => {
|
|
|
164
168
|
return opening !== undefined && (opening.pos === "DET" || NOMINAL.has(opening.pos));
|
|
165
169
|
};
|
|
166
170
|
|
|
171
|
+
/** 導入の句の頭(前置詞・接続詞・副詞・to・分詞)で始まる項目。 */
|
|
172
|
+
const opensAsLead = (scope: ItemScope, item: TokenRange): boolean => {
|
|
173
|
+
const opening = openingOf(scope, item);
|
|
174
|
+
return opening !== undefined && (LEAD_POS.has(opening.pos) || isParticiple(opening));
|
|
175
|
+
};
|
|
176
|
+
|
|
167
177
|
/** 項目が読点で閉じず、節の終わり(文の終わりか ; : —)まで続く。 */
|
|
168
178
|
const runsToClauseEnd = (scope: ItemScope, item: TokenRange): boolean => scope.sentence.tokens[item.end]?.surface !== ",";
|
|
169
179
|
|
|
@@ -171,11 +181,13 @@ const runsToClauseEnd = (scope: ItemScope, item: TokenRange): boolean => scope.s
|
|
|
171
181
|
* 名前のすぐ後ろの、関係詞(who / which)で始まる項目は、読点で挟んで名前に添えた節(Tom, who repaired radios for forty years
|
|
172
182
|
* before he retired, gently opened the back and quickly found a loose wire)。名前も節も並びの項目ではなく、並びがあるなら節の後ろから
|
|
173
183
|
* (Alice, who leads design, Bob, Carol, and Dan は Bob からの 3 つ)。関係詞の語は語彙表 aside-relative が言う。
|
|
184
|
+
* 導入の句(To create a list in the editor, which uses no fixed font, you can look … and count)に添えた節も同じ。
|
|
185
|
+
* 動詞で始まる項目(Review the docs, which are long, fix typos, and ship)は述語の並びの項目なので残す。
|
|
174
186
|
*/
|
|
175
187
|
const afterRelativeAside = (view: View): View => {
|
|
176
188
|
const { scope } = view.list;
|
|
177
189
|
const [name, aside] = [firstOf(view), secondOf(view)];
|
|
178
|
-
if (name === undefined || aside === undefined || !opensAsNoun(scope, name.item)) return view;
|
|
190
|
+
if (name === undefined || aside === undefined || !(opensAsNoun(scope, name.item) || opensAsLead(scope, name.item))) return view;
|
|
179
191
|
const opening = openingOf(scope, aside.item)?.surface.toLowerCase() ?? "";
|
|
180
192
|
return scope.sentence.words.asideRelative?.has(opening) === true ? after(view, aside) : view;
|
|
181
193
|
};
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import type { Detector, Finding } from "../plugin.ts";
|
|
1
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
2
|
import { oneSentenceRuns } from "../paragraph-runs.ts";
|
|
3
3
|
import { referenceListSpans } from "../reference-lists.ts";
|
|
4
4
|
|
|
5
5
|
/** How much of the run's first paragraph the finding quotes when it holds no sentence; it never runs past the paragraph. */
|
|
6
6
|
const QUOTE_LENGTH = 80;
|
|
7
7
|
|
|
8
|
+
/** The headings whose paragraphs are entries, not prose: a reference list's, and a footnotes section's (each note its own paragraph). */
|
|
9
|
+
const entryListHeadings = (doc: ProseDocument): string[] =>
|
|
10
|
+
["reference-list-heading", "note-list-heading"].flatMap((lexicon) => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern));
|
|
11
|
+
|
|
8
12
|
/**
|
|
9
13
|
* Runs of one-sentence paragraphs longer than the limit: every sentence set apart as its own paragraph, so nothing is grouped
|
|
10
14
|
* and the reader cannot see which points belong together. One finding per run, at its first paragraph. A reference list's
|
|
11
|
-
* entries are a list, and are not counted.
|
|
15
|
+
* entries and a footnotes section's notes are a list, and are not counted.
|
|
12
16
|
*/
|
|
13
17
|
export const oneSentenceParagraphRun: Detector = (doc, options): Finding[] =>
|
|
14
|
-
oneSentenceRuns(
|
|
15
|
-
doc.source,
|
|
16
|
-
doc.paragraphs,
|
|
17
|
-
referenceListSpans(
|
|
18
|
-
doc.source,
|
|
19
|
-
(doc.lexicons["reference-list-heading"] ?? []).map((entry) => entry.pattern),
|
|
20
|
-
),
|
|
21
|
-
)
|
|
18
|
+
oneSentenceRuns(doc.source, doc.paragraphs, referenceListSpans(doc.source, entryListHeadings(doc)))
|
|
22
19
|
.filter((run) => run.length > options.limit)
|
|
23
20
|
.flatMap((run) => {
|
|
24
21
|
const first = run[0];
|
|
@@ -59,10 +59,23 @@ const opensWith = (inner: string, words: Lexicon): boolean => words.some((word)
|
|
|
59
59
|
|
|
60
60
|
const spanOf = (match: RegExpExecArray): Span => ({ start: match.index, end: match.index + match[0].length });
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
/** A bracket glued into a web or mail address (hello@[yourcompany].com, example.com/[yourname]): the address goes on after it. */
|
|
63
|
+
const ADDRESS_BEFORE = /[@/.]$/u;
|
|
64
|
+
const ADDRESS_AFTER = /^(?:\.\p{L}|\/)/u;
|
|
65
|
+
const ONE_TOKEN = /^[\p{Ll}\d_-]+$/u;
|
|
66
|
+
|
|
67
|
+
/** A bracket inside an address holds one run-together lowercase token that opens with a bracket word ([yourcoworkingspace]). */
|
|
68
|
+
const isAddressBlank = (text: string, match: RegExpExecArray, inner: string, words: Lexicon): boolean =>
|
|
69
|
+
ADDRESS_BEFORE.test(text.slice(0, match.index)) &&
|
|
70
|
+
ADDRESS_AFTER.test(text.slice(match.index + match[0].length)) &&
|
|
71
|
+
ONE_TOKEN.test(inner) &&
|
|
72
|
+
words.some((word) => inner.startsWith(word.pattern.toLowerCase()));
|
|
73
|
+
|
|
74
|
+
const holdsBlank = (text: string, match: RegExpExecArray, holds: (inner: string, raw: string, match: RegExpExecArray) => boolean): boolean =>
|
|
75
|
+
!FILLED_AFTER.test(text.slice(match.index + match[0].length)) && holds(innerOf(match), rawInnerOf(match), match);
|
|
76
|
+
|
|
77
|
+
const bracketedSpans = (text: string, pattern: RegExp, holds: (inner: string, raw: string, match: RegExpExecArray) => boolean): Span[] =>
|
|
78
|
+
[...text.matchAll(pattern)].filter((match) => holdsBlank(text, match, holds)).map(spanOf);
|
|
66
79
|
|
|
67
80
|
/**
|
|
68
81
|
* A value left as a marker: the whole text is the marker ("TBD", 「未定」), or the marker opens it before a colon
|
|
@@ -185,7 +198,11 @@ export const placeholderSpans = (text: string, words: Lexicon): Span[] => {
|
|
|
185
198
|
units: words.filter((word) => word.group === BLANK_UNIT),
|
|
186
199
|
};
|
|
187
200
|
return [
|
|
188
|
-
...bracketedSpans(
|
|
201
|
+
...bracketedSpans(
|
|
202
|
+
text,
|
|
203
|
+
BRACKETED,
|
|
204
|
+
(inner, raw, match) => holdsWord(inner, bracketWords) || endsWithWord(raw, closings) || isAddressBlank(text, match, inner, bracketWords),
|
|
205
|
+
),
|
|
189
206
|
...(instructions.length === 0 ? [] : bracketedSpans(text, PARENTHESIZED, (inner) => opensWith(inner, instructions))),
|
|
190
207
|
...lineMarkerSpans(text, markers, labels),
|
|
191
208
|
...blankMarkSpans(text, blankWords),
|
|
@@ -7,6 +7,7 @@ import { escapeRegExp } from "../orthography.ts";
|
|
|
7
7
|
* AI時代の AI や CI/CD の CD は、同じ文字の繰り返しではないので略語のまま数える。
|
|
8
8
|
* 単位の前には空白 1 つを挟んでもよい(XX 月 XX 日)。ひな形が名前の代わりに書く O か X を 4 つ以上並べた語(OOOO、XXXX)も、
|
|
9
9
|
* 単位が無くても略語ではない。3 つまで(AAA、XXX)は略語にもあり、ほかの文字の繰り返し(IIII、MMMMM)は崩れたローマ数字にもある。
|
|
10
|
+
* 3 つまでの O か X の繰り返しも、同じ文に同じ形で 2 度以上置けば(OO で OO な方)、語の代わりに空けた欄で略語ではない。
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
type Span = { readonly start: number; readonly end: number };
|
|
@@ -17,6 +18,9 @@ const SEPARATOR = "[//::.-]";
|
|
|
17
18
|
const JOINED = new RegExp(String.raw`(?<![A-Za-z0-9_&])${PART}(?:${SEPARATOR}${PART})+(?![A-Za-z0-9_&])`, "gu");
|
|
18
19
|
const CAPITALS = /[A-Z]+/gu;
|
|
19
20
|
const LONG_REPEAT = /(?<![A-Za-z0-9_&])(?<letter>[OX])\k<letter>{3,}(?![A-Za-z0-9_&])/gu;
|
|
21
|
+
const SHORT_REPEAT = /(?<![A-Za-z0-9_&])(?<letter>[OX])\k<letter>{1,2}(?![A-Za-z0-9_&])/gu;
|
|
22
|
+
/** 一つの文に置いた空欄の数がこれ以上なら、短い繰り返しも空欄と読む。一つだけの OO や XXX は略語(out of office の OOO)にもある。 */
|
|
23
|
+
const REPEATED_BLANKS = 2;
|
|
20
24
|
|
|
21
25
|
const isRepeated = (word: string): boolean => REPEATED.test(word);
|
|
22
26
|
|
|
@@ -37,9 +41,15 @@ const beforeUnitSpans = (text: string, units: readonly string[]): Span[] => {
|
|
|
37
41
|
return [...text.matchAll(pattern)].filter((match) => isRepeated(match[0])).map(spanOf);
|
|
38
42
|
};
|
|
39
43
|
|
|
44
|
+
const repeatedBlankSpans = (text: string): Span[] => {
|
|
45
|
+
const matches = [...text.matchAll(SHORT_REPEAT)];
|
|
46
|
+
return matches.filter((match) => matches.filter((other) => other[0] === match[0]).length >= REPEATED_BLANKS).map(spanOf);
|
|
47
|
+
};
|
|
48
|
+
|
|
40
49
|
/** 文の中の、日付・時刻の書式とひな形の名前に置いた大文字の範囲。units は日付・時刻の単位の語。 */
|
|
41
50
|
export const placeholderSpans = (text: string, units: readonly string[]): Span[] => [
|
|
42
51
|
...joinedSpans(text),
|
|
43
52
|
...beforeUnitSpans(text, units),
|
|
44
53
|
...[...text.matchAll(LONG_REPEAT)].map(spanOf),
|
|
54
|
+
...repeatedBlankSpans(text),
|
|
45
55
|
];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Detector, Finding, MarkupHeading, Paragraph, ProseDocument } from "../plugin.ts";
|
|
2
|
+
import { isQuotedAt } from "./bold-label.ts";
|
|
3
|
+
import { findingAt, writtenHeadings } from "./markup-finding.ts";
|
|
4
|
+
|
|
5
|
+
// A paragraph that is one bold line, standing where a heading would (markdownlint MD036). Pure: reads the source and headings.
|
|
6
|
+
|
|
7
|
+
/** A paragraph that is only a bold run: `**Next steps**`, `__次の手順__`. The run holds no delimiter of its own. */
|
|
8
|
+
const BOLD_PARAGRAPH = /^(\*\*|__)(?!\s)((?:(?!\1)[^\n])+?)(?<!\s)\1$/u;
|
|
9
|
+
|
|
10
|
+
/** A link around the whole text: inline, reference, collapsed or shortcut. A bold link alone is a button, not a heading. */
|
|
11
|
+
const WHOLE_LINK = /^\[[^\]\n]+\](?:\([^)\s]*\)|\[[^\]\n]*\])?$/u;
|
|
12
|
+
|
|
13
|
+
/** Inline code around the whole text names a value, not a section. */
|
|
14
|
+
const WHOLE_CODE = /^`[^`]+`$/u;
|
|
15
|
+
|
|
16
|
+
/** Punctuation that ends a sentence, a clause or a lead-in, as markdownlint counts it: a heading does not end in it. */
|
|
17
|
+
const CLOSING_PUNCTUATION = /[.,;:!?。,;:!?、]$/u;
|
|
18
|
+
|
|
19
|
+
/** A colon inside the text makes it a field and its value (Rating: 4 out of 5), not a heading. */
|
|
20
|
+
const FIELD_COLON = /[::]/u;
|
|
21
|
+
|
|
22
|
+
/** Longer than this, a bold line is a sentence set in bold for emphasis, not the name of a section. */
|
|
23
|
+
const MAX_HEADING_CHARS = 80;
|
|
24
|
+
|
|
25
|
+
/** The bold line's words, or undefined when the paragraph is not one bold line that could name a section. */
|
|
26
|
+
export const pseudoHeadingText = (paragraph: string): string | undefined => {
|
|
27
|
+
const text = BOLD_PARAGRAPH.exec(paragraph.trim())?.[2]?.trim();
|
|
28
|
+
if (text === undefined || text.length > MAX_HEADING_CHARS) return undefined;
|
|
29
|
+
if (WHOLE_LINK.test(text) || WHOLE_CODE.test(text) || CLOSING_PUNCTUATION.test(text) || FIELD_COLON.test(text)) return undefined;
|
|
30
|
+
return text;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** The headings that build an outline: all of them but an opening title, the one level-1 heading a document starts with. */
|
|
34
|
+
const sectionHeadings = (headings: readonly MarkupHeading[]): readonly MarkupHeading[] => (headings[0]?.depth === 1 ? headings.slice(1) : headings);
|
|
35
|
+
|
|
36
|
+
/** Whether body text follows the paragraph before the next heading: a bold line over nothing, or over a heading, heads no section. */
|
|
37
|
+
const headsBody = (doc: ProseDocument, paragraph: Paragraph, headings: readonly MarkupHeading[]): boolean => {
|
|
38
|
+
const next = doc.source.slice(paragraph.span.end).search(/\S/u);
|
|
39
|
+
if (next === -1) return false;
|
|
40
|
+
const nextStart = paragraph.span.end + next;
|
|
41
|
+
return !headings.some((heading) => heading.start === nextStart);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A bold line standing alone, after the document has begun its outline with real headings: the writer marks sections with
|
|
46
|
+
* headings, and this one was set in bold instead, so a table of contents and a screen reader do not see it.
|
|
47
|
+
*/
|
|
48
|
+
export const pseudoHeading: Detector = (doc): Finding[] => {
|
|
49
|
+
const headings = writtenHeadings(doc);
|
|
50
|
+
const outline = sectionHeadings(headings);
|
|
51
|
+
const firstSection = outline[0];
|
|
52
|
+
if (firstSection === undefined) return [];
|
|
53
|
+
return doc.paragraphs.flatMap((paragraph) => {
|
|
54
|
+
if (paragraph.span.start < firstSection.start || isQuotedAt(doc.source, paragraph.span.start)) return [];
|
|
55
|
+
const text = pseudoHeadingText(doc.source.slice(paragraph.span.start, paragraph.span.end));
|
|
56
|
+
if (text === undefined || !headsBody(doc, paragraph, headings)) return [];
|
|
57
|
+
return [findingAt(doc, paragraph.span, { heading: text })];
|
|
58
|
+
});
|
|
59
|
+
};
|
|
@@ -3,12 +3,37 @@ import type { Sentence } from "../plugin.ts";
|
|
|
3
3
|
/** 見せる前後の字数。記号 1 つの指摘は、周りの言葉が無いとどこか分からない。 */
|
|
4
4
|
const QUOTE_REACH = 20;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
type LineSpan = { readonly start: number; readonly end: number };
|
|
7
|
+
|
|
8
|
+
const lineAt = (text: string, at: number): LineSpan => {
|
|
9
|
+
const end = text.indexOf("\n", at);
|
|
10
|
+
// lastIndexOf reads a negative position as 0, and would find a line break at the very start.
|
|
11
|
+
return { start: at <= 0 ? 0 : text.lastIndexOf("\n", at - 1) + 1, end: end === -1 ? text.length : end };
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const TABLE_ROW = /^[ \t]*\|/u;
|
|
15
|
+
|
|
16
|
+
const isTableRow = (text: string, line: LineSpan): boolean => TABLE_ROW.test(text.slice(line.start, line.end));
|
|
17
|
+
|
|
18
|
+
/** 表の行は一つの行で閉じた記録なので、引く範囲は表の行の境を越えない。from から下がって、表の行に入る手前の行の頭。 */
|
|
19
|
+
const reachBack = (text: string, line: LineSpan, from: number): number => {
|
|
20
|
+
if (from >= line.start || line.start === 0) return Math.max(from, line.start);
|
|
21
|
+
const previous = lineAt(text, line.start - 1);
|
|
22
|
+
return isTableRow(text, line) || isTableRow(text, previous) ? line.start : reachBack(text, previous, from);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const reachForward = (text: string, line: LineSpan, to: number): number => {
|
|
26
|
+
if (to <= line.end || line.end === text.length) return Math.min(to, line.end);
|
|
27
|
+
const next = lineAt(text, line.end + 1);
|
|
28
|
+
return isTableRow(text, line) || isTableRow(text, next) ? line.end : reachForward(text, next, to);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** text の start から end の前後を、空白をならして引く。表の行の指摘は、その行の中だけ(次の行の升まで続けない)。 */
|
|
32
|
+
export const quoteAround = (text: string, start: number, end: number = start + 1): string => {
|
|
33
|
+
const from = reachBack(text, lineAt(text, start), Math.max(0, start - QUOTE_REACH));
|
|
34
|
+
const to = reachForward(text, lineAt(text, Math.max(start, end - 1)), end + QUOTE_REACH);
|
|
35
|
+
return text.slice(from, to).replace(/\s+/gu, " ").trim();
|
|
36
|
+
};
|
|
12
37
|
|
|
13
38
|
/** The sentence holding offset, trimmed: a reader sees whole words, as for the rules that quote their sentence. undefined outside every sentence. */
|
|
14
39
|
export const sentenceQuoteAt = (sentences: readonly Sentence[], offset: number): string | undefined =>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// A label printed on a form or a screen, quoted as it is printed and named by the control it marks: the “VOID” box, the
|
|
2
|
+
// "SUBMIT" button, 「OK」ボタン. The capitals are the form's words, which the writer cannot change, so undefined-acronym counts
|
|
3
|
+
// them but does not ask to spell them out. Pure: the control nouns come from the language's lexicon control-noun.
|
|
4
|
+
import { oneOf } from "./acronym-name.ts";
|
|
5
|
+
|
|
6
|
+
type Span = { readonly start: number; readonly end: number };
|
|
7
|
+
|
|
8
|
+
const OPENING_QUOTES = `"“‘'「『`;
|
|
9
|
+
const CLOSING_QUOTES = `"”’'」』`;
|
|
10
|
+
|
|
11
|
+
/** The quoted capitals, right before a control noun; the quote marks may be followed by one space. */
|
|
12
|
+
const labelPattern = (nouns: readonly string[]): RegExp =>
|
|
13
|
+
new RegExp(String.raw`[${OPENING_QUOTES}](?<label>[A-Z][A-Z0-9]{1,15})[${CLOSING_QUOTES}][ \t]?${oneOf(nouns)}(?![\p{Ll}])`, "gu");
|
|
14
|
+
|
|
15
|
+
/** The spans of the quoted labels in the source, each the label without its quote marks. nouns: the control nouns. */
|
|
16
|
+
export const quotedLabelSpans = (source: string, nouns: readonly string[]): Span[] => {
|
|
17
|
+
if (nouns.length === 0) return [];
|
|
18
|
+
return [...source.matchAll(labelPattern(nouns))].map((match) => {
|
|
19
|
+
const start = match.index + 1;
|
|
20
|
+
return { start, end: start + (match.groups?.["label"]?.length ?? 0) };
|
|
21
|
+
});
|
|
22
|
+
};
|
package/src/detectors/ra-nuki.ts
CHANGED
|
@@ -1,38 +1,7 @@
|
|
|
1
|
-
import type { Detector,
|
|
2
|
-
import {
|
|
1
|
+
import type { Detector, Token } from "../plugin.ts";
|
|
2
|
+
import { markedWordDetector } from "./marked-word.ts";
|
|
3
3
|
|
|
4
4
|
/** 言語アダプタが、ら抜き言葉の一部の語に付ける印(lang-ja の PotentialRa=Dropped)。 */
|
|
5
5
|
const isRaDropped = (token: Token): boolean => token.features?.["PotentialRa"] === "Dropped";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
const markedRuns = (tokens: readonly Token[]): Span[] =>
|
|
9
|
-
tokens.reduce<Span[]>((runs, token, index) => {
|
|
10
|
-
if (!isRaDropped(token)) return runs;
|
|
11
|
-
const last = runs.at(-1);
|
|
12
|
-
const previous = tokens[index - 1];
|
|
13
|
-
if (last !== undefined && previous !== undefined && isRaDropped(previous)) return [...runs.slice(0, -1), { start: last.start, end: token.span.end }];
|
|
14
|
-
return [...runs, token.span];
|
|
15
|
-
}, []);
|
|
16
|
-
|
|
17
|
-
export type RaDroppedWord = { readonly written: string; readonly offset: number };
|
|
18
|
-
|
|
19
|
-
/** 文の中のら抜き言葉。鉤括弧や引用符で引いた言葉(話した言葉をそのまま引いたもの)は数えない。 */
|
|
20
|
-
export const raDroppedIn = (sentence: Sentence): RaDroppedWord[] => {
|
|
21
|
-
const quoted = quotedSpans(sentence.text, QUOTATION_MARKS);
|
|
22
|
-
return markedRuns(sentence.tokens ?? [])
|
|
23
|
-
.map((run) => ({ start: run.start - sentence.span.start, end: run.end - sentence.span.start }))
|
|
24
|
-
.filter((run) => !isWithinAny(quoted, run))
|
|
25
|
-
.map((run) => ({ written: sentence.text.slice(run.start, run.end), offset: sentence.span.start + run.start }));
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const raNuki: Detector = (doc): Finding[] =>
|
|
29
|
-
doc.sentences.flatMap((sentence) =>
|
|
30
|
-
raDroppedIn(sentence).map((word) => ({
|
|
31
|
-
rule: "",
|
|
32
|
-
severity: "warning",
|
|
33
|
-
line: 0,
|
|
34
|
-
column: 0,
|
|
35
|
-
quote: sentence.text.trim(),
|
|
36
|
-
values: { matched: word.written, offset: word.offset },
|
|
37
|
-
})),
|
|
38
|
-
);
|
|
7
|
+
export const raNuki: Detector = markedWordDetector(isRaDropped);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { endingTokens } from "../sentence-shape.ts";
|
|
2
|
+
import type { LexiconEntry, OptionValue, Section, Sentence } from "../plugin.ts";
|
|
3
|
+
import { registerOf, type Register } from "./register.ts";
|
|
4
|
+
|
|
5
|
+
/** Where a sentence stands: the body text, a list (or a run of numbered paragraphs), or a heading. */
|
|
6
|
+
export type Region = "body" | "list" | "heading";
|
|
7
|
+
|
|
8
|
+
/** The register a team requires in each region, from chaff.yaml. A region left out is checked for consistency only. */
|
|
9
|
+
export type RequiredRegisters = Readonly<Partial<Record<Region, Register>>>;
|
|
10
|
+
|
|
11
|
+
const REGIONS: readonly Region[] = ["body", "list", "heading"];
|
|
12
|
+
|
|
13
|
+
/** The option values a team writes, and the register each names. `consistent` (the default) requires none. */
|
|
14
|
+
const BY_NAME: Readonly<Record<string, Register>> = { desumasu: "polite", dearu: "plain" };
|
|
15
|
+
|
|
16
|
+
/** Pure: the registers required by the rule's settings (`body: desumasu`, `list: dearu`), each only where written. */
|
|
17
|
+
export const requiredOf = (settings: Readonly<Record<string, OptionValue>> | undefined): RequiredRegisters =>
|
|
18
|
+
Object.fromEntries(
|
|
19
|
+
REGIONS.flatMap((region) => {
|
|
20
|
+
const value = settings?.[region];
|
|
21
|
+
const register = typeof value === "string" ? BY_NAME[value] : undefined;
|
|
22
|
+
return register === undefined ? [] : [[region, register]];
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const requiresAny = (required: RequiredRegisters): boolean => Object.keys(required).length > 0;
|
|
27
|
+
|
|
28
|
+
/** A sentence's region by the group it was counted in: no group is the body. */
|
|
29
|
+
export const regionOfGroup = (group: number | undefined): Region => (group === undefined ? "body" : "list");
|
|
30
|
+
|
|
31
|
+
type Judged = { readonly register: Register; readonly group: number | undefined; readonly quiet: boolean };
|
|
32
|
+
|
|
33
|
+
/** Pure: the judged sentences whose register is not the one their region requires. A quiet form is never one of them. */
|
|
34
|
+
export const offRequired = <T extends Judged>(judged: readonly T[], required: RequiredRegisters): T[] =>
|
|
35
|
+
judged.filter((entry) => {
|
|
36
|
+
const wanted = required[regionOfGroup(entry.group)];
|
|
37
|
+
return wanted !== undefined && !entry.quiet && entry.register !== wanted;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/** A heading read like a sentence, so its ending is judged the way a sentence's is. */
|
|
41
|
+
const headingSentence = (section: Section): Sentence => ({ span: section.span, text: section.heading, tokens: section.headingTokens ?? [] });
|
|
42
|
+
|
|
43
|
+
/** A heading and the register its ending has. Most headings end in a noun and have none. */
|
|
44
|
+
export type HeadingRead = { readonly section: Section; readonly register: Register };
|
|
45
|
+
|
|
46
|
+
/** Pure: the headings (not the part before the first one) whose ending has a register, and that register. */
|
|
47
|
+
export const headingRegisters = (sections: readonly Section[], polite: readonly LexiconEntry[], neutral: readonly LexiconEntry[]): HeadingRead[] =>
|
|
48
|
+
sections.flatMap((section) => {
|
|
49
|
+
if (section.depth === 0) return [];
|
|
50
|
+
const sentence = headingSentence(section);
|
|
51
|
+
const ending = endingTokens(sentence);
|
|
52
|
+
const tokens = sentence.tokens ?? [];
|
|
53
|
+
const head = ending[0] === undefined ? -1 : tokens.indexOf(ending[0]);
|
|
54
|
+
const register = registerOf(ending, head > 0 ? tokens.slice(0, head) : [], polite, neutral);
|
|
55
|
+
return register === undefined ? [] : [{ section, register }];
|
|
56
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LexiconEntry, Sentence, Token } from "../plugin.ts";
|
|
1
|
+
import type { LexiconEntry, Section, Sentence, Token } from "../plugin.ts";
|
|
2
2
|
|
|
3
3
|
// Sentence shapes whose register is a deliberate voice, not a slip: counted, never pointed at. Pure.
|
|
4
4
|
|
|
@@ -16,6 +16,25 @@ export const endsInSetGreeting = (sentence: Sentence, phrases: readonly LexiconE
|
|
|
16
16
|
return phrases.some((phrase) => text.endsWith(phrase.pattern));
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
const isPagePointer = (sentence: Sentence, words: readonly LexiconEntry[]): boolean => {
|
|
20
|
+
const text = withoutTrailingMarks(sentence.text);
|
|
21
|
+
const of = (group: string): LexiconEntry[] => words.filter((word) => word.group === group);
|
|
22
|
+
return of("ending").some((ending) => text.endsWith(ending.pattern)) && of("word").some((word) => text.includes(word.pattern));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A polite pointer the page sets for its reader under a heading of its own (## 概要 / 本検討会の概要は、…をご覧ください。): the only
|
|
27
|
+
* sentence of its section, ending in a phrase from the ending group of page-pointer and holding a word from its word group. A plain
|
|
28
|
+
* page points its reader elsewhere so too; the same pointer inside the text's own paragraphs is still a slip.
|
|
29
|
+
*/
|
|
30
|
+
export const pagePointerSentences = (sections: readonly Section[], words: readonly LexiconEntry[]): Set<Sentence> =>
|
|
31
|
+
new Set(
|
|
32
|
+
sections.flatMap((section) => {
|
|
33
|
+
const [only] = section.sentences;
|
|
34
|
+
return section.sentences.length === 1 && only !== undefined && isPagePointer(only, words) ? [only] : [];
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
|
|
19
38
|
const PAST = new Set(["た", "だ"]);
|
|
20
39
|
|
|
21
40
|
const hasParticle = (tokens: readonly Token[], particles: readonly LexiconEntry[]): boolean =>
|
|
@@ -89,6 +108,22 @@ export const isAddressed = (sentence: Sentence, particles: readonly LexiconEntry
|
|
|
89
108
|
return closing !== "" && particles.some((particle) => closing.endsWith(particle.pattern));
|
|
90
109
|
};
|
|
91
110
|
|
|
111
|
+
/** A joiner from the list followed straight by a comma (止まるし、). */
|
|
112
|
+
const joinsWith = (tokens: readonly Token[], joiners: ReadonlySet<string>): boolean =>
|
|
113
|
+
tokens.some((token, index) => token.pos === "SCONJ" && joiners.has(token.surface) && tokens[index + 1]?.surface === "、");
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* A writer's aside of feeling (ここまでは、まだよかった。動画は止まるし、…と言われる。): the sentence ends on a word of a class from the
|
|
117
|
+
* word-class group of feeling-aside (but not a word of the not-feeling group, 制限なし。), or joins its clauses with a joiner from the
|
|
118
|
+
* joiner group. marks is that word list already narrowed to the document's genre; outside its genres nothing holds.
|
|
119
|
+
*/
|
|
120
|
+
export const isFeelingAside = (sentence: Sentence, ending: readonly Token[], marks: readonly LexiconEntry[]): boolean => {
|
|
121
|
+
const of = (group: string): Set<string> => new Set(marks.filter((mark) => mark.group === group).map((mark) => mark.pattern));
|
|
122
|
+
const head = ending[0];
|
|
123
|
+
const feels = head !== undefined && of("word-class").has(head.pos ?? "") && !of("not-feeling").has(head.surface);
|
|
124
|
+
return feels || joinsWith(sentence.tokens ?? [], of("joiner"));
|
|
125
|
+
};
|
|
126
|
+
|
|
92
127
|
const EXCLAMATION = /[!!][\s」』))]*$/u;
|
|
93
128
|
|
|
94
129
|
/** A sentence closed by an exclamation mark (わかるかっ!!!): a cry in the writer's voice, said plainly in either register. */
|
|
@@ -44,11 +44,23 @@ const verbAfter = (tokens: readonly Token[], at: number): number => {
|
|
|
44
44
|
return next;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
/** 決まった言い方を照らす、which / that の後ろの語数。語彙表の最も長い言い方より長く取る。 */
|
|
48
|
+
const FORMULA_REACH = 8;
|
|
49
|
+
|
|
50
|
+
/** 後ろの語が語彙表 aside-relative-formula の決まった言い方で始まる(consent which will not be unreasonably withheld)。前の語に条件を添える節で、限定ではない。 */
|
|
51
|
+
const opensFormula = (tokens: readonly Token[], at: number, formulas: Lexicon): boolean => {
|
|
52
|
+
const after = tokens
|
|
53
|
+
.slice(at + 1, at + 1 + FORMULA_REACH)
|
|
54
|
+
.map((token) => token.surface.toLowerCase())
|
|
55
|
+
.join(" ");
|
|
56
|
+
return formulas.some((formula) => formula.pattern !== "" && `${after} `.startsWith(`${formula.pattern.toLowerCase()} `));
|
|
57
|
+
};
|
|
58
|
+
|
|
47
59
|
/** 語彙表の組(which / that)で、tokens の中の限定の関係節の頭。 */
|
|
48
|
-
export const relativeUses = (tokens: readonly Token[], kinds: Lexicon): RelativeUse[] =>
|
|
60
|
+
export const relativeUses = (tokens: readonly Token[], kinds: Lexicon, formulas: Lexicon = []): RelativeUse[] =>
|
|
49
61
|
tokens.flatMap((word, at) => {
|
|
50
62
|
const entry = kinds.find((candidate) => candidate.pattern.toLowerCase() === word.surface.toLowerCase());
|
|
51
|
-
if (entry?.group === undefined) return [];
|
|
63
|
+
if (entry?.group === undefined || opensFormula(tokens, at, formulas)) return [];
|
|
52
64
|
const verb = verbAfter(tokens, at);
|
|
53
65
|
if (!opensRelative(tokens[at - 1], tokens[verb], tokens[verb + 1])) return [];
|
|
54
66
|
return [{ word, kind: entry.group }];
|
|
@@ -66,6 +78,7 @@ export const oddRelatives = (uses: readonly RelativeUse[], limit: number): { rea
|
|
|
66
78
|
|
|
67
79
|
export const relativePronounMix: Detector = (doc, options): Finding[] => {
|
|
68
80
|
const kinds = doc.lexicons["restrictive-relative"] ?? [];
|
|
81
|
+
const formulas = doc.lexicons["aside-relative-formula"] ?? [];
|
|
69
82
|
// A block quotation of another text (an earlier opinion) keeps that text's wording, so it does not vote.
|
|
70
83
|
const quotations = quotationParagraphIndexes(
|
|
71
84
|
doc.source,
|
|
@@ -77,7 +90,9 @@ export const relativePronounMix: Detector = (doc, options): Finding[] => {
|
|
|
77
90
|
const uses = doc.sentences.flatMap((sentence) => {
|
|
78
91
|
if (sentence.embeddedLanguage !== undefined || blockQuoted.has(sentence)) return [];
|
|
79
92
|
const quoted = quotedIn(sentence, QUOTATION_MARKS);
|
|
80
|
-
return relativeUses(sentence.tokens ?? [], kinds).filter(
|
|
93
|
+
return relativeUses(sentence.tokens ?? [], kinds, formulas).filter(
|
|
94
|
+
(use) => !isWithinAny(quoted, use.word.span) && !isWithinAny(singleQuoted, use.word.span),
|
|
95
|
+
);
|
|
81
96
|
});
|
|
82
97
|
const { odd, usual } = oddRelatives(uses, options.limit);
|
|
83
98
|
return odd.map((use) => ({
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// A changelog's release notes: the sections of its release list, where a generated changelog opens each entry with its
|
|
2
|
+
// commit scope in bold (* **deps:** update all dependencies). Pure: reads the document's source, headings and code fences.
|
|
3
|
+
import type { ProseDocument, Span } from "../plugin.ts";
|
|
4
|
+
import { codeFences } from "./code-fences.ts";
|
|
5
|
+
import { releasesOf } from "../structure/release-list.ts";
|
|
6
|
+
|
|
7
|
+
/** The sections of the releases the document lists under version headings or items. */
|
|
8
|
+
export const releaseSpansOf = (doc: ProseDocument): Span[] =>
|
|
9
|
+
releasesOf(doc.source, doc.markup?.headings ?? [], codeFences(doc.source)).map(({ start, end }) => ({ start, end }));
|
|
10
|
+
|
|
11
|
+
export const inRelease = (releases: readonly Span[], offset: number): boolean => releases.some((release) => offset >= release.start && offset < release.end);
|
|
12
|
+
|
|
13
|
+
const LIST_MARKER = /^[ \t]*(?:[-*+]|\d{1,3}[.)])[ \t]+$/u;
|
|
14
|
+
|
|
15
|
+
/** Whether the bold run at `span` opens a list item inside a release's notes: the entry's scope label (**deps:**). */
|
|
16
|
+
export const isReleaseScopeLabel = (source: string, releases: readonly Span[], span: Span): boolean => {
|
|
17
|
+
const lineStart = source.lastIndexOf("\n", span.start - 1) + 1;
|
|
18
|
+
return LIST_MARKER.test(source.slice(lineStart, span.start)) && inRelease(releases, span.start);
|
|
19
|
+
};
|