chaffjs 0.50.0 → 0.52.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/clause-particles.d.ts +10 -2
- package/dist/clause-particles.d.ts.map +1 -1
- package/dist/clause-particles.js +15 -3
- package/dist/clause-particles.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/address-blank.d.ts +14 -0
- package/dist/detectors/address-blank.d.ts.map +1 -0
- package/dist/detectors/address-blank.js +41 -0
- package/dist/detectors/address-blank.js.map +1 -0
- 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-emphasis-form.d.ts +1 -0
- package/dist/detectors/bold-emphasis-form.d.ts.map +1 -1
- package/dist/detectors/bold-emphasis-form.js +7 -1
- package/dist/detectors/bold-emphasis-form.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 +15 -21
- 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/closing-cliche.d.ts +1 -1
- package/dist/detectors/closing-cliche.d.ts.map +1 -1
- package/dist/detectors/closing-cliche.js +16 -3
- package/dist/detectors/closing-cliche.js.map +1 -1
- package/dist/detectors/contraction-mix.d.ts.map +1 -1
- package/dist/detectors/contraction-mix.js +6 -3
- 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/currency-notation.d.ts.map +1 -1
- package/dist/detectors/currency-notation.js +9 -1
- package/dist/detectors/currency-notation.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 +8 -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 +27 -2
- 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/gram-ending.d.ts +12 -0
- package/dist/detectors/gram-ending.d.ts.map +1 -0
- package/dist/detectors/gram-ending.js +27 -0
- package/dist/detectors/gram-ending.js.map +1 -0
- package/dist/detectors/gram-repetition.d.ts.map +1 -1
- package/dist/detectors/gram-repetition.js +19 -3
- package/dist/detectors/gram-repetition.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 +79 -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/kanji-run-pieces.d.ts +21 -6
- package/dist/detectors/kanji-run-pieces.d.ts.map +1 -1
- package/dist/detectors/kanji-run-pieces.js +23 -8
- package/dist/detectors/kanji-run-pieces.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-own.d.ts +11 -0
- package/dist/detectors/list-item-own.d.ts.map +1 -0
- package/dist/detectors/list-item-own.js +31 -0
- package/dist/detectors/list-item-own.js.map +1 -0
- package/dist/detectors/list-item-phrase.d.ts +1 -1
- package/dist/detectors/list-item-phrase.d.ts.map +1 -1
- package/dist/detectors/list-item-phrase.js +18 -7
- package/dist/detectors/list-item-phrase.js.map +1 -1
- 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-joint.d.ts +6 -0
- package/dist/detectors/list-joint.d.ts.map +1 -1
- package/dist/detectors/list-joint.js +18 -2
- package/dist/detectors/list-joint.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 +3 -8
- package/dist/detectors/list-parallel.d.ts.map +1 -1
- package/dist/detectors/list-parallel.js +29 -46
- 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/open-end-scope.d.ts.map +1 -1
- package/dist/detectors/open-end-scope.js +2 -2
- package/dist/detectors/open-end-scope.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 +16 -4
- 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 +11 -0
- package/dist/detectors/pseudo-heading.d.ts.map +1 -0
- package/dist/detectors/pseudo-heading.js +115 -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-label-note.d.ts +8 -0
- package/dist/detectors/register-label-note.d.ts.map +1 -0
- package/dist/detectors/register-label-note.js +31 -0
- package/dist/detectors/register-label-note.js.map +1 -0
- 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/run-in-title.d.ts +6 -0
- package/dist/detectors/run-in-title.d.ts.map +1 -0
- package/dist/detectors/run-in-title.js +32 -0
- package/dist/detectors/run-in-title.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 +40 -12
- 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 +23 -4
- 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 +41 -9
- 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 +8 -4
- 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/unfilled-placeholder.d.ts.map +1 -1
- package/dist/detectors/unfilled-placeholder.js +11 -1
- package/dist/detectors/unfilled-placeholder.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/definition-use.d.ts +5 -3
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +10 -2
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure/forward-reference.d.ts +8 -0
- package/dist/structure/forward-reference.d.ts.map +1 -0
- package/dist/structure/forward-reference.js +18 -0
- package/dist/structure/forward-reference.js.map +1 -0
- 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 +103 -21
- 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-emphasis.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/closing-cliche.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/expletive-construction.yaml +2 -2
- 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/internal-jargon.yaml +1 -0
- 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 +8 -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/ngram-repetition.yaml +2 -2
- 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/preferred-term.yaml +1 -0
- 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/step-statement-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/clause-particles.ts +19 -3
- 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/address-blank.ts +49 -0
- package/src/detectors/bare-comparative.ts +35 -3
- package/src/detectors/blank-structure.ts +18 -9
- package/src/detectors/bold-emphasis-form.ts +10 -1
- 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 +19 -24
- package/src/detectors/clause-shape.ts +8 -4
- package/src/detectors/closing-cliche.ts +19 -2
- package/src/detectors/contraction-mix.ts +11 -3
- 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/currency-notation.ts +17 -6
- 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 +8 -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 +31 -2
- 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/gram-ending.ts +40 -0
- package/src/detectors/gram-repetition.ts +28 -4
- 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 +113 -0
- package/src/detectors/kanji-name-edge.ts +11 -0
- package/src/detectors/kanji-run-pieces.ts +35 -8
- 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-own.ts +38 -0
- package/src/detectors/list-item-phrase.ts +20 -8
- package/src/detectors/list-item.ts +7 -0
- package/src/detectors/list-items.ts +13 -2
- package/src/detectors/list-joint.ts +31 -2
- package/src/detectors/list-opening-conjunction.ts +22 -0
- package/src/detectors/list-parallel.ts +36 -53
- 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/open-end-scope.ts +3 -2
- 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 +16 -3
- 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 +131 -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-label-note.ts +37 -0
- 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/run-in-title.ts +35 -0
- package/src/detectors/sa-ire.ts +7 -0
- package/src/detectors/sentence-counts.ts +28 -9
- package/src/detectors/sentence-ending.ts +58 -13
- package/src/detectors/sentence-length.ts +34 -7
- 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 +58 -9
- package/src/detectors/term-consistency.ts +41 -0
- package/src/detectors/term-form.ts +17 -0
- package/src/detectors/token-shape.ts +8 -4
- package/src/detectors/unbalanced-bracket.ts +4 -2
- package/src/detectors/unfilled-placeholder.ts +13 -1
- 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/definition-use.ts +13 -3
- package/src/structure/forward-reference.ts +21 -0
- 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 +120 -22
- package/src/unclosed-code-quote.ts +42 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ScopeSelector, Span, TextScope } from "./plugin.ts";
|
|
2
|
+
|
|
3
|
+
// scope: in chaff.yaml (custom_rules and prefer): which parts of a document a team's rule reads. Pure.
|
|
4
|
+
// Positives choose where (none written: every part); negatives (~quote) then take parts away.
|
|
5
|
+
|
|
6
|
+
export const TEXT_SCOPES: readonly TextScope[] = ["heading", "list", "table", "quote", "paragraph"];
|
|
7
|
+
|
|
8
|
+
const NEGATION = "~";
|
|
9
|
+
|
|
10
|
+
/** not-a-list: neither a name nor a list of names. unknown: a name that is not a scope. empty: it leaves no text to read. */
|
|
11
|
+
export type ScopeProblem =
|
|
12
|
+
| { readonly kind: "not-a-list"; readonly written: string }
|
|
13
|
+
| { readonly kind: "unknown"; readonly written: string }
|
|
14
|
+
| { readonly kind: "empty"; readonly written: string };
|
|
15
|
+
|
|
16
|
+
export type ScopeRead = { readonly selector: ScopeSelector } | { readonly problem: ScopeProblem };
|
|
17
|
+
|
|
18
|
+
const printed = (value: unknown): string => JSON.stringify(value) ?? String(value);
|
|
19
|
+
|
|
20
|
+
const scopeNamed = (name: string): TextScope | undefined => TEXT_SCOPES.find((scope) => scope === name);
|
|
21
|
+
|
|
22
|
+
type Term = { readonly scope: TextScope; readonly negated: boolean };
|
|
23
|
+
|
|
24
|
+
const termOf = (written: string): Term | undefined => {
|
|
25
|
+
const trimmed = written.trim();
|
|
26
|
+
const negated = trimmed.startsWith(NEGATION);
|
|
27
|
+
const scope = scopeNamed(negated ? trimmed.slice(NEGATION.length).trim() : trimmed);
|
|
28
|
+
return scope === undefined ? undefined : { scope, negated };
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const unique = (scopes: readonly TextScope[]): TextScope[] => TEXT_SCOPES.filter((scope) => scopes.includes(scope));
|
|
32
|
+
|
|
33
|
+
/** A selector that no passage can meet: every part it chooses is also taken away. */
|
|
34
|
+
const selectsNothing = (selector: ScopeSelector): boolean => {
|
|
35
|
+
const chosen = selector.include.length === 0 ? TEXT_SCOPES : selector.include;
|
|
36
|
+
return chosen.every((scope) => selector.exclude.includes(scope));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** scope as written: one name or a list of names, each optionally negated with a leading ~. */
|
|
40
|
+
export const scopeSelectorOf = (raw: unknown): ScopeRead => {
|
|
41
|
+
const list: readonly unknown[] = Array.isArray(raw) ? raw : [raw];
|
|
42
|
+
if (list.length === 0) return { problem: { kind: "empty", written: printed(raw) } };
|
|
43
|
+
if (!list.every((entry) => typeof entry === "string")) return { problem: { kind: "not-a-list", written: printed(raw) } };
|
|
44
|
+
const names = list.filter((entry): entry is string => typeof entry === "string");
|
|
45
|
+
const unknown = names.find((name) => termOf(name) === undefined);
|
|
46
|
+
if (unknown !== undefined) return { problem: { kind: "unknown", written: unknown } };
|
|
47
|
+
const terms = names.flatMap((name) => termOf(name) ?? []);
|
|
48
|
+
const selector: ScopeSelector = {
|
|
49
|
+
include: unique(terms.filter((term) => !term.negated).map((term) => term.scope)),
|
|
50
|
+
exclude: unique(terms.filter((term) => term.negated).map((term) => term.scope)),
|
|
51
|
+
};
|
|
52
|
+
return selectsNothing(selector) ? { problem: { kind: "empty", written: printed(raw) } } : { selector };
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** Whether a passage in these parts is read: in a chosen part (or any part, when none is chosen) and in no part taken away. */
|
|
56
|
+
export const inScope = (selector: ScopeSelector, scopes: readonly TextScope[]): boolean =>
|
|
57
|
+
(selector.include.length === 0 ? scopes.length > 0 : selector.include.some((scope) => scopes.includes(scope))) &&
|
|
58
|
+
!selector.exclude.some((scope) => scopes.includes(scope));
|
|
59
|
+
|
|
60
|
+
/** The selector as chaff.yaml writes it, for messages and explain: [list, ~quote]. */
|
|
61
|
+
export const writtenScope = (selector: ScopeSelector): string => {
|
|
62
|
+
const names = [...selector.include, ...selector.exclude.map((scope) => NEGATION + scope)];
|
|
63
|
+
return `[${names.join(", ")}]`;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** Where the list items and the quotations of a document are. */
|
|
67
|
+
export type ScopeRegions = { readonly list: readonly Span[]; readonly quote: readonly Span[] };
|
|
68
|
+
|
|
69
|
+
const startsIn = (span: Span, regions: readonly Span[]): boolean => regions.some((region) => span.start >= region.start && span.start < region.end);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The parts a passage starting at span is in. own is what the passage itself is (a heading, a table cell); a list item
|
|
73
|
+
* and a quotation are found around it. A passage in none of these is paragraph.
|
|
74
|
+
*/
|
|
75
|
+
export const scopesOf = (span: Span, regions: ScopeRegions, own?: "heading" | "table"): TextScope[] => {
|
|
76
|
+
const around: Readonly<Partial<Record<TextScope, readonly Span[]>>> = { list: regions.list, quote: regions.quote };
|
|
77
|
+
const found = TEXT_SCOPES.filter((scope) => scope === own || startsIn(span, around[scope] ?? []));
|
|
78
|
+
return found.length === 0 ? ["paragraph"] : found;
|
|
79
|
+
};
|
package/src/topic-clause.ts
CHANGED
|
@@ -113,19 +113,91 @@ const closesFirstClauseWithNoun = (tokens: readonly Token[], topic: number, at:
|
|
|
113
113
|
!tokens.slice(topic + 1, at).some(isComma) &&
|
|
114
114
|
newTopicAfter(tokens, at + 1, last);
|
|
115
115
|
|
|
116
|
+
/** 〜の積上げであり、: the copula's continuing あり after で, and a comma. */
|
|
117
|
+
const isCopulaContinuing = (tokens: readonly Token[], at: number): boolean =>
|
|
118
|
+
tokens[at]?.surface === "あり" && tokens[at]?.lemma === "ある" && tokens[at - 1]?.surface === "で" && isCopula(tokens[at - 1]) && isComma(tokens[at + 1]);
|
|
119
|
+
|
|
120
|
+
/** The sentence ends on a copula (〜ものではありません, 〜ということです) or on ある after が (〜する必要があります). */
|
|
121
|
+
const endsOnCopulaOrBeing = (tokens: readonly Token[], last: number): boolean => {
|
|
122
|
+
const head = beforeTail(tokens, last);
|
|
123
|
+
const token = tokens[head];
|
|
124
|
+
return isCopula(token) || (token !== undefined && isParticle(token, "が") && tokens[head + 1]?.lemma === "ある");
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/** A が on a noun, a nominaliser too (感染するものが増えている), past at and past the last comma: the final predicate's subject. */
|
|
128
|
+
const finalGaAfter = (tokens: readonly Token[], at: number, last: number): boolean => {
|
|
129
|
+
const lastComma = tokens.findLastIndex((token, index) => index < last && isComma(token));
|
|
130
|
+
return tokens.some((token, index) => index > Math.max(at, lastComma) && index < last && isParticle(token, "が") && NOMINAL.has(tokens[index - 1]?.pos ?? ""));
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/** The sentence ends on a noun and a copula, and a が straight before the noun is its subject (〜を図ることが必要である), past at. */
|
|
134
|
+
const predicateNounTakesGa = (tokens: readonly Token[], at: number, last: number): boolean => {
|
|
135
|
+
const copula = beforeTail(tokens, last);
|
|
136
|
+
const ga = tokens[copula - 2];
|
|
137
|
+
return (
|
|
138
|
+
copula - 2 > at &&
|
|
139
|
+
isCopula(tokens[copula]) &&
|
|
140
|
+
isOwnNoun(tokens[copula - 1]) &&
|
|
141
|
+
ga !== undefined &&
|
|
142
|
+
isParticle(ga, "が") &&
|
|
143
|
+
NOMINAL.has(tokens[copula - 3]?.pos ?? "")
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 収益は、…の積上げであり、…ストック型が主要を占めております: the copula's continuing form closes the topic's clause when a new
|
|
149
|
+
* topic follows, or a subject of its own (が, a clause made a noun too: 〜することが求められている) whose predicate is not again a
|
|
150
|
+
* copula or ある, or the subject of the final copula's noun (〜を図ることが必要である). 信頼型は、…ものであり、…ものではありません
|
|
151
|
+
* and これは…リンクであり、ユーザーが…ということです say two things of the same topic. With another topic between the topic and it
|
|
152
|
+
* (復興は、…進んでいる一方で、…状況は様々であり、), the copula is that topic's, not the first one's. A が there (〜ことは、パレスチナが
|
|
153
|
+
* …共存することであり、) is inside a clause the topic's own predicate takes, and does not count.
|
|
154
|
+
*/
|
|
155
|
+
const closesWithCopulaContinuing = (tokens: readonly Token[], topic: number, at: number, last: number, subject: number): boolean =>
|
|
156
|
+
isCopulaContinuing(tokens, at) &&
|
|
157
|
+
!newTopicAfter(tokens, topic, at) &&
|
|
158
|
+
(newTopicAfter(tokens, at + 1, last) ||
|
|
159
|
+
((subject > at || finalGaAfter(tokens, at, last)) && !endsOnCopulaOrBeing(tokens, last)) ||
|
|
160
|
+
predicateNounTakesGa(tokens, at, last));
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* 〜する想定のため: a clause, a noun it ends on, and の before ため, the copula's attributive form (想定であるため). A bare noun
|
|
164
|
+
* before のため (安全管理のため) is more often a purpose, which the topic's own predicate still follows.
|
|
165
|
+
*/
|
|
166
|
+
const clauseNounBeforeTame = (tokens: readonly Token[], at: number): boolean => {
|
|
167
|
+
const before = tokens[at - 1];
|
|
168
|
+
const clauseEnd = tokens[at - 3];
|
|
169
|
+
const endsClause = clauseEnd?.pos === "VERB" || (clauseEnd?.pos === "AUX" && clauseEnd.lemma !== "だ");
|
|
170
|
+
return before !== undefined && isParticle(before, "の") && isOwnNoun(tokens[at - 2]) && endsClause;
|
|
171
|
+
};
|
|
172
|
+
|
|
116
173
|
/**
|
|
117
174
|
* A clause that may close the topic's predicate, when a new subject follows, each stopped by a comma: a copula after ない or
|
|
118
|
-
* ため (〜ではなく、,
|
|
119
|
-
* (〜を続けており、).
|
|
175
|
+
* ため (〜ではなく、, 〜であるため、, 〜の想定のため、), a copula's condition (〜であるならば、), ところ (〜にあるところ、), and a
|
|
176
|
+
* continuing verb (〜を続けており、).
|
|
120
177
|
*/
|
|
121
178
|
const closesIfNewSubject = (tokens: readonly Token[], at: number): boolean => {
|
|
122
179
|
const token = tokens[at];
|
|
123
180
|
if (!isComma(tokens[at + 1])) return false;
|
|
124
|
-
if (token?.surface === "ため"
|
|
181
|
+
if (token?.surface === "ため") return copulaBefore(tokens, at) || clauseNounBeforeTame(tokens, at);
|
|
182
|
+
if (token?.lemma === "ない") return copulaBefore(tokens, at);
|
|
125
183
|
if (closesWithTokoro(tokens, at) || closesWithCondition(tokens, at)) return true;
|
|
126
184
|
return token?.pos === "VERB" && token.lemma === "おる" && token.features?.["Bound"] === "Yes";
|
|
127
185
|
};
|
|
128
186
|
|
|
187
|
+
/** Verbs of receiving a favour (〜していただく, 〜してもらう): their doer is the one asked, not the speaker. */
|
|
188
|
+
const BENEFACTIVE = new Set(["いただく", "いただける", "くださる", "もらう", "もらえる"]);
|
|
189
|
+
|
|
190
|
+
/** The forms that make a favour a request or a hope: 〜いただけると, 〜いただければ, 〜いただきたい. The tagger reads と as either. */
|
|
191
|
+
const isRequestForm = (token: Token | undefined): boolean =>
|
|
192
|
+
((token?.pos === "SCONJ" || token?.pos === "ADP") && (token.surface === "と" || token.surface === "ば")) || (token?.pos === "AUX" && token.lemma === "たい");
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* 〜を示していただけると…つながるのではないか: past at, the speaker asks for a favour. What follows is the speaker's request, so a
|
|
196
|
+
* clause that may close the topic's predicate does close it, though no subject of its own is spelt out.
|
|
197
|
+
*/
|
|
198
|
+
const requestAfter = (tokens: readonly Token[], at: number, last: number): boolean =>
|
|
199
|
+
tokens.some((token, index) => index > at && index < last && BENEFACTIVE.has(token.lemma ?? "") && isRequestForm(tokens[index + 1]));
|
|
200
|
+
|
|
129
201
|
/** The words a document's language gives for the shapes below (lang-ja's lexicons). Without them, only the shapes that need none. */
|
|
130
202
|
export type TopicClauseWords = {
|
|
131
203
|
/** Words that end a clause right after its predicate (ことから, つつ, としても): the topic-clause-close lexicon. */
|
|
@@ -161,26 +233,46 @@ const endsPolite = (tokens: readonly Token[], at: number, tail: readonly string[
|
|
|
161
233
|
isPoliteMasu(tokens[at - tail.length - 1]) &&
|
|
162
234
|
tail.every((surface, index) => tokens[at - tail.length + index]?.pos === "AUX" && tokens[at - tail.length + index]?.surface === surface);
|
|
163
235
|
|
|
164
|
-
/**
|
|
236
|
+
/** The polite copula, past or not, just before at: ほとんどですが, ほとんどでしたが. */
|
|
237
|
+
const endsPoliteCopula = (tokens: readonly Token[], at: number): boolean => {
|
|
238
|
+
const end = tokens[at - 1]?.surface === "た" && tokens[at - 1]?.pos === "AUX" ? at - 1 : at;
|
|
239
|
+
const copula = tokens[end - 1];
|
|
240
|
+
return copula?.pos === "AUX" && copula.lemma === "です";
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
/** 〜ておりますが / 〜しましたが / 〜できませんでしたが / 〜でしたが: a polite predicate and the contrastive が. */
|
|
165
244
|
const isPoliteGa = (tokens: readonly Token[], at: number): boolean => {
|
|
166
245
|
if (tokens[at]?.surface !== "が" || tokens[at]?.pos !== "SCONJ") return false;
|
|
167
|
-
return POLITE_TAILS.some((tail) => endsPolite(tokens, at, tail));
|
|
246
|
+
return POLITE_TAILS.some((tail) => endsPolite(tokens, at, tail)) || endsPoliteCopula(tokens, at);
|
|
168
247
|
};
|
|
169
248
|
|
|
170
|
-
|
|
171
|
-
|
|
249
|
+
/** A topic on a noun that sets the time or the case (普及以前は, 決定後は): it frames a clause, not the whole sentence. */
|
|
250
|
+
const isSettingTopic = (tokens: readonly Token[], topic: number): boolean => tokens[topic - 1]?.features?.["Adverbial"] === "Yes";
|
|
251
|
+
|
|
252
|
+
/** A new topic on a noun after at, before the last word, bare or on に or で (プログラムには, 国内では). */
|
|
253
|
+
const frameTopicAfter = (tokens: readonly Token[], at: number, last: number): boolean =>
|
|
254
|
+
tokens.some((token, index) => {
|
|
255
|
+
if (index <= at || index >= last || !isParticle(token, "は")) return false;
|
|
256
|
+
const head = tokens[index - 1]?.surface === "に" || tokens[index - 1]?.surface === "で" ? index - 2 : index - 1;
|
|
257
|
+
return isOwnNoun(tokens[head]);
|
|
258
|
+
});
|
|
172
259
|
|
|
173
260
|
/** A word of a name (赤澤, 大臣), not a noun that sets the time or the case (今後, 当日). */
|
|
174
261
|
const isNameWord = (token: Token): boolean => NOMINAL.has(token.pos) && token.features?.["Adverbial"] !== "Yes";
|
|
175
262
|
|
|
263
|
+
/** A prefix bound to the noun after it (本事業, 同社, 各部): the tagger reads it as a bound adjective. */
|
|
264
|
+
const isNounPrefix = (token: Token | undefined): boolean => token?.pos === "ADJ" && token.features?.["Bound"] === "Yes";
|
|
265
|
+
|
|
176
266
|
/**
|
|
177
|
-
*
|
|
178
|
-
* that the rest of the sentence is said of, when no subject of its own
|
|
267
|
+
* 石破総理大臣は…明らかにしましたが、赤澤大臣は…どう考えているか / 〜しておりますが、本事業は、…: a noun (a prefix may stand before
|
|
268
|
+
* it) and は straight after the comma is a topic of its own that the rest of the sentence is said of, when no subject of its own
|
|
269
|
+
* (が) follows it. A phrase before は (〜した行為は) is not one.
|
|
179
270
|
*/
|
|
180
271
|
const newNameTopicRunsToEnd = (tokens: readonly Token[], comma: number, last: number): boolean => {
|
|
181
|
-
const
|
|
272
|
+
const start = isNounPrefix(tokens[comma + 1]) ? comma + 2 : comma + 1;
|
|
273
|
+
const topic = tokens.findIndex((token, index) => index >= start && !isNameWord(token));
|
|
182
274
|
const wa = tokens[topic];
|
|
183
|
-
return topic >
|
|
275
|
+
return topic > start && wa !== undefined && isParticle(wa, "は") && lastOwnSubject(tokens, last) <= topic;
|
|
184
276
|
};
|
|
185
277
|
|
|
186
278
|
/** A topic on the nominaliser こと after a predicate (公表することは): an act made a noun. */
|
|
@@ -189,18 +281,23 @@ const isActTopic = (tokens: readonly Token[], topic: number): boolean =>
|
|
|
189
281
|
|
|
190
282
|
/**
|
|
191
283
|
* 当社は…を営んでおりますが、…の重要性が乏しいため、…の記載は行っておりません: after 〜ますが、 the words up to the next comma
|
|
192
|
-
* say something of a subject of their own (が) and a new topic
|
|
193
|
-
* topic's, when no other subject stands between the topic and it
|
|
194
|
-
* its own there is read to the end, unless a name stands as a new
|
|
195
|
-
* topic
|
|
196
|
-
* speaker's.
|
|
284
|
+
* say something of a subject of their own (が) and a new topic (bare, or on に or で: 〜プログラムには) takes what comes after
|
|
285
|
+
* that subject, so the predicate before が was the topic's, when no other subject stands between the topic and it
|
|
286
|
+
* (需要の停滞がありましたが is not). A clause with no subject of its own there is read to the end, unless a name stands as a new
|
|
287
|
+
* topic straight after the comma (〜ましたが、B大臣は…), or the topic is an act made a noun (つまびらかにすることは差し控えますが、…):
|
|
288
|
+
* what is said of an act ends there, and the rest is the speaker's. A topic that sets the time or the case (普及以前は、決定後は)
|
|
289
|
+
* frames only its clause: when a subject of its own follows the comma, its clause ends at 〜ますが even with a subject between.
|
|
197
290
|
*/
|
|
198
|
-
const closesWithPoliteGa = (tokens: readonly Token[], topic: number, at: number, last: number): boolean => {
|
|
199
|
-
if (!isPoliteGa(tokens, at) || !isComma(tokens[at + 1])
|
|
291
|
+
const closesWithPoliteGa = (tokens: readonly Token[], topic: number, at: number, last: number, subject: number): boolean => {
|
|
292
|
+
if (!isPoliteGa(tokens, at) || !isComma(tokens[at + 1])) return false;
|
|
293
|
+
if (isSettingTopic(tokens, topic)) return newTopicAfter(tokens, at + 1, last) || subject > at || finalGaAfter(tokens, at, last);
|
|
294
|
+
if (subjectBetween(tokens, topic, at)) return false;
|
|
200
295
|
if (isActTopic(tokens, topic) || newNameTopicRunsToEnd(tokens, at + 1, last)) return true;
|
|
201
296
|
const comma = tokens.findIndex((token, index) => index > at + 1 && index < last && isComma(token));
|
|
202
|
-
const
|
|
203
|
-
|
|
297
|
+
const ga = tokens.findIndex(
|
|
298
|
+
(token, index) => index > at + 1 && index < (comma === -1 ? last : comma) && isParticle(token, "が") && headsSubject(tokens, index),
|
|
299
|
+
);
|
|
300
|
+
return ga !== -1 && frameTopicAfter(tokens, ga, last);
|
|
204
301
|
};
|
|
205
302
|
|
|
206
303
|
/**
|
|
@@ -260,9 +357,10 @@ export const topicClauseEnd = (tokens: readonly Token[], topic: number, last: nu
|
|
|
260
357
|
const subject = lastOwnSubject(tokens, last);
|
|
261
358
|
const closes = (at: number): boolean =>
|
|
262
359
|
closesSurely(tokens, at, last) ||
|
|
263
|
-
(closesIfNewSubject(tokens, at) && subject > at) ||
|
|
360
|
+
(closesIfNewSubject(tokens, at) && (subject > at || requestAfter(tokens, at, last))) ||
|
|
361
|
+
closesWithCopulaContinuing(tokens, topic, at, last, subject) ||
|
|
264
362
|
closesFirstClauseWithNoun(tokens, topic, at, last) ||
|
|
265
|
-
closesWithPoliteGa(tokens, topic, at, last) ||
|
|
363
|
+
closesWithPoliteGa(tokens, topic, at, last, subject) ||
|
|
266
364
|
closesAfterPredicate(tokens, topic, at, words) ||
|
|
267
365
|
closesWithItemMark(tokens, at) ||
|
|
268
366
|
closesCleftInNounPhrase(tokens, topic, at, last);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const CODE_MARK = "`";
|
|
2
|
+
const PARAGRAPH_BREAK = /\n[ \t]*\n/u;
|
|
3
|
+
const PARAGRAPH_BREAKS = new RegExp(PARAGRAPH_BREAK.source, "gu");
|
|
4
|
+
/** The quote that opens right after a code mark, and the mark that closes it. */
|
|
5
|
+
const CLOSER: Readonly<Record<string, string>> = { '"': '"', "'": "'", "“": "”", "‘": "’" };
|
|
6
|
+
|
|
7
|
+
/** The offsets in a paragraph of its single code marks; a run of two or more (``) is a fence or a longer delimiter, not counted. */
|
|
8
|
+
const codeMarksIn = (paragraph: string): number[] =>
|
|
9
|
+
[...paragraph].flatMap((char, at) => (char === CODE_MARK && paragraph[at - 1] !== CODE_MARK && paragraph[at + 1] !== CODE_MARK ? [at] : []));
|
|
10
|
+
|
|
11
|
+
/** The quote's two offsets in a paragraph, when a quote opens right after the code mark at `mark` and closes on the same line. */
|
|
12
|
+
const quoteAfter = (paragraph: string, mark: number): number[] => {
|
|
13
|
+
const opening = mark + 1;
|
|
14
|
+
const closer = CLOSER[paragraph[opening] ?? ""];
|
|
15
|
+
if (closer === undefined) return [];
|
|
16
|
+
const closing = paragraph.indexOf(closer, opening + 1);
|
|
17
|
+
const lineEnd = paragraph.indexOf("\n", opening);
|
|
18
|
+
return closing === -1 || (lineEnd !== -1 && closing > lineEnd) ? [] : [opening, closing];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Where each paragraph of `source` starts and ends (its break excluded). */
|
|
22
|
+
const paragraphSpans = (source: string): { start: number; end: number }[] => {
|
|
23
|
+
const breaks = [...source.matchAll(PARAGRAPH_BREAKS)];
|
|
24
|
+
const starts = [0, ...breaks.map((match) => match.index + match[0].length)];
|
|
25
|
+
return starts.map((start, at) => ({ start, end: breaks[at]?.index ?? source.length }));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** The quote offsets in `source` of the one paragraph from start to end. */
|
|
29
|
+
const unclosedIn = (source: string, start: number, end: number): number[] => {
|
|
30
|
+
const paragraph = source.slice(start, end);
|
|
31
|
+
const marks = codeMarksIn(paragraph);
|
|
32
|
+
const last = marks.at(-1);
|
|
33
|
+
return last !== undefined && marks.length % 2 === 1 ? quoteAfter(paragraph, last).map((at) => start + at) : [];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The offsets in `source` of the quote marks of a quoted value that opens right after a code mark left unclosed in its
|
|
38
|
+
* paragraph (`"my-secure-password" (don't use this)): the writer meant the value as code and dropped the closing mark, so
|
|
39
|
+
* its quotes are the code's, not the prose's. Code marks pair from the left, so with an odd count the last one is unclosed.
|
|
40
|
+
*/
|
|
41
|
+
export const unclosedCodeQuoteOffsets = (source: string): ReadonlySet<number> =>
|
|
42
|
+
new Set(paragraphSpans(source).flatMap(({ start, end }) => unclosedIn(source, start, end)));
|