chaffjs 0.49.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/announced-count.d.ts.map +1 -1
- package/dist/announced-count.js +18 -1
- package/dist/announced-count.js.map +1 -1
- package/dist/announced-list.d.ts.map +1 -1
- package/dist/announced-list.js +6 -1
- package/dist/announced-list.js.map +1 -1
- 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 +16 -13
- 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/composite-signals.d.ts +3 -1
- package/dist/composite-signals.d.ts.map +1 -1
- package/dist/composite-signals.js +7 -0
- package/dist/composite-signals.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/agentless-passive.d.ts.map +1 -1
- package/dist/detectors/agentless-passive.js +39 -4
- package/dist/detectors/agentless-passive.js.map +1 -1
- package/dist/detectors/agreement-slip.d.ts +2 -0
- package/dist/detectors/agreement-slip.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.js +10 -3
- package/dist/detectors/agreement-slip.js.map +1 -1
- package/dist/detectors/amount-scale.js +2 -2
- package/dist/detectors/amount-scale.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/chat-citation.d.ts +2 -6
- package/dist/detectors/chat-citation.d.ts.map +1 -1
- package/dist/detectors/chat-citation.js +4 -2
- package/dist/detectors/chat-citation.js.map +1 -1
- package/dist/detectors/chat-mark-extent.d.ts +11 -0
- package/dist/detectors/chat-mark-extent.d.ts.map +1 -0
- package/dist/detectors/chat-mark-extent.js +53 -0
- package/dist/detectors/chat-mark-extent.js.map +1 -0
- 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/conjugated-entry.d.ts +2 -2
- package/dist/detectors/conjugated-entry.d.ts.map +1 -1
- package/dist/detectors/conjugated-entry.js +3 -5
- package/dist/detectors/conjugated-entry.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/contrast-frame.d.ts.map +1 -1
- package/dist/detectors/contrast-frame.js +34 -1
- package/dist/detectors/contrast-frame.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.js +2 -2
- 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 +21 -6
- 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 +12 -2
- 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/ellipsis.js +2 -2
- package/dist/detectors/ellipsis.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +5 -1
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +5 -3
- 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 +49 -9
- 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-furniture.d.ts +1 -0
- package/dist/detectors/gram-furniture.d.ts.map +1 -1
- package/dist/detectors/gram-furniture.js +6 -0
- package/dist/detectors/gram-furniture.js.map +1 -1
- package/dist/detectors/gram-repetition.d.ts.map +1 -1
- package/dist/detectors/gram-repetition.js +8 -2
- package/dist/detectors/gram-repetition.js.map +1 -1
- package/dist/detectors/heading-case.d.ts +1 -0
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +16 -4
- 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/kutoten-consistency.d.ts.map +1 -1
- package/dist/detectors/kutoten-consistency.js +27 -6
- package/dist/detectors/kutoten-consistency.js.map +1 -1
- package/dist/detectors/lexicon-match.d.ts +2 -0
- package/dist/detectors/lexicon-match.d.ts.map +1 -1
- package/dist/detectors/lexicon-match.js +14 -3
- package/dist/detectors/lexicon-match.js.map +1 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +8 -1
- package/dist/detectors/lexicon.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-clause.d.ts +4 -0
- package/dist/detectors/list-item-clause.d.ts.map +1 -0
- package/dist/detectors/list-item-clause.js +8 -0
- package/dist/detectors/list-item-clause.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 +17 -16
- 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-sentence.d.ts +2 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -1
- package/dist/detectors/list-sentence.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 +40 -23
- 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 +17 -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 +17 -5
- 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/ordinal-suffix.js +2 -2
- package/dist/detectors/ordinal-suffix.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 +46 -23
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +24 -8
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +28 -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 +6 -4
- package/dist/detectors/paragraph-run.js.map +1 -1
- package/dist/detectors/phone-number-variant.d.ts.map +1 -1
- package/dist/detectors/phone-number-variant.js +2 -1
- package/dist/detectors/phone-number-variant.js.map +1 -1
- package/dist/detectors/phrase-context.d.ts +6 -0
- package/dist/detectors/phrase-context.d.ts.map +1 -0
- package/dist/detectors/phrase-context.js +12 -0
- package/dist/detectors/phrase-context.js.map +1 -0
- package/dist/detectors/phrase-match-all.d.ts +3 -0
- package/dist/detectors/phrase-match-all.d.ts.map +1 -0
- package/dist/detectors/phrase-match-all.js +47 -0
- package/dist/detectors/phrase-match-all.js.map +1 -0
- package/dist/detectors/phrase-match.d.ts +2 -1
- package/dist/detectors/phrase-match.d.ts.map +1 -1
- package/dist/detectors/phrase-match.js +25 -6
- package/dist/detectors/phrase-match.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts.map +1 -1
- package/dist/detectors/placeholder-text.js +22 -2
- 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/proper-noun-density.d.ts.map +1 -1
- package/dist/detectors/proper-noun-density.js +10 -6
- package/dist/detectors/proper-noun-density.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 +4 -1
- package/dist/detectors/quote-around.d.ts.map +1 -1
- package/dist/detectors/quote-around.js +28 -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/range-notation.js +2 -2
- package/dist/detectors/range-notation.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/phrase-match-all.d.ts +3 -0
- package/dist/detectors/registry/phrase-match-all.d.ts.map +1 -0
- package/dist/detectors/registry/phrase-match-all.js +3 -0
- package/dist/detectors/registry/phrase-match-all.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/requirement-lists.d.ts.map +1 -1
- package/dist/detectors/requirement-lists.js +2 -0
- package/dist/detectors/requirement-lists.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 +24 -9
- 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 +20 -3
- 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.d.ts.map +1 -1
- package/dist/detectors/signals.js +8 -3
- 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/team.d.ts.map +1 -1
- package/dist/detectors/team.js +42 -9
- package/dist/detectors/team.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/unit-spacing.js +2 -2
- package/dist/detectors/unit-spacing.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-deadline.d.ts.map +1 -1
- package/dist/detectors/vague-deadline.js +2 -1
- package/dist/detectors/vague-deadline.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/levels.d.ts +14 -0
- package/dist/levels.d.ts.map +1 -1
- package/dist/levels.js +8 -3
- package/dist/levels.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/phone-numbers.d.ts +5 -2
- package/dist/phone-numbers.d.ts.map +1 -1
- package/dist/phone-numbers.js +17 -3
- package/dist/phone-numbers.js.map +1 -1
- package/dist/plugin.d.ts +26 -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 +5 -0
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +57 -15
- package/dist/render/explain.js.map +1 -1
- package/dist/render/options.d.ts.map +1 -1
- package/dist/render/options.js +11 -6
- package/dist/render/options.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/render/text.d.ts.map +1 -1
- package/dist/render/text.js +14 -4
- package/dist/render/text.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 +5 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +40 -21
- 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/deadline-after-event.d.ts +1 -1
- package/dist/structure/deadline-after-event.d.ts.map +1 -1
- package/dist/structure/deadline-after-event.js +36 -9
- package/dist/structure/deadline-after-event.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 +10 -1
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +4 -4
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure/leg-times.d.ts.map +1 -1
- package/dist/structure/leg-times.js +10 -2
- package/dist/structure/leg-times.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/requirement-lists.d.ts +3 -0
- package/dist/structure/requirement-lists.d.ts.map +1 -1
- package/dist/structure/requirement-lists.js +8 -2
- package/dist/structure/requirement-lists.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/time-marks.d.ts +10 -0
- package/dist/structure/time-marks.d.ts.map +1 -1
- package/dist/structure/time-marks.js +21 -0
- package/dist/structure/time-marks.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/abstract-length.yaml +1 -1
- package/rules/adverb-overuse.yaml +3 -3
- package/rules/agentless-passive.yaml +3 -3
- package/rules/agreement-slip.yaml +5 -4
- package/rules/ai-generated-composite.yaml +3 -3
- package/rules/ai-structure.yaml +1 -1
- package/rules/all-caps-shouting.yaml +1 -1
- package/rules/announced-count-mismatch.yaml +2 -2
- package/rules/announcing-opener.yaml +1 -1
- package/rules/arrival-before-departure.yaml +1 -1
- package/rules/article-sound.yaml +1 -1
- package/rules/baito-keigo.yaml +1 -1
- package/rules/bold-density.yaml +3 -3
- package/rules/bold-emphasis.yaml +1 -1
- package/rules/bold-label-list.yaml +3 -3
- package/rules/bracket-width-consistency.yaml +3 -3
- package/rules/broken-link.yaml +2 -2
- package/rules/change-rate-mismatch.yaml +2 -2
- package/rules/chat-citation-residue.yaml +1 -1
- package/rules/citation-style-mix.yaml +1 -1
- package/rules/clause-chain.yaml +1 -1
- package/rules/cliche.yaml +4 -4
- package/rules/closing-cliche.yaml +1 -1
- package/rules/closing-exhortation.yaml +1 -1
- package/rules/code-fence-language-mix.yaml +2 -2
- package/rules/cold-open.yaml +1 -1
- package/rules/colloquial-opener.yaml +1 -1
- package/rules/comparative-without-baseline.yaml +2 -2
- package/rules/concrete-evidence-density.yaml +1 -1
- package/rules/contraction-consistency.yaml +4 -4
- 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 +6 -6
- package/rules/cushion-phrase-density.yaml +1 -1
- 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/deadline-after-event.yaml +2 -2
- package/rules/defined-term-form.yaml +2 -2
- package/rules/demonstrative-opener-run.yaml +1 -1
- package/rules/double-keigo.yaml +1 -1
- package/rules/double-negative.yaml +11 -2
- package/rules/doubled-nado.yaml +1 -1
- package/rules/elapsed-years-mismatch.yaml +2 -2
- package/rules/email-stock-courtesy.yaml +1 -1
- package/rules/email-subject-length.yaml +1 -1
- package/rules/emoji-heading.yaml +1 -1
- package/rules/empty-intensifier.yaml +1 -1
- 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/excessive-hedging.yaml +1 -1
- package/rules/exclamation-width-consistency.yaml +1 -1
- package/rules/expletive-construction.yaml +3 -3
- package/rules/figurative-density.yaml +3 -3
- 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/hiragana-fukushi.yaml +1 -1
- package/rules/homophone-slip.yaml +3 -3
- package/rules/honesty-marker.yaml +1 -1
- package/rules/humble-for-others.yaml +1 -1
- package/rules/hyphen-as-dash.yaml +3 -3
- package/rules/idiom-misuse.yaml +1 -1
- package/rules/internal-jargon.yaml +1 -1
- package/rules/kana-function-word.yaml +1 -1
- package/rules/katakana-long-vowel.yaml +1 -1
- package/rules/known-misspelling.yaml +2 -2
- package/rules/kutoten-consistency.yaml +7 -3
- package/rules/latin-abbreviation-form.yaml +1 -1
- package/rules/latin-spacing.yaml +5 -5
- 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-paragraph-length.yaml +1 -1
- package/rules/max-sentence-length.yaml +3 -3
- package/rules/max-ten.yaml +1 -1
- package/rules/misconversion.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 +3 -3
- package/rules/no-doubled-joshi.yaml +2 -2
- package/rules/no-em-dash.yaml +3 -3
- package/rules/no-mixed-desumasu.yaml +63 -3
- package/rules/no-nakaguro-parallel.yaml +3 -3
- package/rules/nominalization.yaml +3 -3
- package/rules/nonstandard-word.yaml +2 -2
- package/rules/number-style-consistency.yaml +2 -2
- package/rules/numbered-generic-heading.yaml +1 -1
- package/rules/numbering-gap.yaml +2 -2
- package/rules/obligation-without-deadline.yaml +2 -2
- package/rules/one-sentence-paragraph-run.yaml +3 -3
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/over-general-claim.yaml +1 -1
- package/rules/oxford-comma-consistency.yaml +4 -3
- package/rules/padded-intro.yaml +1 -1
- package/rules/period-label-conflict.yaml +2 -2
- package/rules/phone-number-variant.yaml +1 -1
- package/rules/preamble-length.yaml +3 -3
- package/rules/preferred-term.yaml +1 -1
- package/rules/proper-noun-density.yaml +1 -1
- package/rules/pseudo-heading.yaml +79 -0
- package/rules/q-fragment-answer.yaml +1 -1
- package/rules/quote-style-consistency.yaml +1 -1
- package/rules/quote-without-source.yaml +2 -2
- package/rules/redundant-expression.yaml +1 -1
- package/rules/repeated-conjunction.yaml +1 -1
- package/rules/repeated-sentence-ending.yaml +3 -3
- package/rules/repeated-sentence-head.yaml +5 -5
- package/rules/request-without-deadline.yaml +2 -2
- package/rules/required-listed-as-preferred.yaml +2 -2
- package/rules/required-sections.yaml +1 -1
- package/rules/reversed-link.yaml +78 -0
- package/rules/sa-ire.yaml +43 -0
- package/rules/sasete-itadaku.yaml +1 -1
- package/rules/sentence-initial-conjunction-run.yaml +1 -1
- package/rules/sentence-initial-so.yaml +1 -1
- package/rules/sentence-rhythm.yaml +2 -2
- package/rules/sentence-spacing-consistency.yaml +1 -1
- package/rules/serial-range-reversed.yaml +4 -4
- package/rules/shell-prompt-mix.yaml +3 -3
- package/rules/stock-transition.yaml +1 -1
- package/rules/stray-space.yaml +1 -1
- package/rules/table-absorbed-line.yaml +88 -0
- package/rules/taigen-dome-in-prose.yaml +1 -1
- package/rules/teki-overuse.yaml +3 -3
- package/rules/term-consistency.yaml +56 -0
- package/rules/term-form.yaml +56 -0
- package/rules/title-case-consistency.yaml +5 -5
- package/rules/title-length.yaml +3 -3
- package/rules/topic-predicate-distance.yaml +3 -3
- package/rules/translationese-density.yaml +1 -1
- package/rules/unbalanced-bracket.yaml +2 -2
- package/rules/uncomparable-graded.yaml +1 -1
- package/rules/undefined-acronym.yaml +5 -3
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +4 -4
- package/rules/unknown-word.yaml +2 -2
- package/rules/unqualified-superlative.yaml +1 -1
- package/rules/use-before-definition.yaml +2 -2
- package/rules/vague-word-density.yaml +3 -3
- package/rules/version-mismatch.yaml +2 -2
- package/rules/weasel-word.yaml +4 -4
- package/rules/which-that-consistency.yaml +3 -3
- package/rules/wordy-phrase.yaml +1 -1
- package/skills/chaff/SKILL.md +51 -7
- package/src/allow.ts +146 -0
- package/src/announced-count.ts +22 -1
- package/src/announced-list.ts +7 -1
- package/src/check-source.ts +33 -9
- package/src/cli-text.ts +13 -4
- package/src/cli.ts +20 -17
- package/src/commands/eval.ts +1 -1
- package/src/commands/suppressions.ts +3 -3
- package/src/commands/test.ts +1 -1
- package/src/composite-signals.ts +10 -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/agentless-passive.ts +49 -5
- package/src/detectors/agreement-slip.ts +11 -3
- package/src/detectors/amount-scale.ts +2 -2
- 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/chat-citation.ts +4 -5
- package/src/detectors/chat-mark-extent.ts +63 -0
- package/src/detectors/clause-shape.ts +8 -4
- package/src/detectors/conjugated-entry.ts +3 -5
- package/src/detectors/contraction-mix.ts +8 -2
- package/src/detectors/contraction-set-apart.ts +22 -2
- package/src/detectors/contrast-frame.ts +37 -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 +2 -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 +21 -7
- package/src/detectors/definition-use.ts +12 -9
- package/src/detectors/derived-numbers.ts +1 -0
- package/src/detectors/document-shape.ts +4 -1
- package/src/detectors/ellipsis.ts +2 -2
- package/src/detectors/email-letter.ts +7 -3
- package/src/detectors/empty-section.ts +10 -2
- package/src/detectors/en-shape.ts +57 -6
- 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-furniture.ts +8 -0
- package/src/detectors/gram-repetition.ts +8 -1
- package/src/detectors/heading-case.ts +18 -4
- 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/kutoten-consistency.ts +37 -6
- package/src/detectors/lexicon-match.ts +17 -3
- package/src/detectors/lexicon.ts +10 -4
- package/src/detectors/link-definition.ts +91 -0
- package/src/detectors/list-item-asides.ts +29 -0
- package/src/detectors/list-item-clause.ts +9 -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 +16 -17
- package/src/detectors/list-run.ts +16 -3
- package/src/detectors/list-sentence.ts +2 -0
- package/src/detectors/list-verb-series.ts +24 -0
- package/src/detectors/mark-shape.ts +51 -27
- 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 +19 -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 +22 -5
- package/src/detectors/number-style.ts +8 -0
- package/src/detectors/ordinal-suffix.ts +2 -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 +61 -32
- package/src/detectors/orthography.ts +36 -10
- package/src/detectors/oxford-comma.ts +28 -2
- package/src/detectors/paragraph-run.ts +9 -12
- package/src/detectors/phone-number-variant.ts +2 -1
- package/src/detectors/phrase-context.ts +19 -0
- package/src/detectors/phrase-match-all.ts +57 -0
- package/src/detectors/phrase-match.ts +31 -6
- package/src/detectors/placeholder-text.ts +36 -3
- package/src/detectors/placeholder.ts +10 -0
- package/src/detectors/proper-noun-density.ts +14 -6
- package/src/detectors/pseudo-heading.ts +59 -0
- package/src/detectors/quote-around.ts +37 -6
- package/src/detectors/quoted-label.ts +22 -0
- package/src/detectors/ra-nuki.ts +3 -34
- package/src/detectors/range-notation.ts +2 -2
- 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/phrase-match-all.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/requirement-lists.ts +2 -0
- package/src/detectors/reversed-link.ts +39 -0
- package/src/detectors/sa-ire.ts +7 -0
- package/src/detectors/sentence-counts.ts +35 -13
- package/src/detectors/sentence-ending.ts +53 -12
- package/src/detectors/sentence-length.ts +28 -4
- package/src/detectors/sentence-rhythm.ts +6 -2
- package/src/detectors/signals.ts +12 -3
- package/src/detectors/structure.ts +4 -0
- package/src/detectors/team.ts +50 -12
- 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/unit-spacing.ts +2 -2
- package/src/detectors/unknown-word-context.ts +6 -0
- package/src/detectors/unknown-word.ts +7 -1
- package/src/detectors/vague-deadline.ts +2 -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/levels.ts +9 -3
- package/src/markdown-node.ts +1 -0
- package/src/name-separator.ts +29 -7
- package/src/news-dateline.ts +29 -0
- package/src/phone-numbers.ts +19 -3
- package/src/plugin.ts +23 -3
- package/src/reasons.ts +8 -0
- package/src/render/explain.ts +72 -17
- package/src/render/options.ts +12 -6
- package/src/render/rules-json.ts +16 -2
- package/src/render/summary.ts +33 -4
- package/src/render/suppressions.ts +101 -4
- package/src/render/text.ts +20 -7
- package/src/rule-load.ts +3 -2
- package/src/run-in-title.ts +91 -0
- package/src/run.ts +53 -16
- 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/deadline-after-event.ts +49 -10
- package/src/structure/defining-names.ts +14 -1
- package/src/structure/definition-use.ts +15 -5
- package/src/structure/leg-times.ts +16 -1
- package/src/structure/net-amount.ts +44 -5
- package/src/structure/period-label-conflict.ts +22 -7
- package/src/structure/requirement-lists.ts +14 -2
- package/src/structure/serial-range.ts +14 -6
- package/src/structure/time-marks.ts +25 -0
- 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
- package/dist/honorific-group.d.ts +0 -8
- package/dist/honorific-group.d.ts.map +0 -1
- package/dist/honorific-group.js +0 -15
- package/dist/honorific-group.js.map +0 -1
|
@@ -9,13 +9,16 @@ const INFLECTING = new Set(["VERB", "AUX"]);
|
|
|
9
9
|
* 語彙表が原形で書いた語(いただく)だけが、活用した形(いただきます・いただいた)に当たる。
|
|
10
10
|
* 活用した形で書いた語(could・かもしれません)はその形だけ。"could" は "can" と言っていることが違う。
|
|
11
11
|
*/
|
|
12
|
-
const sameWord = (written: Token, entry: Token): boolean => {
|
|
12
|
+
const sameWord = (written: Token, entry: Token, headsPhrase: boolean): boolean => {
|
|
13
13
|
const surface = entry.surface.toLowerCase();
|
|
14
14
|
if (written.surface.toLowerCase() === surface) return true;
|
|
15
|
-
const inflects = INFLECTING.has(written.pos) && INFLECTING.has(entry.pos);
|
|
15
|
+
const inflects = INFLECTING.has(written.pos) && (INFLECTING.has(entry.pos) || (headsPhrase && entry.pos === "NOUN"));
|
|
16
16
|
return inflects && entry.lemma?.toLowerCase() === surface && written.lemma?.toLowerCase() === surface;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
/** A phrase read on its own has no subject, so its head verb is often tagged a noun ("move the needle", "conduct an analysis"). */
|
|
20
|
+
const headsPhrase = (entry: readonly Token[], offset: number): boolean => offset === 0 && entry.length > 1;
|
|
21
|
+
|
|
19
22
|
/** 品詞が無いときに照らす形。大文字小文字と、アポストロフィの形(it’s と it's)は語を変えない。 */
|
|
20
23
|
export const comparableWords = (text: string): string => straightApostrophes(text).toLowerCase();
|
|
21
24
|
|
|
@@ -25,7 +28,7 @@ export const comparableText = (sentence: Sentence): string => comparableWords(pr
|
|
|
25
28
|
const runsAt = (tokens: readonly Token[], entry: readonly Token[], start: number): boolean =>
|
|
26
29
|
entry.every((word, offset) => {
|
|
27
30
|
const written = tokens[start + offset];
|
|
28
|
-
return written !== undefined && sameWord(written, word);
|
|
31
|
+
return written !== undefined && sameWord(written, word, headsPhrase(entry, offset));
|
|
29
32
|
});
|
|
30
33
|
|
|
31
34
|
/**
|
|
@@ -39,6 +42,17 @@ export const entryIn = (sentence: Sentence, entry: LexiconEntry): boolean => {
|
|
|
39
42
|
return tokens.some((_token, start) => runsAt(tokens, words, start));
|
|
40
43
|
};
|
|
41
44
|
|
|
45
|
+
const writtenAsIs = (tokens: readonly Token[], entry: readonly Token[], start: number): boolean =>
|
|
46
|
+
entry.every((word, offset) => tokens[start + offset]?.surface.toLowerCase() === word.surface.toLowerCase());
|
|
47
|
+
|
|
48
|
+
/** Whether the lexicon's words stand in the sentence in the very form the lexicon writes them ("reverted back", not "revert back"). */
|
|
49
|
+
export const entryWrittenIn = (sentence: Sentence, entry: LexiconEntry): boolean => {
|
|
50
|
+
const tokens = sentence.tokens;
|
|
51
|
+
const words = entry.tokens;
|
|
52
|
+
if (tokens === undefined || words === undefined || words.length === 0) return entryIn(sentence, entry);
|
|
53
|
+
return tokens.some((_token, start) => writtenAsIs(tokens, words, start));
|
|
54
|
+
};
|
|
55
|
+
|
|
42
56
|
export type TokenRange = { readonly start: number; readonly end: number };
|
|
43
57
|
|
|
44
58
|
/** 語彙の語が文のどの語の並びに当たったか(始まりと、終わった次の位置)。品詞が無ければ位置を言えないので空。 */
|
package/src/detectors/lexicon.ts
CHANGED
|
@@ -22,10 +22,16 @@ const FLOOR = { word: 200, char: 500 };
|
|
|
22
22
|
|
|
23
23
|
type Hit = { readonly sentence: Sentence; readonly matched: string; readonly group?: string | undefined };
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
/** 後ろの語を導く語(まるで)。同じ文にほかの語が当たれば、それと合わせて一つ(まるで魔法のように)と数える。 */
|
|
26
|
+
const OPENER_GROUP = "opener";
|
|
27
|
+
|
|
28
|
+
const sentenceHits = (sentence: Sentence, lexicon: Lexicon): Hit[] => {
|
|
29
|
+
const hits = lexicon.filter((entry) => entryIn(sentence, entry)).map((entry) => ({ sentence, matched: entry.pattern, group: entry.group }));
|
|
30
|
+
const closed = hits.some((hit) => hit.group !== OPENER_GROUP);
|
|
31
|
+
return closed ? hits.filter((hit) => hit.group !== OPENER_GROUP) : hits;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const hitsFor = (doc: ProseDocument, lexicon: Lexicon): Hit[] => doc.sentences.flatMap((sentence) => sentenceHits(sentence, lexicon));
|
|
29
35
|
|
|
30
36
|
/**
|
|
31
37
|
* A lexicon word in group address says how the document speaks to its reader (あなたの). Alone it is the writer's chosen
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Reference-link definitions (`[label]: url`) that do nothing: one no link calls, and a second one for a label already
|
|
2
|
+
// defined, which Markdown ignores. Pure; reads the source's Markdown tree.
|
|
3
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
4
|
+
import { readMarkdown } from "../markdown-read.ts";
|
|
5
|
+
import { spanOf, type MarkdownNode } from "../markdown-node.ts";
|
|
6
|
+
import { findingAt, markupOf } from "./markup-finding.ts";
|
|
7
|
+
|
|
8
|
+
const QUOTED = "blockquote";
|
|
9
|
+
const DEFINITION = "definition";
|
|
10
|
+
const CALLS = new Set(["linkReference", "imageReference"]);
|
|
11
|
+
|
|
12
|
+
/** A definition that is a comment in disguise (`[//]: # (note)`, `[comment]: <>`): it has no address to lose. */
|
|
13
|
+
const COMMENT_DESTINATIONS = new Set(["", "#"]);
|
|
14
|
+
const COMMENT_LABEL = "//";
|
|
15
|
+
|
|
16
|
+
/** A note (`[^1]: …`) is read as a definition without the footnote extension; `footnote-mismatch` checks notes. */
|
|
17
|
+
const NOTE_MARK = "^";
|
|
18
|
+
|
|
19
|
+
type Placed = { readonly node: MarkdownNode; readonly previous: MarkdownNode | undefined };
|
|
20
|
+
|
|
21
|
+
/** Definitions outside quotations, each with the node before it among its siblings. Walks with its own stack. */
|
|
22
|
+
const definitionsOf = (root: MarkdownNode): Placed[] => {
|
|
23
|
+
const found: Placed[] = [];
|
|
24
|
+
const pending: MarkdownNode[] = [root];
|
|
25
|
+
for (let node = pending.pop(); node !== undefined; node = pending.pop()) {
|
|
26
|
+
if (node.type === QUOTED) continue;
|
|
27
|
+
const children = node.children ?? [];
|
|
28
|
+
children.forEach((child, index) => {
|
|
29
|
+
if (child.type === DEFINITION) found.push({ node: child, previous: children[index - 1] });
|
|
30
|
+
});
|
|
31
|
+
children.toReversed().forEach((child) => pending.push(child));
|
|
32
|
+
}
|
|
33
|
+
return found;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** Labels a link or an image calls, quotations included: a quoted link still uses the definition. */
|
|
37
|
+
const calledLabels = (root: MarkdownNode): Set<string> => {
|
|
38
|
+
const called = new Set<string>();
|
|
39
|
+
const pending: MarkdownNode[] = [root];
|
|
40
|
+
for (let node = pending.pop(); node !== undefined; node = pending.pop()) {
|
|
41
|
+
if (CALLS.has(node.type) && node.identifier !== undefined) called.add(node.identifier);
|
|
42
|
+
(node.children ?? []).forEach((child) => pending.push(child));
|
|
43
|
+
}
|
|
44
|
+
return called;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const labelOf = (node: MarkdownNode): string => node.label ?? node.identifier ?? "";
|
|
48
|
+
|
|
49
|
+
/** Not a link definition at all: a comment, or a note. */
|
|
50
|
+
const isNotALink = (node: MarkdownNode): boolean =>
|
|
51
|
+
COMMENT_DESTINATIONS.has((node.url ?? "").trim()) || labelOf(node) === COMMENT_LABEL || labelOf(node).startsWith(NOTE_MARK);
|
|
52
|
+
|
|
53
|
+
/** A name for the heading just above (`## Summary` then `[summary]: #summary`), as some templates write under every heading. */
|
|
54
|
+
const isHeadingAnchor = ({ node, previous }: Placed): boolean => (node.url ?? "").startsWith("#") && previous?.type === "heading";
|
|
55
|
+
|
|
56
|
+
/** A file of nothing but definitions, which other pages include for their links. */
|
|
57
|
+
const isDefinitionFile = (root: MarkdownNode): boolean => {
|
|
58
|
+
const blocks = (root.children ?? []).filter((child) => child.type !== "yaml");
|
|
59
|
+
return blocks.length > 0 && blocks.every((child) => child.type === DEFINITION);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const unusedOf = (doc: ProseDocument, definitions: readonly Placed[], called: ReadonlySet<string>): Finding[] =>
|
|
63
|
+
definitions
|
|
64
|
+
.filter((placed) => !called.has(placed.node.identifier ?? "") && !isHeadingAnchor(placed))
|
|
65
|
+
.flatMap(({ node }) => {
|
|
66
|
+
const span = spanOf(node);
|
|
67
|
+
return span === undefined ? [] : [findingAt(doc, span, { label: labelOf(node) }, "unused")];
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/** A later definition of a label already defined with another address: Markdown keeps the first and ignores this one. */
|
|
71
|
+
const duplicatesOf = (doc: ProseDocument, definitions: readonly Placed[]): Finding[] => {
|
|
72
|
+
const first = new Map<string, MarkdownNode>();
|
|
73
|
+
return definitions.flatMap(({ node }) => {
|
|
74
|
+
const key = node.identifier ?? "";
|
|
75
|
+
const earlier = first.get(key);
|
|
76
|
+
if (earlier === undefined) first.set(key, node);
|
|
77
|
+
const span = spanOf(node);
|
|
78
|
+
if (earlier === undefined || earlier.url === node.url || span === undefined) return [];
|
|
79
|
+
return [findingAt(doc, span, { label: labelOf(node), url: earlier.url ?? "" }, "duplicate")];
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const linkDefinitionUnused: Detector = (doc): Finding[] => {
|
|
84
|
+
if (markupOf(doc) === undefined) return [];
|
|
85
|
+
const { root } = readMarkdown(doc.source);
|
|
86
|
+
if (isDefinitionFile(root)) return [];
|
|
87
|
+
const definitions = definitionsOf(root).filter(({ node }) => !isNotALink(node));
|
|
88
|
+
return [...unusedOf(doc, definitions, calledLabels(root)), ...duplicatesOf(doc, definitions)].toSorted(
|
|
89
|
+
(left, right) => Number(left.values["offset"]) - Number(right.values["offset"]),
|
|
90
|
+
);
|
|
91
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Items of a list that are not among its items: a note set as one more bullet, and a cited title. Pure.
|
|
2
|
+
|
|
3
|
+
/** A list item's marker (- , 1. ). */
|
|
4
|
+
const LIST_MARKER = /^\s*(?:\d+[.)]|[-*+])\s+/u;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An item that opens with a date and runs straight on into a title, with no full stop (- 平成25年8月23日命を守るために…): a
|
|
8
|
+
* list of press releases or notices, each title quoted as it was published. Its form is not the writer's to align. A date
|
|
9
|
+
* followed by a particle (令和6年8月23日に…) opens the writer's own sentence.
|
|
10
|
+
*/
|
|
11
|
+
const DATED_TITLE = /^(?:(?:令和|平成|昭和)[0-90-9元]{1,2}|\d{4})年[0-90-9]{1,2}月[0-90-9]{1,2}日(?![にのはをがでとへもや、,。\s])[^。.]+$/u;
|
|
12
|
+
|
|
13
|
+
export const isDatedTitle = (written: string): boolean => DATED_TITLE.test(written.replace(LIST_MARKER, "").trim());
|
|
14
|
+
|
|
15
|
+
/** The note lead (※, 注:) an item opens with, if any. */
|
|
16
|
+
const noteLeadOf = (written: string, noteLeads: readonly string[]): string | undefined => {
|
|
17
|
+
const text = written.replace(LIST_MARKER, "").trimStart();
|
|
18
|
+
return noteLeads.find((lead) => lead !== "" && text.startsWith(lead));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Items that open with a note lead fewer than half the group's items share (- ※電話によるご意見は… after - (1)郵送…): a note on
|
|
23
|
+
* the list set as one more bullet, not one of its items. Items that all open with ※ are compared among themselves.
|
|
24
|
+
*/
|
|
25
|
+
export const noteItems = (written: readonly string[], noteLeads: readonly string[]): ReadonlySet<number> => {
|
|
26
|
+
const leads = written.map((text) => noteLeadOf(text, noteLeads));
|
|
27
|
+
const share = (lead: string): number => leads.filter((other) => other === lead).length;
|
|
28
|
+
return new Set(leads.flatMap((lead, index) => (lead !== undefined && share(lead) * 2 < written.length ? [index] : [])));
|
|
29
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Token } from "../plugin.ts";
|
|
2
|
+
import { isFiniteVerb } from "./list-item-phrase.ts";
|
|
3
|
+
|
|
4
|
+
/** Words opening with a subject pronoun and its finite verb (you will also need a change of clothes): a sentence, closed or not. */
|
|
5
|
+
export const opensWithClause = (words: readonly Token[], isSubject: (token: Token) => boolean): boolean => {
|
|
6
|
+
const [subject, ...rest] = words;
|
|
7
|
+
const verb = rest.find((token) => token.pos !== "ADV");
|
|
8
|
+
return subject !== undefined && verb !== undefined && isSubject(subject) && isFiniteVerb(verb);
|
|
9
|
+
};
|
|
@@ -41,6 +41,13 @@ export const openingOf = (scope: ItemScope, item: TokenRange): Token | undefined
|
|
|
41
41
|
|
|
42
42
|
export const isParticiple = (token: Token): boolean => token.features?.["VerbForm"] === "Part";
|
|
43
43
|
|
|
44
|
+
/** 前置詞で始まる項目。解析器は冠詞の前の to(to the extent practicable)も不定詞の to と読むので、冠詞が続けば前置詞と読む。 */
|
|
45
|
+
export const opensAsPreposition = (scope: ItemScope, item: TokenRange): boolean => {
|
|
46
|
+
const at = firstAt(scope, "open", item);
|
|
47
|
+
const [opening, next] = [scope.sentence.tokens[at], scope.sentence.tokens[at + 1]];
|
|
48
|
+
return opening?.pos === "ADP" || (opening?.surface.toLowerCase() === "to" && next?.pos === "DET");
|
|
49
|
+
};
|
|
50
|
+
|
|
44
51
|
export const openingKind = (scope: ItemScope, item: TokenRange): string | undefined => {
|
|
45
52
|
const opening = openingOf(scope, item);
|
|
46
53
|
return opening !== undefined && isParticiple(opening) ? "PARTICIPLE" : shapeOf(scope, item);
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
isClause,
|
|
8
8
|
lastContent,
|
|
9
9
|
openingOf,
|
|
10
|
+
opensAsPreposition,
|
|
10
11
|
participleOpening,
|
|
11
12
|
shapeOf,
|
|
12
13
|
} from "./list-item.ts";
|
|
@@ -105,9 +106,19 @@ const freeze = (frozen: Frozen, scope: ItemScope, item: TokenRange): void => {
|
|
|
105
106
|
recordFlags(frozen, scope, item, content);
|
|
106
107
|
};
|
|
107
108
|
|
|
108
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* 形容詞のあとの読点は、名詞の前で形容詞を重ねているだけのことが多い(the long, winding bridge)。次の項目が名詞で終わるならつなげ直す。
|
|
111
|
+
* 名詞の後ろに置いた形容詞(to the extent practicable)は名詞の句を閉じているので、つなげない。
|
|
112
|
+
*/
|
|
109
113
|
const stacks = (scope: ItemScope, previous: TokenRange, item: TokenRange): boolean =>
|
|
110
|
-
lastContent(scope, previous)?.pos === "ADJ" && lastContent(scope, item)?.pos !== "ADJ";
|
|
114
|
+
lastContent(scope, previous)?.pos === "ADJ" && !closesNounPhrase(scope, previous) && lastContent(scope, item)?.pos !== "ADJ";
|
|
115
|
+
|
|
116
|
+
/** 前置詞で始まり、名詞とその後ろの形容詞で終わる項目(to the extent practicable / in the manner necessary)。 */
|
|
117
|
+
const closesNounPhrase = (scope: ItemScope, item: TokenRange): boolean => {
|
|
118
|
+
const { tokens } = scope.sentence;
|
|
119
|
+
const end = tokens.slice(item.start, item.end).findLastIndex((token) => token.pos === "ADJ") + item.start;
|
|
120
|
+
return opensAsPreposition(scope, item) && tokens[end - 1]?.pos === "NOUN";
|
|
121
|
+
};
|
|
111
122
|
|
|
112
123
|
/** 1 つの深さの並び。start は節の頭、rawStart は読点でまだ閉じていない項目の頭、pending は次の項目とつながりうる最後の項目。 */
|
|
113
124
|
type LevelItems = {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { firstAt, hasContent } from "./list-item.ts";
|
|
2
|
+
import { firstOf, secondOf, withoutFirst, type View } from "./list-view.ts";
|
|
3
|
+
|
|
4
|
+
// 文頭の接続詞(And if you have questions about any of this, come in and ask)は前の文とつなぐ語で、並びの項目の一部ではない。
|
|
5
|
+
|
|
6
|
+
const SENTENCE_MARKS = new Set(["PUNCT", "SYM"]);
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 文頭の接続詞(And if you have questions about any of this, come in and ask / But when …,)を外した並び。接続詞の後ろの
|
|
10
|
+
* 導入の句(if …,)を導入の句として確かめるため。文頭が接続詞でなければ undefined。
|
|
11
|
+
*/
|
|
12
|
+
export const withoutOpeningConjunction = (view: View): View | undefined => {
|
|
13
|
+
const { scope } = view.list;
|
|
14
|
+
const first = firstOf(view);
|
|
15
|
+
if (first === undefined || secondOf(view) === undefined) return undefined;
|
|
16
|
+
const at = firstAt(scope, "open", first.item);
|
|
17
|
+
const { tokens } = scope.sentence;
|
|
18
|
+
const opensSentence = tokens.slice(0, at).every((token) => SENTENCE_MARKS.has(token.pos));
|
|
19
|
+
if (!opensSentence || tokens[at]?.pos !== "CCONJ") return undefined;
|
|
20
|
+
const rest = { start: at + 1, end: first.item.end };
|
|
21
|
+
return hasContent(scope, rest) ? { ...withoutFirst(view), pre: rest } : undefined;
|
|
22
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Whether the items of one bulleted list share a form: all phrases or all sentences, all opening with a verb or all with
|
|
2
2
|
// a noun. Pure; reads the item sentences' tokens. Which form is right is the writer's choice, so only the minority within
|
|
3
3
|
// one list is reported. です/ます against plain endings inside a list is no-mixed-desumasu's, not this.
|
|
4
|
+
import { isDatedTitle, noteItems } from "./list-item-asides.ts";
|
|
4
5
|
import { minorityWithin } from "../orthography.ts";
|
|
5
6
|
import { isQuotedAt } from "./bold-label.ts";
|
|
6
7
|
import { endsAsHeadline, markOrSkipped, withoutFootnoteReference, withoutTrailingMarks } from "./list-item-ending.ts";
|
|
@@ -8,6 +9,8 @@ import type { BulletList, Detector, Finding, ProseDocument, Sentence, Span, Toke
|
|
|
8
9
|
import { isLinkLabel } from "./link-label.ts";
|
|
9
10
|
import { itemLayout, splitAtLeadIns } from "./list-layout.ts";
|
|
10
11
|
import { closesAsSentence, isFiniteVerb, isNounPhraseWithVerbs, isPastForm, isVerb, NOMINAL, NOUN_HEAD, opensObject } from "./list-item-phrase.ts";
|
|
12
|
+
import { opensWithClause } from "./list-item-clause.ts";
|
|
13
|
+
import { openingSeries, seriesTakesObject } from "./list-verb-series.ts";
|
|
11
14
|
|
|
12
15
|
/** What an item is made of: a phrase or a sentence (ending), and the word it opens with (head, English only). */
|
|
13
16
|
export type Axis = "ending" | "head";
|
|
@@ -113,7 +116,7 @@ const japaneseEnding = (item: readonly Sentence[], headlineEndings: ReadonlySet<
|
|
|
113
116
|
* English: a sentence closes with a full stop and has a finite verb outside a noun phrase; a phrase has neither, nor any
|
|
114
117
|
* verb but those of its noun phrase. Anything between is not judged.
|
|
115
118
|
*/
|
|
116
|
-
const englishEnding = (item: readonly Sentence[]): string | undefined => {
|
|
119
|
+
const englishEnding = (item: readonly Sentence[], context: HeadContext): string | undefined => {
|
|
117
120
|
const sentences = ownEnding(item);
|
|
118
121
|
const tokens = sentences.flatMap((sentence) => sentence.tokens ?? []);
|
|
119
122
|
if (tokens.length === 0) return undefined;
|
|
@@ -122,6 +125,8 @@ const englishEnding = (item: readonly Sentence[]): string | undefined => {
|
|
|
122
125
|
// A noun phrase with a stray full stop (Shelter – a charity who offer advice.) says nothing: neither form.
|
|
123
126
|
const nounPhrase = isNounPhraseWithVerbs(tokens);
|
|
124
127
|
if (closed) return tokens.some(isFiniteVerb) && !nounPhrase ? "sentence" : undefined;
|
|
128
|
+
const words = tokens.filter((token) => !SKIPPED_AT_END.has(token.pos));
|
|
129
|
+
if (opensWithClause(words, (token) => isSubjectPronoun(token, context))) return "sentence";
|
|
125
130
|
return (nounPhrase || !tokens.some(isVerb)) && !isUnsure(tokens[0]) ? "phrase" : undefined;
|
|
126
131
|
};
|
|
127
132
|
|
|
@@ -205,18 +210,11 @@ const verbOrAdjective: HeadReader = (tokens, at, context) => {
|
|
|
205
210
|
const instructionVerb: HeadReader = (tokens, at, context) =>
|
|
206
211
|
context.instructionVerbs.has(tokens[at]?.surface.toLowerCase() ?? "") && tokens[at + 1]?.pos !== "NOUN" ? "verb" : undefined;
|
|
207
212
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (word === undefined) return [];
|
|
214
|
-
const after = tokens.findIndex((token, index) => index > at && !isSeriesJoint(token));
|
|
215
|
-
return after === -1 || after === at + 1 ? [word] : [word, ...openingSeries(tokens, after)];
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
/** A series one of whose later words is a verb in its base form (Instrument, monitor and profile): it is a series of verbs. */
|
|
219
|
-
const seriesOfVerbs: HeadReader = (tokens, at) => (openingSeries(tokens, at).slice(1).some(isBaseVerb) ? "verb" : undefined);
|
|
213
|
+
/**
|
|
214
|
+
* A series one of whose later words is a verb in its base form (Instrument, monitor and profile), or that "the", "a" or
|
|
215
|
+
* "your" follows (Dry and lube the chain): it is a series of verbs.
|
|
216
|
+
*/
|
|
217
|
+
const seriesOfVerbs: HeadReader = (tokens, at) => (seriesTakesObject(tokens, at) || openingSeries(tokens, at).slice(1).some(isBaseVerb) ? "verb" : undefined);
|
|
220
218
|
|
|
221
219
|
/**
|
|
222
220
|
* The first two words overrule the first word's tag. "Open the console" and "Press the button" open with a verb. "Clean up
|
|
@@ -316,7 +314,7 @@ const leadsIn = (sentences: readonly Sentence[]): boolean => LEAD_IN.test(senten
|
|
|
316
314
|
export const formOf = (axis: Axis, sentences: readonly Sentence[], language: string, context: HeadContext = NO_HEAD_CONTEXT): string | undefined => {
|
|
317
315
|
if (axis === "ending" && leadsIn(sentences)) return undefined;
|
|
318
316
|
if (language === "ja") return axis === "ending" ? japaneseEnding(sentences, context.headlineEndings) : undefined;
|
|
319
|
-
return axis === "ending" ? englishEnding(sentences) : englishHead(sentences, context);
|
|
317
|
+
return axis === "ending" ? englishEnding(sentences, context) : englishHead(sentences, context);
|
|
320
318
|
};
|
|
321
319
|
|
|
322
320
|
const within = (inner: Span, outer: Span): boolean => inner.start >= outer.start && inner.end <= outer.end;
|
|
@@ -446,10 +444,11 @@ const groupFindings = (doc: ProseDocument, itemSpans: readonly Span[], heads: re
|
|
|
446
444
|
const linkEndings = (doc.lexicons["link-label-ending"] ?? []).map((entry) => entry.pattern);
|
|
447
445
|
const sentencesOf = itemSpans.map((span) => ownSentences(doc, span, noteLeads));
|
|
448
446
|
if (sentencesOf.some(runsOn)) return [];
|
|
447
|
+
const writtenOf = itemSpans.map((span, index) => doc.source.slice(span.start, writtenEnd(doc, span, sentencesOf[index] ?? [], noteLeads)));
|
|
448
|
+
const notes = noteItems(writtenOf, noteLeads);
|
|
449
449
|
const judged = sentencesOf.filter((sentences, index) => {
|
|
450
|
-
const span = itemSpans[index];
|
|
451
|
-
if (span === undefined) return false;
|
|
452
|
-
const written = doc.source.slice(span.start, writtenEnd(doc, span, sentences, noteLeads));
|
|
450
|
+
const [span, written] = [itemSpans[index], writtenOf[index]];
|
|
451
|
+
if (span === undefined || written === undefined || notes.has(index) || isDatedTitle(written)) return false;
|
|
453
452
|
return isJudged(written, sentences) && !isLinkLabel(written, linkEndings) && !(heads.includes(span) && isGroupLabel(sentences, doc.language));
|
|
454
453
|
});
|
|
455
454
|
const context = headContext(doc, judged);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Whether a list goes on past an and / or. Then that and / or is inside an item, not the list's last joint, and it casts no
|
|
2
2
|
// vote on the serial comma. Pure.
|
|
3
|
-
import { hasAdposition, hasVerb,
|
|
4
|
-
import { isListConjunction, type ItemScope } from "./list-sentence.ts";
|
|
3
|
+
import { hasAdposition, hasVerb, itemAfter, leadShape, openingOf } from "./list-item.ts";
|
|
4
|
+
import { isListConjunction, NOMINAL, VERBAL, type ItemScope } from "./list-sentence.ts";
|
|
5
5
|
import type { TokenRange } from "./token-column.ts";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -85,6 +85,19 @@ export const walker = (): Walk => {
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
/** 述語でない動詞の前の語。不定詞の to(to reflect)と、前置詞のあとの分詞や動名詞(as needed / by notifying)。 */
|
|
89
|
+
const NON_PREDICATE_LEAD: ReadonlySet<string> = new Set(["ADP", "SCONJ", "PART"]);
|
|
90
|
+
|
|
91
|
+
/** 主語と述語のある項目(and figs fell)。Duration of Processing as needed は名詞の句で、as needed は述語ではない。 */
|
|
92
|
+
const isPredicateClause = (scope: ItemScope, item: TokenRange): boolean => {
|
|
93
|
+
const { tokens } = scope.sentence;
|
|
94
|
+
const opening = openingOf(scope, item);
|
|
95
|
+
if (opening === undefined || !(opening.pos === "DET" || NOMINAL.has(opening.pos))) return false;
|
|
96
|
+
return tokens
|
|
97
|
+
.slice(item.start, item.end)
|
|
98
|
+
.some((token, offset) => VERBAL.has(token.pos) && !NON_PREDICATE_LEAD.has(tokens[item.start + offset - 1]?.pos ?? ""));
|
|
99
|
+
};
|
|
100
|
+
|
|
88
101
|
/**
|
|
89
102
|
* 項目を挟んで読み進めるのは、and の後ろが前置詞も動詞も連れない短い項目のときだけ。長い項目の尻からは次の並びが始まりうる
|
|
90
103
|
* (the duties of loyalty, care, good faith, and candour into criteria governing engagement optimisation, aggregate harm
|
|
@@ -95,6 +108,6 @@ export const listContinues = (scope: ItemScope, afterItem: TokenRange, walk: Wal
|
|
|
95
108
|
if (shape === undefined || !levelComma(scope, afterItem.end)) return false;
|
|
96
109
|
const following = conjunctionAfter(scope, afterItem.end, shape);
|
|
97
110
|
const next = itemAfter(scope, afterItem.end + 1);
|
|
98
|
-
if (following !== undefined) return following && (endsOpenList(scope, next) ||
|
|
111
|
+
if (following !== undefined) return following && (endsOpenList(scope, next) || isPredicateClause(scope, next) === isPredicateClause(scope, afterItem));
|
|
99
112
|
return !hasAdposition(scope, afterItem) && !hasVerb(scope, afterItem) && walk(scope, afterItem.end, shape);
|
|
100
113
|
};
|
|
@@ -28,6 +28,8 @@ export type ListWords = {
|
|
|
28
28
|
readonly elision?: readonly string[];
|
|
29
29
|
/** 並びの残りを言う語(so forth / the like)。and so forth の前まで並びが続く。 */
|
|
30
30
|
readonly openListEnd?: ReadonlySet<string>;
|
|
31
|
+
/** 読点で挟んで名前に添える関係節を始める語(who / which)。Tom, who repaired radios, opened … の節は並びの項目ではない。 */
|
|
32
|
+
readonly asideRelative?: ReadonlySet<string>;
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
const LIST_CONJUNCTION: ReadonlySet<string> = new Set(["and", "or"]);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Token } from "../plugin.ts";
|
|
2
|
+
import { opensObject } from "./list-item-phrase.ts";
|
|
3
|
+
|
|
4
|
+
// The words of a series an English list item opens with (Scope, estimate and describe tasks; Dry and lube the chain). Pure.
|
|
5
|
+
|
|
6
|
+
const isSeriesJoint = (token: Token): boolean => token.surface === "," || token.pos === "CCONJ";
|
|
7
|
+
|
|
8
|
+
/** The single words of a series the item opens with: "Scope, estimate and describe tasks" gives Scope, estimate, describe. */
|
|
9
|
+
export const openingSeries = (tokens: readonly Token[], at: number): readonly Token[] => {
|
|
10
|
+
const word = tokens[at];
|
|
11
|
+
if (word === undefined) return [];
|
|
12
|
+
const after = tokens.findIndex((token, index) => index > at && !isSeriesJoint(token));
|
|
13
|
+
return after === -1 || after === at + 1 ? [word] : [word, ...openingSeries(tokens, after)];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** The tags a verb the tagger misread may carry (Dry as an adjective, lube as a noun); a preposition (from) never is one. */
|
|
17
|
+
const VERB_SHAPED: ReadonlySet<string> = new Set(["VERB", "NOUN", "ADJ"]);
|
|
18
|
+
|
|
19
|
+
/** A series of two words or more, each one a verb could be, that "the", "a" or "your" follows: verbs and their object. */
|
|
20
|
+
export const seriesTakesObject = (tokens: readonly Token[], at: number): boolean => {
|
|
21
|
+
const series = openingSeries(tokens, at);
|
|
22
|
+
const last = series.at(-1);
|
|
23
|
+
return series.length > 1 && series.every((word) => VERB_SHAPED.has(word.pos)) && last !== undefined && opensObject(tokens[tokens.indexOf(last) + 1]);
|
|
24
|
+
};
|
|
@@ -14,6 +14,8 @@ import { divisionLabelPattern, isDivisionSeparator } from "./division-label-sepa
|
|
|
14
14
|
import { isInCopiedText } from "./hyphen-copied-text.ts";
|
|
15
15
|
import { joinsNameSuffix } from "./hyphen-name-suffix.ts";
|
|
16
16
|
import { verseBlockSpans } from "./verse-block.ts";
|
|
17
|
+
import { inlineItemLabelOffsets } from "./inline-item-label.ts";
|
|
18
|
+
import { unclosedCodeQuoteOffsets } from "../unclosed-code-quote.ts";
|
|
17
19
|
|
|
18
20
|
/** The letters a mark must touch to count as part of the document's text, by language. */
|
|
19
21
|
const SCRIPT: Readonly<Record<string, RegExp>> = {
|
|
@@ -82,15 +84,36 @@ const sidedFinding = (item: Sided, values: Finding["values"], variant?: string):
|
|
|
82
84
|
values: { ...values, offset: item.offset },
|
|
83
85
|
});
|
|
84
86
|
|
|
85
|
-
/** The
|
|
86
|
-
const
|
|
87
|
+
/** The odd items, each its own slip, or with the one before it when joins says they are one slip. */
|
|
88
|
+
const slipsOf = <T>(odd: readonly T[], joins: (previous: T, item: T) => boolean): T[][] =>
|
|
89
|
+
odd.reduce<T[][]>((slips, item) => {
|
|
90
|
+
const last = slips.at(-1);
|
|
91
|
+
const previous = last?.at(-1);
|
|
92
|
+
if (last !== undefined && previous !== undefined && last.length === 1 && joins(previous, item)) last.push(item);
|
|
93
|
+
else slips.push([item]);
|
|
94
|
+
return slips;
|
|
95
|
+
}, []);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The less common way, one finding per slip, or one finding for a document written both ways (spacing-minority.ts). The
|
|
99
|
+
* counts stay in items: a slip of two items is two of the places that differ.
|
|
100
|
+
*/
|
|
101
|
+
const minorityFindings = <T extends Sided>(
|
|
102
|
+
items: readonly T[],
|
|
103
|
+
limit: number,
|
|
104
|
+
valuesOf: (slip: readonly T[]) => Finding["values"],
|
|
105
|
+
joins: (previous: T, item: T) => boolean = () => false,
|
|
106
|
+
): Finding[] => {
|
|
87
107
|
const report = minorityReport(items, limit);
|
|
88
108
|
if (report === undefined) return [];
|
|
89
109
|
if (report.mode === "mixed") {
|
|
90
110
|
const { first, odd, spaced, touching } = report;
|
|
91
|
-
return [sidedFinding(first, { ...valuesOf(first), spaced, touching, count: odd, of: items.length, limit }, "mixed")];
|
|
111
|
+
return [sidedFinding(first, { ...valuesOf([first]), spaced, touching, count: odd, of: items.length, limit }, "mixed")];
|
|
92
112
|
}
|
|
93
|
-
return report.odd.
|
|
113
|
+
return slipsOf(report.odd, joins).flatMap((slip) => {
|
|
114
|
+
const first = slip[0];
|
|
115
|
+
return first === undefined ? [] : [sidedFinding(first, { ...valuesOf(slip), count: report.odd.length, of: items.length, limit })];
|
|
116
|
+
});
|
|
94
117
|
};
|
|
95
118
|
|
|
96
119
|
/** Sentences written in the document's own language; a quoted sentence in another language follows its own marks. */
|
|
@@ -123,23 +146,13 @@ const enumeratorIn = (line: string): readonly number[] => {
|
|
|
123
146
|
};
|
|
124
147
|
|
|
125
148
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
149
|
+
* The offsets in `source` of each line's label's opening and closing bracket, and of the brackets of an item number set
|
|
150
|
+
* inside a line: after a sentence on a joined line, continuing a run of items, or in an address (上記4(2)で, 第3条(a)(1)).
|
|
128
151
|
*/
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
const addressBrackets = (match: RegExpMatchArray & { index: number }): number[] => {
|
|
132
|
-
const end = match.index + match[0].length - 1;
|
|
133
|
-
return [match.index + match[0].search(/[((]/u), end];
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
/** The offsets in `source` of each line's label's opening and closing bracket, and of the brackets of an item's address. */
|
|
137
|
-
export const enumeratorBracketOffsets = (source: string): ReadonlySet<number> => {
|
|
152
|
+
export const enumeratorBracketOffsets = (source: string, conjunctions: readonly string[] = []): ReadonlySet<number> => {
|
|
138
153
|
const starts = lineStarts(source);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
...[...source.matchAll(ITEM_ADDRESS)].flatMap(addressBrackets),
|
|
142
|
-
]);
|
|
154
|
+
const heads = source.split("\n").flatMap((line, index) => enumeratorIn(line).map((at) => (starts[index] ?? 0) + at));
|
|
155
|
+
return new Set([...heads, ...inlineItemLabelOffsets(source, isLineLabel, new Set(heads), conjunctions)]);
|
|
143
156
|
};
|
|
144
157
|
|
|
145
158
|
/** Appended to a mark's kind for an item number's bracket. A lexicon's group, a word from YAML, never holds a NUL. */
|
|
@@ -203,6 +216,12 @@ const withNoteAddressKind = (mark: Mark, addresses: ReadonlySet<number>): Mark =
|
|
|
203
216
|
const withNoteKind = (mark: Mark, notes: ReadonlySet<number>): Mark =>
|
|
204
217
|
notes.has(mark.offset) && !mark.form.kind.endsWith(ENUMERATOR_KIND) ? { ...mark, form: { ...mark.form, kind: `${mark.form.kind}${NOTE_KIND}` } } : mark;
|
|
205
218
|
|
|
219
|
+
/** A closing bracket of the same width right after its opening one, with no bracket between (資料(案)): one slip, not two. */
|
|
220
|
+
const closesPair = (source: string, opening: Mark, closing: Mark): boolean =>
|
|
221
|
+
opening.sentence === closing.sentence &&
|
|
222
|
+
CLOSER_OF[opening.char] === closing.char &&
|
|
223
|
+
!/[()()[\][]]/u.test(source.slice(opening.offset + 1, closing.offset));
|
|
224
|
+
|
|
206
225
|
/**
|
|
207
226
|
* A mark written two ways in one document (( and (, “ and "), the less common way reported. The two ways come from the
|
|
208
227
|
* lexicon; neither is called right. Only marks next to a letter of the document's script count, so a bracket in code-like
|
|
@@ -215,21 +234,26 @@ export const markConsistency: Detector = (doc, options): Finding[] => {
|
|
|
215
234
|
// A link that quotes an outside page's title keeps that page's marks ((コンテキスト内) in a WCAG title), and a quotation
|
|
216
235
|
// of the document's own heading keeps the heading's.
|
|
217
236
|
const titles = [...externalLinkTitleSpans(doc.source, doc.links), ...ownTitleQuoteSpans(doc.source, doc.markup?.headings ?? [], new Set(forms.keys()))];
|
|
218
|
-
const enumerators = enumeratorBracketOffsets(
|
|
237
|
+
const enumerators = enumeratorBracketOffsets(
|
|
238
|
+
doc.source,
|
|
239
|
+
(doc.lexicons["list-conjunction"] ?? []).map((entry) => entry.pattern),
|
|
240
|
+
);
|
|
219
241
|
const doubled = doubledParenOffsets(doc.source);
|
|
220
242
|
const notes = noteMarkerOffsets(doc.source);
|
|
221
243
|
const noteAddresses = noteAddressOffsets(doc.source);
|
|
244
|
+
const codeQuotes = unclosedCodeQuoteOffsets(doc.source);
|
|
222
245
|
const marks = ownSentences(doc).flatMap((sentence) =>
|
|
223
|
-
marksIn(doc.source, sentence, forms, script)
|
|
224
|
-
|
|
225
|
-
|
|
246
|
+
marksIn(doc.source, sentence, forms, script)
|
|
247
|
+
.filter((mark) => !codeQuotes.has(mark.offset))
|
|
248
|
+
.map((mark) => withNoteAddressKind(withNoteKind(withDoubledKind(withEnumeratorKind(mark, enumerators), doubled), notes), noteAddresses)),
|
|
226
249
|
);
|
|
227
250
|
const kinds = [...new Set(marks.map((mark) => mark.form.kind))];
|
|
228
251
|
return kinds.flatMap((kind) =>
|
|
229
252
|
minorityFindings(
|
|
230
253
|
marks.filter((mark) => mark.form.kind === kind && !isWithinAny(titles, { start: mark.offset, end: mark.offset + 1 })),
|
|
231
254
|
options.limit,
|
|
232
|
-
(
|
|
255
|
+
(slip) => ({ mark: slip.map((mark) => mark.char).join(""), usual: slip.map((mark) => mark.form.other).join("") }),
|
|
256
|
+
(opening, closing) => closesPair(doc.source, opening, closing),
|
|
233
257
|
),
|
|
234
258
|
);
|
|
235
259
|
};
|
|
@@ -263,9 +287,9 @@ export const sentenceGaps = (doc: ProseDocument): Sided[] => {
|
|
|
263
287
|
|
|
264
288
|
/** One space between sentences and two, mixed in one document: the less common is reported. */
|
|
265
289
|
export const sentenceSpacing: Detector = (doc, options): Finding[] =>
|
|
266
|
-
minorityFindings(sentenceGaps(doc), options.limit, (gap) => ({
|
|
267
|
-
spaces: gap
|
|
268
|
-
usual: gap
|
|
290
|
+
minorityFindings(sentenceGaps(doc), options.limit, ([gap]) => ({
|
|
291
|
+
spaces: gap?.spaced === true ? TWO_SPACES.length : ONE_SPACE.length,
|
|
292
|
+
usual: gap?.spaced === true ? ONE_SPACE.length : TWO_SPACES.length,
|
|
269
293
|
}));
|
|
270
294
|
|
|
271
295
|
type Hit = { readonly sentence: Sentence; readonly matched: string; readonly offset: number };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Markdown that does not render the way it was written: a table row with more cells than its header (GFM drops the
|
|
2
|
-
// extra ones), a code fence that is never closed (the rest of the document becomes code), and strong-emphasis marks
|
|
2
|
+
// extra ones), a line run into a table as one more row, a code fence that is never closed (the rest of the document becomes code), and strong-emphasis marks
|
|
3
3
|
// (`**`) that Markdown cannot pair and shows as they are. Pure; reads the source's Markdown tree.
|
|
4
4
|
import type { Detector, Finding, ProseDocument, Span } from "../plugin.ts";
|
|
5
5
|
import { readMarkdown } from "../markdown-read.ts";
|
|
@@ -51,6 +51,30 @@ export const tableRowOverflow: Detector = (doc): Finding[] => {
|
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
/** A bar written as a cell border, not as `\|` inside a value. */
|
|
55
|
+
const CELL_BORDER = /(?<!\\)\|/u;
|
|
56
|
+
|
|
57
|
+
/** With one column, a row needs no bar; from two on, a row with none can only be a line that ran into the table. */
|
|
58
|
+
const MIN_COLUMNS = 2;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A line written right under a table with no blank line between: GFM reads it as one more row, so the sentence shows in the
|
|
62
|
+
* table's first cell. Its source has no cell border at all.
|
|
63
|
+
*/
|
|
64
|
+
export const tableAbsorbedLine: Detector = (doc): Finding[] => {
|
|
65
|
+
const root = markdownRoot(doc);
|
|
66
|
+
if (root === undefined) return [];
|
|
67
|
+
return nodesOf(root, "table").flatMap((table) => {
|
|
68
|
+
const [header, ...body] = table.children ?? [];
|
|
69
|
+
if ((header?.children?.length ?? 0) < MIN_COLUMNS) return [];
|
|
70
|
+
return body.flatMap((row) => {
|
|
71
|
+
const span = spanOf(row);
|
|
72
|
+
const written = span === undefined ? "" : doc.source.slice(span.start, span.end);
|
|
73
|
+
return span === undefined || CELL_BORDER.test(written) || written.trim() === "" ? [] : [findingAt(doc, span, { line: written.trim() })];
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
54
78
|
/** A fence opening a code block: three or more backticks or tildes, after up to three spaces. */
|
|
55
79
|
const FENCE_OPEN = /^ {0,3}(`{3,}|~{3,})/u;
|
|
56
80
|
|