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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// A Markdown link written the wrong way round, `(text)[address]`: Markdown makes no link of it and shows the brackets
|
|
2
|
+
// and the address as they are. Pure; reads the text the reader sees.
|
|
3
|
+
import type { Detector, Finding } from "../plugin.ts";
|
|
4
|
+
import { findingAt, markupOf } from "./markup-finding.ts";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Round brackets right before square ones, as `[text](address)` reversed. A `\` or a `]` before the `(` is not
|
|
8
|
+
* the start of one, and a `^` after the `[` is a note mark (`(see)[^1]`).
|
|
9
|
+
*/
|
|
10
|
+
const ROUND_THEN_SQUARE = /(?<![\\\]])\(([^()\n]+)\)\[([^[\]\s^][^[\]\s]*)\]/gu;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* What the square brackets hold must be an address, or `(1)[2]` and `(Smith 2020)[3]` would count: a scheme
|
|
14
|
+
* (`https://`, `mailto:`), `www.`, a path (`/`, `./`, `../`), an anchor (`#setup`), or a page (`setup.md`).
|
|
15
|
+
*/
|
|
16
|
+
const ADDRESSES: readonly RegExp[] = [
|
|
17
|
+
/^[a-z][a-z0-9+.-]*:\/\/\S+$/iu,
|
|
18
|
+
/^(?:mailto:|www\.|#)\S+$/iu,
|
|
19
|
+
/^\.{0,2}\/\S*$/u,
|
|
20
|
+
/^\S+\.(?:md|mdx|html?|pdf)(?:#\S*)?$/iu,
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const isAddress = (written: string): boolean => ADDRESSES.some((address) => address.test(written));
|
|
24
|
+
|
|
25
|
+
const IMAGE_MARK = "!";
|
|
26
|
+
|
|
27
|
+
export const reversedLink: Detector = (doc): Finding[] => {
|
|
28
|
+
const markup = markupOf(doc);
|
|
29
|
+
if (markup === undefined) return [];
|
|
30
|
+
return markup.texts.flatMap((text) =>
|
|
31
|
+
[...doc.source.slice(text.start, text.end).matchAll(ROUND_THEN_SQUARE)]
|
|
32
|
+
.filter((match) => isAddress(match[2] ?? ""))
|
|
33
|
+
.map((match) => {
|
|
34
|
+
const start = text.start + match.index;
|
|
35
|
+
const span = { start: doc.source.charAt(start - 1) === IMAGE_MARK ? start - 1 : start, end: start + match[0].length };
|
|
36
|
+
return findingAt(doc, span, { text: match[1] ?? "", url: match[2] ?? "" });
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Detector, Token } from "../plugin.ts";
|
|
2
|
+
import { markedWordDetector } from "./marked-word.ts";
|
|
3
|
+
|
|
4
|
+
/** 言語アダプタが、さ入れ言葉の一部の語に付ける印(lang-ja の CausativeSa=Inserted)。 */
|
|
5
|
+
const isSaInserted = (token: Token): boolean => token.features?.["CausativeSa"] === "Inserted";
|
|
6
|
+
|
|
7
|
+
export const saIre: Detector = markedWordDetector(isSaInserted);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Detector, DetectorOptions, Finding, Lexicon, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
1
|
+
import type { Detector, DetectorOptions, Finding, LengthUnit, Lexicon, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
2
2
|
import { escapeRegExp } from "../orthography.ts";
|
|
3
3
|
import { isWithinAny, quotedIn } from "../quoted-span.ts";
|
|
4
4
|
import { entryOpens } from "./lexicon-match.ts";
|
|
@@ -6,6 +6,7 @@ import { laterAlternatives, laterJoined } from "../alternative-words.ts";
|
|
|
6
6
|
import { isContrastiveGa } from "./adversative-ga.ts";
|
|
7
7
|
import { isFlattenedTable } from "./sentence-parts.ts";
|
|
8
8
|
import { bareListCommas } from "./bare-word-list.ts";
|
|
9
|
+
import { definedTerms } from "../structure/definition-use.ts";
|
|
9
10
|
|
|
10
11
|
type TokenTest = (token: Token, at: number, tokens: readonly Token[]) => boolean;
|
|
11
12
|
|
|
@@ -15,11 +16,11 @@ const wordsOf = (lexicon: Lexicon | undefined): ReadonlySet<string> => new Set((
|
|
|
15
16
|
export const FIXED_TERM_LEXICON = "teki-fixed-term";
|
|
16
17
|
|
|
17
18
|
/** Where the sentence holds one of the terms, in the document's coordinates. */
|
|
18
|
-
const termSpans = (sentence: Sentence, terms:
|
|
19
|
-
terms.flatMap((
|
|
20
|
-
[...sentence.text.matchAll(new RegExp(escapeRegExp(
|
|
19
|
+
const termSpans = (sentence: Sentence, terms: readonly string[]): Span[] =>
|
|
20
|
+
terms.flatMap((term) =>
|
|
21
|
+
[...sentence.text.matchAll(new RegExp(escapeRegExp(term), "gu"))].map((match) => ({
|
|
21
22
|
start: sentence.span.start + match.index,
|
|
22
|
-
end: sentence.span.start + match.index +
|
|
23
|
+
end: sentence.span.start + match.index + term.length,
|
|
23
24
|
})),
|
|
24
25
|
);
|
|
25
26
|
|
|
@@ -27,7 +28,7 @@ const termSpans = (sentence: Sentence, terms: Lexicon): Span[] =>
|
|
|
27
28
|
* The tokens of a sentence that pass the test, outside anything quoted in 「」『』 and outside the fixed terms: neither a
|
|
28
29
|
* quotation nor a term the law defines (電磁的方法) is the writer's to rephrase.
|
|
29
30
|
*/
|
|
30
|
-
const countedTokens = (sentence: Sentence, test: TokenTest, fixedTerms:
|
|
31
|
+
const countedTokens = (sentence: Sentence, test: TokenTest, fixedTerms: readonly string[]): Token[] => {
|
|
31
32
|
const kept = [...quotedIn(sentence), ...termSpans(sentence, fixedTerms)];
|
|
32
33
|
return (sentence.tokens ?? []).filter((token, at, tokens) => test(token, at, tokens) && !isWithinAny(kept, token.span));
|
|
33
34
|
};
|
|
@@ -43,7 +44,11 @@ const findingOf = (sentence: Sentence, counted: readonly Token[], limit: number)
|
|
|
43
44
|
|
|
44
45
|
const sentencesOver = (doc: ProseDocument, limit: number, test: TokenTest, fixedTerms: Lexicon = []): Finding[] =>
|
|
45
46
|
doc.sentences.flatMap((sentence) => {
|
|
46
|
-
const counted = countedTokens(
|
|
47
|
+
const counted = countedTokens(
|
|
48
|
+
sentence,
|
|
49
|
+
test,
|
|
50
|
+
fixedTerms.map((entry) => entry.pattern),
|
|
51
|
+
);
|
|
47
52
|
return counted.length > limit ? [findingOf(sentence, counted, limit)] : [];
|
|
48
53
|
});
|
|
49
54
|
|
|
@@ -62,6 +67,13 @@ const largestItem = (sentence: Sentence, counted: readonly Token[]): readonly To
|
|
|
62
67
|
return [...items.values()].reduce<readonly Token[]>((largest, item) => (item.length > largest.length ? item : largest), []);
|
|
63
68
|
};
|
|
64
69
|
|
|
70
|
+
/**
|
|
71
|
+
* The terms the document defines (「効果的な技術的保護手段」とは…) that hold one of the counted words. The word belongs to the
|
|
72
|
+
* term, which the document uses as it defined it, not to the writer's style.
|
|
73
|
+
*/
|
|
74
|
+
const termsHolding = (doc: ProseDocument, words: ReadonlySet<string>): readonly string[] =>
|
|
75
|
+
(doc.structure === undefined ? [] : definedTerms(doc.structure)).map(({ term }) => term).filter((term) => [...words].some((word) => term.includes(word)));
|
|
76
|
+
|
|
65
77
|
/**
|
|
66
78
|
* A sentence holding more than limit tokens written as one of the lexicon's words (the suffix 的). The options of one choice
|
|
67
79
|
* (連続的か断続的か、一時的) and a joined pair (信仰的主観的) count once: each names one point. A list written inside the sentence
|
|
@@ -82,11 +94,18 @@ export const sentenceWordCount: Detector = (doc, options): Finding[] => {
|
|
|
82
94
|
return found;
|
|
83
95
|
};
|
|
84
96
|
const isCounted: TokenTest = (token, at, tokens) => words.has(token.surface) && !laterOf(tokens).has(at);
|
|
85
|
-
const fixedTerms = doc.lexicons[FIXED_TERM_LEXICON] ?? [];
|
|
97
|
+
const fixedTerms = (doc.lexicons[FIXED_TERM_LEXICON] ?? []).map((entry) => entry.pattern);
|
|
98
|
+
const cache: { defined?: readonly string[] } = {};
|
|
99
|
+
// Read only when a sentence is over the limit: building the structure is the costly part.
|
|
100
|
+
const defined = (): readonly string[] => (cache.defined ??= termsHolding(doc, words));
|
|
86
101
|
return doc.sentences.flatMap((sentence) => {
|
|
87
102
|
if (isFlattenedTable(sentence.text)) return [];
|
|
88
|
-
const
|
|
89
|
-
|
|
103
|
+
const over = (terms: readonly string[]): readonly Token[] => {
|
|
104
|
+
const counted = largestItem(sentence, countedTokens(sentence, isCounted, terms));
|
|
105
|
+
return counted.length > options.limit ? counted : [];
|
|
106
|
+
};
|
|
107
|
+
const counted = over(fixedTerms).length === 0 ? [] : over([...fixedTerms, ...defined()]);
|
|
108
|
+
return counted.length === 0 ? [] : [findingOf(sentence, counted, options.limit)];
|
|
90
109
|
});
|
|
91
110
|
};
|
|
92
111
|
|
|
@@ -222,14 +241,17 @@ export const CONTINUING_LEXICON = "demonstrative-continuing";
|
|
|
222
241
|
const runCount = (run: readonly Opened[], continuing: ReadonlySet<string>): number =>
|
|
223
242
|
run.filter((opened, at) => !(opened.opener !== undefined && continuing.has(opened.opener) && run[at - 1]?.opener === opened.opener)).length;
|
|
224
243
|
|
|
225
|
-
|
|
244
|
+
/** Words are set apart by spaces, so sentences quoted together are too (…small purchases. This means …); characters are not. */
|
|
245
|
+
const joinerOf = (unit: LengthUnit): string => (unit === "char" ? "" : " ");
|
|
246
|
+
|
|
247
|
+
const runFinding = (run: readonly Opened[], count: number, options: DetectorOptions, unit: LengthUnit): Finding => {
|
|
226
248
|
const first = run[0];
|
|
227
249
|
return {
|
|
228
250
|
rule: "",
|
|
229
251
|
severity: "info",
|
|
230
252
|
line: 0,
|
|
231
253
|
column: 0,
|
|
232
|
-
quote: run.map(({ sentence }) => sentence.text.trim()).join(
|
|
254
|
+
quote: run.map(({ sentence }) => sentence.text.trim()).join(joinerOf(unit)),
|
|
233
255
|
values: { word: first?.opener ?? "", count, limit: options.limit, offset: first?.sentence.span.start ?? 0 },
|
|
234
256
|
};
|
|
235
257
|
};
|
|
@@ -243,6 +265,6 @@ export const openerRun: Detector = (doc, options): Finding[] => {
|
|
|
243
265
|
openerRuns(paragraph.sentences, lexicon, notOpeners)
|
|
244
266
|
.map((run) => ({ run, count: runCount(run, continuing) }))
|
|
245
267
|
.filter(({ count }) => count > options.limit)
|
|
246
|
-
.map(({ run, count }) => runFinding(run, count, options)),
|
|
268
|
+
.map(({ run, count }) => runFinding(run, count, options, doc.lengthUnit)),
|
|
247
269
|
);
|
|
248
270
|
};
|
|
@@ -11,8 +11,9 @@ import { chronologyRows } from "../chronology-rows.ts";
|
|
|
11
11
|
import { isNeutralPlainShape } from "./register-neutral-shape.ts";
|
|
12
12
|
import { spokenAnswerSentences } from "./register-interview.ts";
|
|
13
13
|
import { contactBlockSentences, fieldValueSentences, labelledQuoteSentences, referenceNoteSentences, tableCellSentences } from "./register-set-apart.ts";
|
|
14
|
-
import { endsInSetGreeting, isAddressed, isDeclaration, isExclamation, isTakenUp } from "./register-voice.ts";
|
|
14
|
+
import { endsInSetGreeting, isAddressed, isDeclaration, isExclamation, isFeelingAside, isTakenUp, pagePointerSentences } from "./register-voice.ts";
|
|
15
15
|
import { entriesForGenre } from "../lexicon-genres.ts";
|
|
16
|
+
import { headingRegisters, offRequired, regionOfGroup, requiredOf, requiresAny, type RequiredRegisters } from "./register-required.ts";
|
|
16
17
|
import type { Detector, Finding, LexiconEntry, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -43,7 +44,7 @@ type Entry = { readonly sentence: Sentence; readonly register: Register; readonl
|
|
|
43
44
|
|
|
44
45
|
/** 文の調子と quiet を決める語彙表。polite は polite-ending、neutral は neutral-ending、requests は neutral-request、wishes は neutral-wish、
|
|
45
46
|
* greetings は set-polite-phrase、declaration と resolves は declaration-particle と declaration-ending を文書の genre で絞ったもの、openers は takeup-opener、
|
|
46
|
-
* address は address-particle
|
|
47
|
+
* address は address-particle、asides は feeling-aside を文書の genre で絞ったもの。 */
|
|
47
48
|
type EndingWords = {
|
|
48
49
|
readonly polite: readonly LexiconEntry[];
|
|
49
50
|
readonly neutral: readonly LexiconEntry[];
|
|
@@ -54,6 +55,7 @@ type EndingWords = {
|
|
|
54
55
|
readonly resolves: readonly LexiconEntry[];
|
|
55
56
|
readonly openers: readonly LexiconEntry[];
|
|
56
57
|
readonly address: readonly LexiconEntry[];
|
|
58
|
+
readonly asides: readonly LexiconEntry[];
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
type Read = { readonly register: Register; readonly quiet: boolean };
|
|
@@ -68,6 +70,7 @@ const endingWords = (doc: ProseDocument, polite: readonly LexiconEntry[], genre:
|
|
|
68
70
|
resolves: entriesForGenre(doc.lexicons["declaration-ending"] ?? [], genre),
|
|
69
71
|
openers: doc.lexicons["takeup-opener"] ?? [],
|
|
70
72
|
address: doc.lexicons["address-particle"] ?? [],
|
|
73
|
+
asides: entriesForGenre(doc.lexicons["feeling-aside"] ?? [], genre),
|
|
71
74
|
});
|
|
72
75
|
|
|
73
76
|
/** 調子を持つ文のうち、指さない形か。next は同じ文書の次の文、between はその間の文字列。 */
|
|
@@ -78,6 +81,7 @@ const isQuiet = (sentence: Sentence, ending: readonly Token[], register: Registe
|
|
|
78
81
|
isDeclaration(sentence, ending, words.declaration, words.resolves) ||
|
|
79
82
|
isExclamation(sentence) ||
|
|
80
83
|
isAddressed(sentence, words.address) ||
|
|
84
|
+
isFeelingAside(sentence, ending, words.asides) ||
|
|
81
85
|
isTakenUp(next, between, words.openers);
|
|
82
86
|
|
|
83
87
|
const registerOfSentence = (doc: ProseDocument, index: number, words: EndingWords): Read | undefined => {
|
|
@@ -117,6 +121,7 @@ export const judgedSentences = (doc: ProseDocument, polite: readonly LexiconEntr
|
|
|
117
121
|
const asides = new Set([
|
|
118
122
|
...referenceNoteSentences(doc.sentences, doc.source),
|
|
119
123
|
...tableCellSentences(doc.sentences, doc.source),
|
|
124
|
+
...pagePointerSentences(doc.sections, doc.lexicons["page-pointer"] ?? []),
|
|
120
125
|
...spokenAnswerSentences(
|
|
121
126
|
doc,
|
|
122
127
|
(doc.lexicons["interviewer-mark"] ?? []).map((entry) => entry.pattern),
|
|
@@ -154,17 +159,53 @@ export const judgedSentences = (doc: ProseDocument, polite: readonly LexiconEntr
|
|
|
154
159
|
return found.map((entry): Entry => ({ ...entry, group: groupOf(entry.sentence.span.start, lists, runs) }));
|
|
155
160
|
};
|
|
156
161
|
|
|
162
|
+
const finding = (sentence: Sentence, values: Finding["values"], variant: string | undefined): Finding => ({
|
|
163
|
+
rule: "no-mixed-desumasu",
|
|
164
|
+
severity: "warning",
|
|
165
|
+
line: 0,
|
|
166
|
+
column: 0,
|
|
167
|
+
quote: sentence.text.trim(),
|
|
168
|
+
...(variant === undefined ? {} : { variant }),
|
|
169
|
+
values,
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
/** The variant naming the register a team requires: the message says which one this spot should be in. */
|
|
173
|
+
const REQUIRED_VARIANT: Readonly<Record<Register, string>> = { polite: "required-desumasu", plain: "required-dearu" };
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Only where chaff.yaml names the register a region requires (options body, list, heading): a sentence in the other
|
|
177
|
+
* register is reported even with no mix, and that region is no longer checked for consistency (its minority may be the
|
|
178
|
+
* register the team chose). Regions left out keep the consistency check.
|
|
179
|
+
*/
|
|
180
|
+
const requiredFindings = (
|
|
181
|
+
doc: ProseDocument,
|
|
182
|
+
judged: readonly Entry[],
|
|
183
|
+
required: RequiredRegisters,
|
|
184
|
+
consistent: readonly Finding[],
|
|
185
|
+
polite: readonly LexiconEntry[],
|
|
186
|
+
): Finding[] => {
|
|
187
|
+
const told = offRequired(judged, required).map((entry) =>
|
|
188
|
+
finding(entry.sentence, { offset: entry.sentence.span.start }, REQUIRED_VARIANT[required[regionOfGroup(entry.group)] ?? entry.register]),
|
|
189
|
+
);
|
|
190
|
+
const wantedHeading = required.heading;
|
|
191
|
+
const headings =
|
|
192
|
+
wantedHeading === undefined
|
|
193
|
+
? []
|
|
194
|
+
: headingRegisters(doc.sections, polite, doc.lexicons["neutral-ending"] ?? [])
|
|
195
|
+
.filter((read) => read.register !== wantedHeading)
|
|
196
|
+
.map((read) =>
|
|
197
|
+
finding({ span: read.section.span, text: read.section.heading }, { offset: read.section.span.start }, REQUIRED_VARIANT[wantedHeading]),
|
|
198
|
+
);
|
|
199
|
+
return [...consistent, ...told, ...headings].toSorted((left, right) => Number(left.values["offset"]) - Number(right.values["offset"]));
|
|
200
|
+
};
|
|
201
|
+
|
|
157
202
|
export const sentenceEnding: Detector = (doc, options): Finding[] => {
|
|
158
203
|
const judged = judgedSentences(doc, options.lexicon ?? [], options.genre);
|
|
204
|
+
const required = requiredOf(options.settings);
|
|
159
205
|
// 数えたのは文が属するまとまりの中なので、文言もそのまとまりを名指す(本文の中で / この箇条書きの中で)。
|
|
160
|
-
const slips = slipsOf(judged, options.limit).filter(({ entry }) => !entry.quiet);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
column: 0,
|
|
166
|
-
quote: sentence.text.trim(),
|
|
167
|
-
...(group === undefined ? {} : { variant: "list" }),
|
|
168
|
-
values: { count, limit: options.limit, offset: sentence.span.start },
|
|
169
|
-
}));
|
|
206
|
+
const slips = slipsOf(judged, options.limit).filter(({ entry }) => !entry.quiet && required[regionOfGroup(entry.group)] === undefined);
|
|
207
|
+
const consistent = slips.map(({ entry: { sentence, group }, count }) =>
|
|
208
|
+
finding(sentence, { count, limit: options.limit, offset: sentence.span.start }, group === undefined ? undefined : "list"),
|
|
209
|
+
);
|
|
210
|
+
return requiresAny(required) ? requiredFindings(doc, judged, required, consistent, options.lexicon ?? []) : consistent;
|
|
170
211
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { lengthOf, proseText } from "../measure.ts";
|
|
2
|
-
import type { Detector, DetectorOptions, Finding, LengthUnit, Sentence } from "../plugin.ts";
|
|
2
|
+
import type { Detector, DetectorOptions, Finding, LengthUnit, ProseDocument, Sentence } from "../plugin.ts";
|
|
3
3
|
import { authorListSaving, citationLead, withoutEarlierReference } from "./citation-sentence.ts";
|
|
4
4
|
import { isCitationString, wordsAroundCitation } from "./citation-string.ts";
|
|
5
|
+
import { documentSubjects } from "./email-letter.ts";
|
|
5
6
|
import { isNameList } from "./name-list-sentence.ts";
|
|
6
7
|
import { pageMarkerPattern, pageMarkerSize } from "./page-marker.ts";
|
|
7
8
|
import { quotedSentenceParts } from "./quoted-sentences.ts";
|
|
@@ -28,6 +29,16 @@ type SentenceWords = {
|
|
|
28
29
|
const unwrittenWords = (sentence: Sentence, text: string, listItems: SentenceWords["listItems"]): number =>
|
|
29
30
|
termSeriesSaving(text) + authorListSaving(text) + (isInListItem(sentence.span, listItems) || isReferenceLine(text) ? quotedTitleWords(text) : 0);
|
|
30
31
|
|
|
32
|
+
/**
|
|
33
|
+
* A comma or a stop typed with one space before it ("the same brick , and"). It is no word of its own. One space only:
|
|
34
|
+
* the spaces that hide markup ("**TITLE**.", "[link](url),") are left counted, as the measure has always read them.
|
|
35
|
+
*/
|
|
36
|
+
const TYPED_LOOSE_STOP = /(?<=[\p{L}\p{N}]) [,.;:!?]+(?=\s|$)/gu;
|
|
37
|
+
|
|
38
|
+
/** A sentence's length; where words are the unit, a typed loose comma or stop is not counted. */
|
|
39
|
+
const sentenceSize = (sentence: Sentence, unit: LengthUnit): number =>
|
|
40
|
+
lengthOf(sentence, unit) - (unit === "word" ? [...sentence.text.matchAll(TYPED_LOOSE_STOP)].length : 0);
|
|
41
|
+
|
|
31
42
|
const sizeOf = (text: string, unit: LengthUnit): number =>
|
|
32
43
|
unit === "word" ? text.split(/\s+/u).filter((word) => word.length > 0).length : text.replace(/\s+/gu, "").length;
|
|
33
44
|
|
|
@@ -48,7 +59,7 @@ const measureOf = (sentence: Sentence, unit: LengthUnit, options: DetectorOption
|
|
|
48
59
|
const embedded = sentence.embeddedLanguage;
|
|
49
60
|
const limit = embedded === undefined ? undefined : options.embeddedLimits?.[embedded.id];
|
|
50
61
|
if (embedded === undefined || limit === undefined) return { size: ownSize(sentence, unit, words), limit: options.limit };
|
|
51
|
-
return { size:
|
|
62
|
+
return { size: sentenceSize(sentence, embedded.lengthUnit), limit, variant: `embedded-${embedded.id}` };
|
|
52
63
|
};
|
|
53
64
|
|
|
54
65
|
/** Code or a citation string: nothing in it is the writer's sentence. A title line too, where words are the unit. */
|
|
@@ -70,10 +81,22 @@ const ownSize = (sentence: Sentence, unit: LengthUnit, words: SentenceWords): nu
|
|
|
70
81
|
const remark = unit === "word" ? remarkAfterTitle(text) : undefined;
|
|
71
82
|
if (remark !== undefined) return sizeOf(remark, unit);
|
|
72
83
|
const unwritten = unit === "word" ? unwrittenWords(sentence, text, words.listItems) : 0;
|
|
73
|
-
const size =
|
|
84
|
+
const size = sentenceSize(sentence, unit) - pageMarkerSize(text, words.markers, unit) - unwritten;
|
|
74
85
|
return unit === "char" ? longestQuotedPart(text, size, words.markers) : size;
|
|
75
86
|
};
|
|
76
87
|
|
|
88
|
+
/**
|
|
89
|
+
* The texts of the document's subject fields: each subject line (Subject: …) and each value (the line under a bare SUBJECT:).
|
|
90
|
+
* A subject is no sentence; email-subject-length measures it.
|
|
91
|
+
*/
|
|
92
|
+
const subjectTexts = (doc: ProseDocument): ReadonlySet<string> =>
|
|
93
|
+
new Set(
|
|
94
|
+
documentSubjects(doc)
|
|
95
|
+
.flatMap((line) => [line.subject, doc.source.slice(line.start).split("\n", 1)[0] ?? ""])
|
|
96
|
+
.map((text) => text.trim())
|
|
97
|
+
.filter((text) => text !== ""),
|
|
98
|
+
);
|
|
99
|
+
|
|
77
100
|
export const sentenceLength: Detector = (doc, options): Finding[] => {
|
|
78
101
|
const words: SentenceWords = {
|
|
79
102
|
markers: pageMarkerPattern((options.lexicon ?? []).map((entry) => entry.pattern)),
|
|
@@ -84,6 +107,7 @@ export const sentenceLength: Detector = (doc, options): Finding[] => {
|
|
|
84
107
|
const long = doc.sentences
|
|
85
108
|
.map((sentence) => ({ sentence, measure: measureOf(sentence, doc.lengthUnit, options, words) }))
|
|
86
109
|
.filter(({ sentence, measure }) => measure.size > measure.limit && !isNameList(proseText(sentence)));
|
|
110
|
+
const subjects = long.length === 0 ? new Set<string>() : subjectTexts(doc);
|
|
87
111
|
// 他の文書から引き写した文(法律の条、「reads as follows:」の後の段落)は書き手の文ではない。探すのに文書の木を組むので、長い文があるときだけ。
|
|
88
112
|
const reproduced =
|
|
89
113
|
long.length === 0
|
|
@@ -95,7 +119,7 @@ export const sentenceLength: Detector = (doc, options): Finding[] => {
|
|
|
95
119
|
(doc.lexicons["verbatim-lead"] ?? []).map((entry) => entry.pattern),
|
|
96
120
|
);
|
|
97
121
|
return long
|
|
98
|
-
.filter(({ sentence }) => !isReproduced(sentence.span, reproduced))
|
|
122
|
+
.filter(({ sentence }) => !isReproduced(sentence.span, reproduced) && !subjects.has(proseText(sentence).trim()))
|
|
99
123
|
.map(({ sentence, measure }) => ({
|
|
100
124
|
rule: "max-sentence-length",
|
|
101
125
|
severity: "warning",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { charLength, proseText } from "../measure.ts";
|
|
2
2
|
import type { Detector, Finding, ProseDocument, Sentence } from "../plugin.ts";
|
|
3
|
+
import { inRelease, releaseSpansOf } from "./release-notes.ts";
|
|
3
4
|
|
|
4
5
|
/** 文が少ないと変動係数は当てにならない。ここを下回る文書は見ない。 */
|
|
5
6
|
const MIN_SENTENCES = 8;
|
|
@@ -11,8 +12,11 @@ const coefficientOfVariation = (sizes: readonly number[]): number => {
|
|
|
11
12
|
return Math.sqrt(variance) / mean;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
/**
|
|
15
|
-
const proseSentences = (doc: ProseDocument): readonly Sentence[] =>
|
|
15
|
+
/** 箇条書きの項目は揃えて書くのが正しい形なので、地の文の文だけを測る。変更履歴の版ごとの記事も、揃えて書く項目と同じ。 */
|
|
16
|
+
const proseSentences = (doc: ProseDocument): readonly Sentence[] => {
|
|
17
|
+
const releases = releaseSpansOf(doc);
|
|
18
|
+
return doc.paragraphs.flatMap((paragraph) => paragraph.sentences).filter((sentence) => !inRelease(releases, sentence.span.start));
|
|
19
|
+
};
|
|
16
20
|
|
|
17
21
|
export const sentenceRhythm: Detector = (doc, options): Finding[] => {
|
|
18
22
|
const sentences = proseSentences(doc);
|
package/src/detectors/signals.ts
CHANGED
|
@@ -266,7 +266,7 @@ export const undefinedAcronym: Detector = (doc, options): Finding[] => {
|
|
|
266
266
|
doc.sentences.map((sentence) => sentence.text),
|
|
267
267
|
patternsOf(doc, "abbreviation-mention"),
|
|
268
268
|
);
|
|
269
|
-
// 略語のすぐ後ろのダッシュで挟んだ同格(the VIX—a measure of
|
|
269
|
+
// 略語のすぐ後ろのダッシュで挟んだ同格(the VIX—a measure of …—)、同じ文か段落の前に書いた名前(Small Business Administration … SBA、Social Security number … SSN)、
|
|
270
270
|
// 2 つ以上の番号で引く続き物の名前(BCP 78、BCP 14)も、略語の説明と読む。
|
|
271
271
|
// 文献一覧の見出し語([UNIX] The Open Group, "The Single UNIX Specification")と、見出しに番号で立てた書簡の続き物(### SR 26-8: …)も。
|
|
272
272
|
// 入れ子の箇条書きで、親の項目が書き出した名前(- No product owner: の下の - Unavailable PO)も。
|
|
@@ -280,7 +280,7 @@ export const undefinedAcronym: Detector = (doc, options): Finding[] => {
|
|
|
280
280
|
...stated,
|
|
281
281
|
...linkedListTerms(doc.source),
|
|
282
282
|
...spelled,
|
|
283
|
-
...explainedInText(body, doc.sentences),
|
|
283
|
+
...explainedInText(body, doc.sentences, doc.paragraphs),
|
|
284
284
|
...referenceEntryLabels(doc.source),
|
|
285
285
|
...headingSeries(headings),
|
|
286
286
|
]);
|
|
@@ -322,12 +322,21 @@ export const undefinedAcronym: Detector = (doc, options): Finding[] => {
|
|
|
322
322
|
return alone.map(([acronym, hit]) => acronymFinding(acronym, hit, alone.length, options.limit));
|
|
323
323
|
};
|
|
324
324
|
|
|
325
|
+
/** 二つ重ねて一本に組むダッシュ(——、――)。重ねた二つ目からは、同じ一本の続き。 */
|
|
326
|
+
const DOUBLED_DASH = /[—―]/u;
|
|
327
|
+
const continuesDash = (source: string, offset: number): boolean => DOUBLED_DASH.test(source[offset] ?? "") && DOUBLED_DASH.test(source[offset - 1] ?? "");
|
|
328
|
+
|
|
329
|
+
/** 重ねたダッシュの最後の字の位置。段落の終わりで箇条を導くかは、そこから後ろで見る。 */
|
|
330
|
+
const dashEnd = (source: string, offset: number): number => (continuesDash(source, offset + 1) ? dashEnd(source, offset + 1) : offset);
|
|
331
|
+
|
|
325
332
|
/**
|
|
326
333
|
* ダッシュの多用。英語では正当な用法が多いが、2026 年時点で最も知られた生成文のシグナルでもある。
|
|
327
334
|
* 日本語の組版ではそもそも扱いが難しい。どちらが正しいかは severity の言語別指定で分ける。spec §12.4。
|
|
328
335
|
*/
|
|
329
336
|
export const dashDensity: Detector = (doc, options): Finding[] => {
|
|
330
|
-
const hits = findIn(doc, DASH).filter(
|
|
337
|
+
const hits = findIn(doc, DASH).filter(
|
|
338
|
+
(hit) => !continuesDash(doc.source, hit.offset) && !introducesList(doc.source, dashEnd(doc.source, hit.offset)) && !opensLine(doc.source, hit.offset),
|
|
339
|
+
);
|
|
331
340
|
const first = hits[0];
|
|
332
341
|
const rate = density(doc, hits.length);
|
|
333
342
|
if (wordsOf(doc) < MIN_DOCUMENT_LENGTH[doc.lengthUnit] || first === undefined || rate <= options.limit) return [];
|
|
@@ -6,6 +6,7 @@ import { inDocumentOrder } from "../structure/issues.ts";
|
|
|
6
6
|
import { preambleParagraphs } from "../preamble-paragraphs.ts";
|
|
7
7
|
import { isTooLongParagraph, labelledBlocks, lostLineBreaks, opensWithFusedHeading } from "../paragraph-length.ts";
|
|
8
8
|
import { bodySectionOf, hasOnlyMatterHeadings } from "../body-section.ts";
|
|
9
|
+
import { opensWithDateline } from "../news-dateline.ts";
|
|
9
10
|
import { threeShare } from "../rule-of-three.ts";
|
|
10
11
|
import { isInterview, sectionLevels } from "../section-levels.ts";
|
|
11
12
|
|
|
@@ -172,6 +173,7 @@ const withoutDateStamps = (doc: ProseDocument, paragraphs: readonly Paragraph[])
|
|
|
172
173
|
* 本題に入るまでが長い。業務文書では、読み手は結論を探しに来ている。
|
|
173
174
|
* 「本題」は最初の中見出し。中見出しが無い文書では、rule が requires の headings で動かず、動かなかった理由が出る。
|
|
174
175
|
* 見出しが末尾の問い合わせ先や参考文献だけの文書(手紙の形の諮問)も、本題の見出しが無いので測らない。
|
|
176
|
+
* 最初の段落が報道の日付行(AUSTIN, Texas — November 24, 2026 —)で始まる文書は、リードで全体を語る報道発表なので測らない。
|
|
175
177
|
*/
|
|
176
178
|
export const preambleLength: Detector = (doc, options): Finding[] => {
|
|
177
179
|
const body = bodySectionOf(doc.sections);
|
|
@@ -183,6 +185,8 @@ export const preambleLength: Detector = (doc, options): Finding[] => {
|
|
|
183
185
|
if (all.length <= options.limit) return [];
|
|
184
186
|
const before = withoutDateStamps(doc, all);
|
|
185
187
|
if (before.length <= options.limit) return [];
|
|
188
|
+
const lead = all[0];
|
|
189
|
+
if (lead !== undefined && opensWithDateline(doc.source, lead.span, dateSpans(doc))) return [];
|
|
186
190
|
const first = before[0];
|
|
187
191
|
return first === undefined
|
|
188
192
|
? []
|
package/src/detectors/team.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { joinWords } from "./word-list.ts";
|
|
2
2
|
import { conjugatedSpans } from "./conjugated-entry.ts";
|
|
3
|
-
import type { Detector, Finding, LexiconEntry, ProseDocument, Sentence } from "../plugin.ts";
|
|
3
|
+
import type { Detector, Finding, LexiconEntry, ProseDocument, Sentence, Span } from "../plugin.ts";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* チームの言葉。社内でしか通じない語を、チームが chaff.yaml に自分で並べる。
|
|
@@ -13,23 +13,56 @@ import type { Detector, Finding, LexiconEntry, ProseDocument, Sentence } from ".
|
|
|
13
13
|
* 複合動詞(「巻き取る」)は語に割れるので、語の並びで原形に照らす(「巻き取ります」)。
|
|
14
14
|
* 品詞解析があれば原形で当たり、無くても表層で当たる。要求はしない。
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const textSpans = (sentence: Sentence, wanted: string): Span[] => {
|
|
17
|
+
const at = sentence.text.toLowerCase().indexOf(wanted);
|
|
18
|
+
return at < 0 ? [] : [{ start: at, end: at + wanted.length }];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const lemmaSpans = (sentence: Sentence, wanted: string): Span[] =>
|
|
22
|
+
(sentence.tokens ?? [])
|
|
23
|
+
.filter((token) => token.lemma?.toLowerCase() === wanted)
|
|
24
|
+
.map((token) => ({ start: token.span.start - sentence.span.start, end: token.span.end - sentence.span.start }));
|
|
25
|
+
|
|
26
|
+
/** 活用した形の後ろに詰めて付く語(握っ|た・巻き取り|ます)。指摘には本文に書いた形を引く。 */
|
|
27
|
+
const ENDING_POS = new Set(["AUX", "SCONJ"]);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 当たった範囲を、本文に書いた形まで伸ばす。語の途中で終われば語の終わりまで(巻き取 → 巻き取り)、
|
|
31
|
+
* 詰めて付いた助動詞まで(握っ → 握った)。語の間に空白がある英語は、後ろの語まで伸ばさない。
|
|
32
|
+
*/
|
|
33
|
+
const writtenSpan = (sentence: Sentence, span: Span): Span => {
|
|
34
|
+
const end = sentence.span.start + span.end;
|
|
35
|
+
const tokens = sentence.tokens ?? [];
|
|
36
|
+
const inside = tokens.find((token) => token.span.start < end && end < token.span.end);
|
|
37
|
+
const next = tokens.find((token) => token.span.start === end && ENDING_POS.has(token.pos));
|
|
38
|
+
const reach = inside ?? next;
|
|
39
|
+
return reach === undefined ? span : writtenSpan(sentence, { start: span.start, end: reach.span.end - sentence.span.start });
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** 並べた語が文のどこに出たか(文の中の字の範囲)。表層、原形、複合動詞の活用した形の順に、最初の 1 か所。 */
|
|
43
|
+
const firstSpan = (sentence: Sentence, entry: LexiconEntry): Span | undefined => {
|
|
17
44
|
// 大文字小文字は区別しない。英語の文頭の「Circle back」も「circle back」として当てる。
|
|
18
45
|
const wanted = entry.pattern.toLowerCase();
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
46
|
+
const found = [...textSpans(sentence, wanted), ...lemmaSpans(sentence, wanted), ...conjugatedSpans(sentence, entry)][0];
|
|
47
|
+
return found === undefined ? undefined : writtenSpan(sentence, found);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const covers = (outer: Span, inner: Span): boolean => outer !== inner && outer.start <= inner.start && inner.end <= outer.end;
|
|
51
|
+
|
|
52
|
+
/** 文に出た、並べた語のそれぞれ。並べた語どうしが重なれば(握る・握っておく)、長い方だけ。 */
|
|
53
|
+
const sentenceHits = (sentence: Sentence, entries: readonly LexiconEntry[]): Span[] => {
|
|
54
|
+
const spans = entries.flatMap((entry) => {
|
|
55
|
+
const span = firstSpan(sentence, entry);
|
|
56
|
+
return span === undefined ? [] : [span];
|
|
57
|
+
});
|
|
58
|
+
const distinct = spans.filter((span, index) => spans.findIndex((other) => other.start === span.start && other.end === span.end) === index);
|
|
59
|
+
return distinct.filter((span) => !distinct.some((other) => covers(other, span))).toSorted((left, right) => left.start - right.start);
|
|
24
60
|
};
|
|
25
61
|
|
|
26
62
|
export const internalJargon: Detector = (doc, options): Finding[] => {
|
|
27
63
|
const entries = options.lexicon ?? [];
|
|
28
64
|
if (entries.length === 0) return [];
|
|
29
|
-
const hits = doc.sentences.flatMap((sentence) => {
|
|
30
|
-
const matched = entries.find((entry) => matches(sentence, entry))?.pattern;
|
|
31
|
-
return matched === undefined ? [] : [{ sentence, matched }];
|
|
32
|
-
});
|
|
65
|
+
const hits = doc.sentences.flatMap((sentence) => sentenceHits(sentence, entries).map((span) => ({ sentence, span })));
|
|
33
66
|
if (hits.length < options.limit) return [];
|
|
34
67
|
return hits.map((hit) => ({
|
|
35
68
|
rule: "internal-jargon",
|
|
@@ -37,7 +70,12 @@ export const internalJargon: Detector = (doc, options): Finding[] => {
|
|
|
37
70
|
line: 0,
|
|
38
71
|
column: 0,
|
|
39
72
|
quote: hit.sentence.text.trim(),
|
|
40
|
-
values: {
|
|
73
|
+
values: {
|
|
74
|
+
matched: hit.sentence.text.slice(hit.span.start, hit.span.end),
|
|
75
|
+
count: hits.length,
|
|
76
|
+
limit: options.limit,
|
|
77
|
+
offset: hit.sentence.span.start + hit.span.start,
|
|
78
|
+
},
|
|
41
79
|
}));
|
|
42
80
|
};
|
|
43
81
|
|
|
@@ -37,27 +37,51 @@ export const untaggedFewer = (fences: readonly CodeFence[], limit: number): read
|
|
|
37
37
|
return untagged.length > 0 && untagged.length < tagged.length && untagged.length <= limit ? untagged : [];
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
const opensWithAny = (line: string, marks: readonly string[]): boolean => marks.some((mark) => mark !== "" && line.trimStart().startsWith(mark));
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A block of what a program printed alone: a line opens with a status mark (✖ Missing keys, ⚠ 2 slots short) and none with
|
|
44
|
+
* a shell prompt. A session that types a command and shows its output ($ npx tidy … ✖ 1 problem) holds a command, which
|
|
45
|
+
* a language can name.
|
|
46
|
+
*/
|
|
47
|
+
export const isPrintedOutput = (fence: CodeFence, marks: readonly string[], prompts: readonly string[]): boolean =>
|
|
48
|
+
fence.lines.some((line) => opensWithAny(line, marks)) &&
|
|
49
|
+
!fence.lines.some((line) =>
|
|
50
|
+
opensWithAny(
|
|
51
|
+
line,
|
|
52
|
+
prompts.map((prompt) => `${prompt} `),
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
|
|
40
56
|
export const codeFenceLanguage: Detector = (doc, options): Finding[] => {
|
|
41
57
|
const outputWords = patternsOf(doc, "output-lead-in");
|
|
58
|
+
const statusMarks = patternsOf(doc, "output-status-mark");
|
|
59
|
+
const prompts = patternsOf(doc, "shell-prompt");
|
|
42
60
|
const fences = codeFences(doc.source).filter(wantsLanguage);
|
|
43
61
|
const tagged = fences.filter((fence) => fence.language !== "").length;
|
|
44
62
|
// A block of plain output (after "we'd expect to see:") is in no language: it still counts, but is not pointed at.
|
|
45
|
-
const reported = untaggedFewer(fences, options.limit).filter(
|
|
63
|
+
const reported = untaggedFewer(fences, options.limit).filter(
|
|
64
|
+
(fence) => !afterOutputLeadIn(doc.source, fence.start, outputWords) && !isPrintedOutput(fence, statusMarks, prompts),
|
|
65
|
+
);
|
|
46
66
|
return reported.map((fence) => finding(doc, "code-fence-language-mix", fence.start, { tagged, untagged: fences.length - tagged }));
|
|
47
67
|
};
|
|
48
68
|
|
|
49
69
|
export type PromptStyle = "prompt" | "bare" | undefined;
|
|
50
70
|
|
|
71
|
+
/** A line that opens with a digit is output (an address, a count), never a command a reader types. */
|
|
72
|
+
const OUTPUT_LINE = /^\d/u;
|
|
73
|
+
|
|
51
74
|
/**
|
|
52
75
|
* Whether a shell block writes its commands after a prompt ($ npm install) or bare (npm install). A block that mixes
|
|
53
|
-
* prompted and unprompted lines shows a command with its output, and is neither
|
|
76
|
+
* prompted and unprompted lines shows a command with its output, and is neither; so is an unprompted block holding a line
|
|
77
|
+
* of output. Comment lines (#) are skipped.
|
|
54
78
|
*/
|
|
55
79
|
export const promptStyleOf = (fence: CodeFence, prompts: readonly string[]): PromptStyle => {
|
|
56
80
|
const lines = fence.lines.map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#"));
|
|
57
81
|
if (lines.length === 0) return undefined;
|
|
58
82
|
const prompted = lines.filter((line) => prompts.some((prompt) => line.startsWith(`${prompt} `))).length;
|
|
59
83
|
if (prompted === lines.length) return "prompt";
|
|
60
|
-
return prompted === 0 ? "bare" : undefined;
|
|
84
|
+
return prompted === 0 && !lines.some((line) => OUTPUT_LINE.test(line)) ? "bare" : undefined;
|
|
61
85
|
};
|
|
62
86
|
|
|
63
87
|
export const shellPrompt: Detector = (doc, options): Finding[] => {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Detector, Finding, Sentence } from "../plugin.ts";
|
|
2
|
+
import { groupHits, groupsOfLexicon, groupVerdict, type GroupHit, type GroupVerdict } from "../term-groups.ts";
|
|
3
|
+
import { joinWords } from "./word-list.ts";
|
|
4
|
+
|
|
5
|
+
type Placed = GroupHit & { readonly sentence: Sentence };
|
|
6
|
+
|
|
7
|
+
const findingAt = (hit: Placed, values: Finding["values"], variant?: string): Finding => ({
|
|
8
|
+
rule: "",
|
|
9
|
+
severity: "warning",
|
|
10
|
+
line: 0,
|
|
11
|
+
column: 0,
|
|
12
|
+
quote: hit.sentence.text.trim(),
|
|
13
|
+
...(variant === undefined ? {} : { variant }),
|
|
14
|
+
values: { ...values, matched: hit.sentence.text.slice(hit.span.start, hit.span.end), offset: hit.sentence.span.start + hit.span.start },
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/** The places a verdict reports, when its less-used side reaches the limit. A tie is one place: no side is taken. */
|
|
18
|
+
const findingsOf = (verdict: GroupVerdict<Placed>, total: number, limit: number, language: string): Finding[] => {
|
|
19
|
+
if (verdict.kind === "minority") {
|
|
20
|
+
if (verdict.odd.length < limit) return [];
|
|
21
|
+
return verdict.odd.map((hit) => findingAt(hit, { preferred: verdict.usual, other: verdict.usualCount, count: verdict.odd.length, limit }));
|
|
22
|
+
}
|
|
23
|
+
const top = Math.max(...verdict.members.map((entry) => entry.count));
|
|
24
|
+
if (total - top < limit) return [];
|
|
25
|
+
const forms = joinWords(
|
|
26
|
+
verdict.members.map((entry) => entry.member),
|
|
27
|
+
language,
|
|
28
|
+
);
|
|
29
|
+
return [findingAt(verdict.first, { forms, count: top, limit }, "tie")];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** The groups the team lists under consistent in chaff.yaml: within one text, the places of a member the text uses less. */
|
|
33
|
+
export const termConsistency: Detector = (doc, options): Finding[] => {
|
|
34
|
+
const groups = groupsOfLexicon(options.lexicon ?? []);
|
|
35
|
+
const hits: Placed[] = doc.sentences.flatMap((sentence) => groupHits(sentence.text, groups).map((hit) => ({ ...hit, sentence })));
|
|
36
|
+
return groups.flatMap((_, group) => {
|
|
37
|
+
const mine = hits.filter((hit) => hit.group === group);
|
|
38
|
+
const verdict = groupVerdict(mine);
|
|
39
|
+
return verdict === undefined ? [] : findingsOf(verdict, mine.length, options.limit, doc.language);
|
|
40
|
+
});
|
|
41
|
+
};
|