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
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { charLength, proseText } from "../measure.ts";
|
|
2
|
-
import type { Detector, Finding, Section } from "../plugin.ts";
|
|
2
|
+
import type { Detector, Finding, Section, Span } from "../plugin.ts";
|
|
3
3
|
import { isQuotedMention } from "./bold-quoted.ts";
|
|
4
4
|
import { isFieldLabel } from "./bold-field-label.ts";
|
|
5
|
+
import { isReleaseScopeLabel, releaseSpansOf } from "./release-notes.ts";
|
|
5
6
|
|
|
6
7
|
/** これより短い節では密度が暴れる。43 字に 1 箇所で「1000 字あたり 23」になる。 */
|
|
7
8
|
const MIN_CHARS = 200;
|
|
@@ -11,11 +12,13 @@ const PER = 1000;
|
|
|
11
12
|
const charsOf = (section: Section): number => section.sentences.reduce((sum, sentence) => sum + charLength(sentence), 0);
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
|
-
* The section's bold runs, less those that only quote words (a README bolds the part of an example sentence it talks about)
|
|
15
|
-
*
|
|
15
|
+
* The section's bold runs, less those that only quote words (a README bolds the part of an example sentence it talks about),
|
|
16
|
+
* the field labels opening a line (**Date:** in a memo's header) and a changelog entry's commit scope (* **deps:** ...).
|
|
16
17
|
*/
|
|
17
|
-
const boldsOf = (section: Section, source: string): number =>
|
|
18
|
-
section.strongs === undefined
|
|
18
|
+
const boldsOf = (section: Section, source: string, releases: readonly Span[]): number =>
|
|
19
|
+
section.strongs === undefined
|
|
20
|
+
? section.strongCount
|
|
21
|
+
: section.strongs.filter((span) => !isQuotedMention(source, span) && !isFieldLabel(source, span) && !isReleaseScopeLabel(source, releases, span)).length;
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
24
|
* 節あたりの「密度」を見る。件数ではない。
|
|
@@ -25,9 +28,10 @@ const boldsOf = (section: Section, source: string): number =>
|
|
|
25
28
|
*
|
|
26
29
|
* rule の名前(bold-density)が最初から密度と言っていた。件数で実装していたのが誤り。
|
|
27
30
|
*/
|
|
28
|
-
export const countPerSection: Detector = (doc, options): Finding[] =>
|
|
29
|
-
doc
|
|
30
|
-
|
|
31
|
+
export const countPerSection: Detector = (doc, options): Finding[] => {
|
|
32
|
+
const releases = releaseSpansOf(doc);
|
|
33
|
+
return doc.sections
|
|
34
|
+
.map((section) => ({ section, chars: charsOf(section), bolds: boldsOf(section, doc.source, releases) }))
|
|
31
35
|
.filter(({ chars }) => chars >= MIN_CHARS)
|
|
32
36
|
.map(({ section, chars, bolds }) => ({ section, chars, bolds, density: Math.round((bolds / chars) * PER) }))
|
|
33
37
|
.filter(({ density }) => density > options.limit)
|
|
@@ -46,3 +50,4 @@ export const countPerSection: Detector = (doc, options): Finding[] =>
|
|
|
46
50
|
offset: section.firstSentence?.span.start ?? section.span.start,
|
|
47
51
|
},
|
|
48
52
|
}));
|
|
53
|
+
};
|
|
@@ -100,3 +100,23 @@ export const trailingOrdinals = (
|
|
|
100
100
|
const surface = chain.map((token) => token.surface).join("");
|
|
101
101
|
return joined && run.endsWith(surface) ? { surface, start: first.span.start } : undefined;
|
|
102
102
|
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 漢字の連なり run(文書全体の座標で span)の尻の、漢数字の数と助数詞(国交正常化六十周年の「六十周年」)。算用数字で書けば
|
|
106
|
+
* 連なりはそこで切れる。数は前の語の量や回数を言うもので、前の複合語の一部ではない。数の前に語が残るときだけ。そうでなければ undefined。
|
|
107
|
+
*/
|
|
108
|
+
export const trailingQuantity = (
|
|
109
|
+
tokens: readonly Token[],
|
|
110
|
+
span: { readonly start: number; readonly end: number },
|
|
111
|
+
run: string,
|
|
112
|
+
): { readonly surface: string; readonly start: number } | undefined => {
|
|
113
|
+
const words = tokens.filter((token) => token.span.start < span.end && span.start < token.span.end);
|
|
114
|
+
if (!isCounter(words.at(-1))) return undefined;
|
|
115
|
+
const start = words.slice(0, -1).findLastIndex((token) => !isNumber(token)) + 1;
|
|
116
|
+
const first = words[start];
|
|
117
|
+
if (start === 0 || start >= words.length - 1 || first === undefined) return undefined;
|
|
118
|
+
const chain = words.slice(start);
|
|
119
|
+
const joined = chain.every((token, at) => at === 0 || chain[at - 1]?.span.end === token.span.start);
|
|
120
|
+
const surface = chain.map((token) => token.surface).join("");
|
|
121
|
+
return joined && run.endsWith(surface) ? { surface, start: first.span.start } : undefined;
|
|
122
|
+
};
|
|
@@ -4,10 +4,12 @@ import { stemMorae, stemOf } from "../long-vowel.ts";
|
|
|
4
4
|
import { DEFAULT_MIN_MORAE, distinctWordsOf, exemptStems, kanaWordsOf } from "./long-vowel.ts";
|
|
5
5
|
import { spelledWordsIn, spellingsOf } from "./spelling-variety.ts";
|
|
6
6
|
import { isWithinAny, quotedIn } from "../quoted-span.ts";
|
|
7
|
+
import { groupHits, groupsOfLexicon } from "../term-groups.ts";
|
|
7
8
|
|
|
8
9
|
// The words read for cross-doc-term-variant, each with the key both its spellings share. Three ways of spelling one word
|
|
9
10
|
// that chaff already reads in one document: the final ー of a katakana word (katakana-long-vowel), British and American
|
|
10
|
-
// spellings (spelling-consistency's word lists), and a Latin word written with and without a hyphen (e-mail, email)
|
|
11
|
+
// spellings (spelling-consistency's word lists), and a Latin word written with and without a hyphen (e-mail, email);
|
|
12
|
+
// and the groups a team lists under consistent in chaff.yaml (term-consistency).
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Katakana nouns as the language package split them, keyed by the word without its final ー. Short words keep their ー.
|
|
@@ -35,6 +37,15 @@ const listedWords = (doc: ProseDocument): KeyedWord[] => {
|
|
|
35
37
|
);
|
|
36
38
|
};
|
|
37
39
|
|
|
40
|
+
/** The members of the team's groups (chaff.yaml consistent), keyed by their group: 顧客 and お客様 are one choice written two ways. */
|
|
41
|
+
const teamWords = (doc: ProseDocument): KeyedWord[] => {
|
|
42
|
+
const groups = groupsOfLexicon(doc.lexicons["term-consistency"] ?? []);
|
|
43
|
+
if (groups.length === 0) return [];
|
|
44
|
+
return doc.sentences.flatMap((sentence) =>
|
|
45
|
+
groupHits(sentence.text, groups).map((hit) => ({ key: `team:${String(hit.group)}`, form: hit.member, offset: sentence.span.start + hit.span.start })),
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
38
49
|
const LATIN_WORD = /(?<![\p{L}\p{N}_-])\p{Script=Latin}+(?:-\p{Script=Latin}+)*(?![\p{L}\p{N}_-])/gu;
|
|
39
50
|
const HYPHEN = "-";
|
|
40
51
|
|
|
@@ -71,7 +82,10 @@ const findingOf = (byPath: ReadonlyMap<string, ProseDocument>, odd: OddSpelling)
|
|
|
71
82
|
/** A word spelled one way in some files of the run and another way in the rest: reported in the files of the fewer way. */
|
|
72
83
|
export const crossDocTermVariant: CrossDetector = (docs) => {
|
|
73
84
|
const latin = hyphenWords(docs);
|
|
74
|
-
const words: DocumentWords[] = docs.map((doc, index) => ({
|
|
85
|
+
const words: DocumentWords[] = docs.map((doc, index) => ({
|
|
86
|
+
path: doc.path,
|
|
87
|
+
words: [...kanaWords(doc), ...listedWords(doc), ...(latin[index] ?? []), ...teamWords(doc)],
|
|
88
|
+
}));
|
|
75
89
|
const byPath = new Map(docs.map((doc) => [doc.path, doc]));
|
|
76
90
|
return oddSpellings(words).flatMap((odd) => findingOf(byPath, odd));
|
|
77
91
|
};
|
|
@@ -2,7 +2,7 @@ import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
|
2
2
|
import { escapeRegExp } from "../orthography.ts";
|
|
3
3
|
import { formMinority } from "./form-minority.ts";
|
|
4
4
|
import { proseAndTablesOf } from "../table-text.ts";
|
|
5
|
-
import { quoteAround } from "./quote-around.ts";
|
|
5
|
+
import { quoteAround, sentenceQuoteAt } from "./quote-around.ts";
|
|
6
6
|
|
|
7
7
|
// 一つの文書で、同じ通貨の金額を二通りに書いた所(1,000円 と ¥1,000、$20 と 20 dollars)。どちらが正しいかは決めず、少ないほうを指す。
|
|
8
8
|
// 通貨の書き方、それを金額のどちら側に書くか、どの通貨か(group)は語彙表 currency-notation、桁の語は amount-multiplier が言う。
|
|
@@ -85,7 +85,7 @@ export const currencyNotation: Detector = (doc, options): Finding[] => {
|
|
|
85
85
|
severity: "info",
|
|
86
86
|
line: 0,
|
|
87
87
|
column: 0,
|
|
88
|
-
quote: quoteAround(text, odd.offset, odd.offset + odd.written.length),
|
|
88
|
+
quote: sentenceQuoteAt(doc.sentences, odd.offset) ?? quoteAround(text, odd.offset, odd.offset + odd.written.length),
|
|
89
89
|
values: { written: odd.written.trim(), usual: usual.trim(), count, of, offset: odd.offset },
|
|
90
90
|
}));
|
|
91
91
|
};
|
package/src/detectors/custom.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { joinedView, type JoinedView } from "../joined-view.ts";
|
|
|
5
5
|
import { boundedMatches } from "../custom/bounded-match.ts";
|
|
6
6
|
import { entriesForGenre } from "../lexicon-genres.ts";
|
|
7
7
|
import { NO_REWRITE } from "../custom/no-rewrite.ts";
|
|
8
|
+
import { sentencesInScope } from "../scoped-sentences.ts";
|
|
8
9
|
|
|
9
10
|
// The detectors behind a team's custom_rules. Each reports every place it finds, at the rule's level; the spec comes from
|
|
10
11
|
// the rule (DetectorOptions.custom). Positions are the document's, like every other finding.
|
|
@@ -62,7 +63,7 @@ export const customWords: Detector = (doc, options): Finding[] => {
|
|
|
62
63
|
const spec = options.custom;
|
|
63
64
|
if (spec?.type !== "words") return [];
|
|
64
65
|
const pairs = pairsOf(spec, options).filter((pair) => pair.avoid !== "" && pair.avoid !== pair.use);
|
|
65
|
-
return doc.
|
|
66
|
+
return sentencesInScope(doc, spec.scope).flatMap((sentence) => {
|
|
66
67
|
const view = readAsWritten(sentence);
|
|
67
68
|
return pairs.flatMap((pair) =>
|
|
68
69
|
occurrencesOutside(view.text, pair.avoid, pair.use).map((start) => wordsFindingOf(hitAt(sentence, view, start, start + pair.avoid.length, pair.use))),
|
|
@@ -74,13 +75,14 @@ export const customWords: Detector = (doc, options): Finding[] => {
|
|
|
74
75
|
export const customPattern: Detector = (doc, options): Finding[] => {
|
|
75
76
|
const spec = options.custom;
|
|
76
77
|
if (spec?.type !== "pattern") return [];
|
|
77
|
-
const
|
|
78
|
+
const sentences = sentencesInScope(doc, spec.scope);
|
|
79
|
+
const views = sentences.map(readAsWritten);
|
|
78
80
|
const matches = boundedMatches(
|
|
79
81
|
spec.pattern,
|
|
80
82
|
spec.flags,
|
|
81
83
|
views.map((view) => view.text),
|
|
82
84
|
);
|
|
83
|
-
return
|
|
85
|
+
return sentences.flatMap((sentence, at) => {
|
|
84
86
|
const view = views[at];
|
|
85
87
|
if (view === undefined) return [];
|
|
86
88
|
return (matches[at] ?? []).map((match) => findingOf(hitAt(sentence, view, match.index, match.index + match.text.length, "")));
|
|
@@ -91,7 +93,7 @@ export const customPattern: Detector = (doc, options): Finding[] => {
|
|
|
91
93
|
export const customTokens: Detector = (doc, options): Finding[] => {
|
|
92
94
|
const spec = options.custom;
|
|
93
95
|
if (spec?.type !== "tokens") return [];
|
|
94
|
-
return doc.
|
|
96
|
+
return sentencesInScope(doc, spec.scope).flatMap((sentence) => {
|
|
95
97
|
const tokens = sentence.tokens ?? [];
|
|
96
98
|
return tokenRuns(tokens, spec.tokens).flatMap(([first, last]) => {
|
|
97
99
|
const [start, end] = [tokens[first]?.span.start, tokens[last]?.span.end];
|
|
@@ -38,7 +38,7 @@ export const dateFormat: Detector = (doc, options): Finding[] => {
|
|
|
38
38
|
};
|
|
39
39
|
const text = doc.prose ?? doc.source;
|
|
40
40
|
const stampLabels = (doc.lexicons["date-stamp-label"] ?? []).map((entry) => entry.pattern);
|
|
41
|
-
const places = { stampLabels, cited: citedSpans(doc), source: doc.source };
|
|
41
|
+
const places = { stampLabels, cited: citedSpans(doc), source: doc.source, headings: (doc.markup?.headings ?? []).map((heading) => heading.start) };
|
|
42
42
|
return dateGroups(text, datesIn(text, words), places).flatMap((group) => {
|
|
43
43
|
const minority = dateMinority(group, options.limit);
|
|
44
44
|
return minority === undefined ? [] : findingsOf(doc, minority);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// A yearless date that names again a day the text gave with its year earlier ("opens on Saturday, January 16, 2027" … "opens
|
|
2
|
+
// to the public at 10 a.m. on Saturday, January 16"): the reader already knows which January 16. Pure.
|
|
3
|
+
|
|
4
|
+
type Point = { readonly offset: number; readonly value: string };
|
|
5
|
+
|
|
6
|
+
const FULL = /^(\d{4})-(\d{2}-\d{2})$/u;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Whether the month and day of `point` (as "01-16") were written with a year before it, in one year only: the same day
|
|
10
|
+
* given in two years (January 16, 2026 and January 16, 2027) leaves the year open.
|
|
11
|
+
*/
|
|
12
|
+
export const repeatsDatedDay = (point: Point, dated: readonly Point[]): boolean => {
|
|
13
|
+
const years = new Set(
|
|
14
|
+
dated.flatMap((other) => {
|
|
15
|
+
const found = FULL.exec(other.value);
|
|
16
|
+
return found !== null && other.offset < point.offset && found[2] === point.value ? [found[1]] : [];
|
|
17
|
+
}),
|
|
18
|
+
);
|
|
19
|
+
return years.size === 1;
|
|
20
|
+
};
|
|
@@ -18,6 +18,7 @@ import { openingDateOf } from "./opening-date.ts";
|
|
|
18
18
|
import { datelineBefore, datelines, forwardDatelines } from "./dateline.ts";
|
|
19
19
|
import { withNearestYear } from "../structure/weekday.ts";
|
|
20
20
|
import { continuesDatedRun } from "./date-run.ts";
|
|
21
|
+
import { repeatsDatedDay } from "./date-repeated-day.ts";
|
|
21
22
|
import { revisionDatesToSkip, revisionLabelsOf } from "./revision-date.ts";
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -201,10 +202,16 @@ export const yearGaps = (
|
|
|
201
202
|
// A recurring day or an example's date has no year to write, and is not the document's way of writing dates either.
|
|
202
203
|
// A date that carries a dated account forward (On April 21, 1952, … on April 30 … May 3) takes that account's year. A
|
|
203
204
|
// table cell is a record whose fields keep one format: a dated column with one year dropped is still a slip.
|
|
205
|
+
// A day the text gave with its year earlier (Saturday, January 16, 2027 … on Saturday, January 16) keeps that year.
|
|
204
206
|
const continuesRun = (point: DatePoint): boolean => !isTableRowAt(source, point.offset) && continuesDatedRun(point, (earlier) => previousOf.get(earlier));
|
|
205
207
|
const yearless = points.filter(
|
|
206
208
|
(point) =>
|
|
207
|
-
MONTH_DAY.test(point.value) &&
|
|
209
|
+
MONTH_DAY.test(point.value) &&
|
|
210
|
+
!yearGiven(point, anchors, source, yearWords) &&
|
|
211
|
+
!yearOfAny(point) &&
|
|
212
|
+
!carriesAnyYear(point) &&
|
|
213
|
+
!continuesRun(point) &&
|
|
214
|
+
!repeatsDatedDay(point, dated),
|
|
208
215
|
);
|
|
209
216
|
const span = spanOf(dated);
|
|
210
217
|
const unclear = dated.length >= 2 && yearless.length < dated.length && span !== undefined && span.to > span.from;
|
|
@@ -9,7 +9,7 @@ import { quoteAt } from "./structure-tree.ts";
|
|
|
9
9
|
import { quotesWording, wordingCuesOf } from "./quoted-wording.ts";
|
|
10
10
|
import { isPartOfAddress } from "./address-word.ts";
|
|
11
11
|
import { exactOffsets, extendedAfter, extendedBefore } from "./term-extension.ts";
|
|
12
|
-
import { headsKindPhrase, insideLongerTerm, isNamedAsTerm, isNarrowedUse, isPartitiveUse } from "./ordinary-phrase.ts";
|
|
12
|
+
import { headsKindPhrase, insideLongerTerm, isCoordinatedModifier, isNamedAsTerm, isNarrowedUse, isPartitiveUse } from "./ordinary-phrase.ts";
|
|
13
13
|
import { CLOSES_SENTENCE, isNameField, isSignatureLine, opensClosingBlock, SLACK } from "./name-field.ts";
|
|
14
14
|
import type { Detector, Finding, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
15
15
|
|
|
@@ -173,7 +173,8 @@ const quotedFindings = (doc: ProseDocument, term: DefinedTerm, uses: readonly nu
|
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
175
|
* A lower-case use that is the ordinary word in a phrase of its own: inside another defined term (certificate of merger),
|
|
176
|
-
* narrowed by the word before it (the common parent), picked out of a kind (some of these terms),
|
|
176
|
+
* narrowed by the word before it (the common parent), picked out of a kind (some of these terms), joined to an ordinary word
|
|
177
|
+
* in front of a noun they share (customer and supplier information), or heading a kind of
|
|
177
178
|
* thing (certificates of deposit).
|
|
178
179
|
*/
|
|
179
180
|
const isOrdinaryPhraseAt = (doc: ProseDocument, offset: number, term: string, defined: readonly string[]): boolean => {
|
|
@@ -184,6 +185,7 @@ const isOrdinaryPhraseAt = (doc: ProseDocument, offset: number, term: string, de
|
|
|
184
185
|
return (
|
|
185
186
|
isNarrowedUse(tokens, at, patternsOf(doc, "defined-term-pointer")) ||
|
|
186
187
|
isPartitiveUse(tokens, at, patternsOf(doc, "defined-term-partitive")) ||
|
|
188
|
+
isCoordinatedModifier(tokens, at, last) ||
|
|
187
189
|
headsKindPhrase(tokens, last)
|
|
188
190
|
);
|
|
189
191
|
};
|
|
@@ -202,7 +204,8 @@ const extendedFindings = (doc: ProseDocument, texts: readonly BodyText[], term:
|
|
|
202
204
|
.flatMap((offset) => {
|
|
203
205
|
const before = extendedBefore(doc.source, offset, term.term, definition, pointers);
|
|
204
206
|
const written = before ?? (isSentenceStart(doc.source, offset) ? undefined : extendedAfter(doc.source, offset, term.term, definition));
|
|
205
|
-
|
|
207
|
+
// The term written twice in a row (ライセンス対象物ライセンス対象物) is a run-in heading joined to its text, not a longer name.
|
|
208
|
+
if (written === undefined || defined.includes(written) || written === term.term.repeat(2)) return [];
|
|
206
209
|
const start = before === undefined ? offset : offset + term.term.length - written.length;
|
|
207
210
|
return [finding(doc, "defined-term-form", start, "extended", { term: term.term, written, line: term.line })];
|
|
208
211
|
});
|
|
@@ -267,9 +270,20 @@ const isLongName = (name: string): boolean => {
|
|
|
267
270
|
return !LATIN.test(name) || JAPANESE.test(name) || (words.length >= MIN_NAME_WORDS && words.some((word) => UPPER_START.test(word)));
|
|
268
271
|
};
|
|
269
272
|
|
|
270
|
-
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
+
const CLOSING_BRACKETS = new Set([")", ")"]);
|
|
274
|
+
const COMMAS = new Set([",", "、", ","]);
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* A conjunction that joins the run to a name before it (書面または電磁的記録(以下「書面等」)): the bracket names them all.
|
|
278
|
+
* Right after another definition's bracket (Brookside Ltd (the "Client") and Harbour Works Ltd (the "Supplier")) it joins
|
|
279
|
+
* two parties, each given its own short name.
|
|
280
|
+
*/
|
|
281
|
+
const joinsList = (tokens: readonly Token[], at: number, joiners: readonly string[]): boolean => {
|
|
282
|
+
const token = tokens[at];
|
|
283
|
+
if (token === undefined || token.pos !== "CCONJ" || !joiners.includes(token.surface.toLowerCase())) return false;
|
|
284
|
+
const before = tokens.slice(0, at).findLast((candidate) => !COMMAS.has(candidate.surface));
|
|
285
|
+
return before === undefined || !CLOSING_BRACKETS.has(before.surface);
|
|
286
|
+
};
|
|
273
287
|
|
|
274
288
|
/**
|
|
275
289
|
* The long name written right before an inline definition: the run of name words that ends at its opening bracket. A run
|
|
@@ -279,7 +293,7 @@ export const nameBefore = (sentence: Sentence, bracket: number, joiners: readonl
|
|
|
279
293
|
if (LABELS_THE_CLAUSE.test(sentence.text.slice(bracket - sentence.span.start))) return undefined;
|
|
280
294
|
const tokens = (sentence.tokens ?? []).filter((token) => token.span.end <= bracket);
|
|
281
295
|
const firstOfRun = tokens.findLastIndex((token) => !isNamePart(token)) + 1;
|
|
282
|
-
if (isModifier(tokens[firstOfRun - 1]) || joinsList(tokens
|
|
296
|
+
if (isModifier(tokens[firstOfRun - 1]) || joinsList(tokens, firstOfRun - 1, joiners)) return undefined;
|
|
283
297
|
const run = tokens.slice(firstOfRun).filter((token, index, all) => index > 0 || !NAME_MARKS.has(token.surface) || all.length === 1);
|
|
284
298
|
const first = run[0];
|
|
285
299
|
const end = run.at(-1);
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from "../structure/definition-use.ts";
|
|
11
11
|
import { titleLineNumbers } from "../structure/title-lines.ts";
|
|
12
12
|
import { contentsLineNumbers } from "../structure/contents-lines.ts";
|
|
13
|
+
import { alertLineNumbers } from "../structure/alert-lines.ts";
|
|
13
14
|
import { summarisesLaterDefinition, summarySections } from "../structure/summary-lines.ts";
|
|
14
15
|
import { expansionConflicts, expansionsIn } from "../acronym-expansions.ts";
|
|
15
16
|
import { linesOf, lineNumberAt } from "../structure/lines.ts";
|
|
@@ -54,11 +55,16 @@ export const unusedDefinition: Detector = (doc): Finding[] => {
|
|
|
54
55
|
/**
|
|
55
56
|
* 題・見出し(Markdown の見出し、章・節の行、条の前の見出しの行、番号と題だけの項目の行)と、目次・索引の行の上の位置か。
|
|
56
57
|
* 要約の節の行は、定義がその節の外にあるときだけ(要約は本文の定義を先取りして縮めたもの)。
|
|
58
|
+
* GitHub の注記(`> [!NOTE]`)の行も。掲載元が本文の外に添えた断りで、本文の語の使用ではない。
|
|
57
59
|
*/
|
|
58
60
|
const titleIn = (doc: ProseDocument): IsTitle => {
|
|
59
61
|
const lines = linesOf(doc.source);
|
|
60
62
|
const headings = doc.markup?.headings ?? [];
|
|
61
|
-
const numbers = new Set([
|
|
63
|
+
const numbers = new Set([
|
|
64
|
+
...titleLineNumbers(doc.structure, lines, headings),
|
|
65
|
+
...contentsLineNumbers(lines, headings, patternsOf(doc, "toc-heading")),
|
|
66
|
+
...alertLineNumbers(lines),
|
|
67
|
+
]);
|
|
62
68
|
const summaries = summarySections(lines, headings, [
|
|
63
69
|
...patternsOf(doc, "summary-heading"),
|
|
64
70
|
...patternsOf(doc, "headnote-heading"),
|
|
@@ -80,14 +86,11 @@ const ownDefinitions = (tree: StructureNode): DefinedTerm[] => {
|
|
|
80
86
|
export const useBeforeDefinition: Detector = (doc): Finding[] =>
|
|
81
87
|
doc.structure === undefined
|
|
82
88
|
? []
|
|
83
|
-
: usesBeforeDefinition(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
patternsOf(doc, "self-prefix"),
|
|
89
|
-
patternsOf(doc, "term-source-marker"),
|
|
90
|
-
).map((use) => findingAt(doc, use.offset, { term: use.term.term, defined: use.term.line }));
|
|
89
|
+
: usesBeforeDefinition(ownDefinitions(doc.structure), bodyOf(doc), mentionedIn(doc), titleIn(doc), {
|
|
90
|
+
selfPrefixes: patternsOf(doc, "self-prefix"),
|
|
91
|
+
sourceMarkers: patternsOf(doc, "term-source-marker"),
|
|
92
|
+
singleKanjiNames: new Set(patternsOf(doc, "party-short-name")),
|
|
93
|
+
}).map((use) => findingAt(doc, use.offset, { term: use.term.term, defined: use.term.line }));
|
|
91
94
|
|
|
92
95
|
/** 同じ略語を、文書の中で二通りに展開している所。 */
|
|
93
96
|
export const acronymExpansionConflict: Detector = (doc): Finding[] => {
|
|
@@ -307,6 +307,7 @@ export const documentYearFindings = (doc: ProseDocument, tree: StructureNode): F
|
|
|
307
307
|
sentences: sentencesOf(doc),
|
|
308
308
|
years: yearsOf(doc, tree, quantities),
|
|
309
309
|
foundings: wordsOf(doc, "elapsed-origin"),
|
|
310
|
+
openings: wordsOf(doc, "elapsed-opening"),
|
|
310
311
|
births: wordsOf(doc, "birth-origin"),
|
|
311
312
|
elapsed: elapsedOf(doc, quantities),
|
|
312
313
|
ages,
|
|
@@ -123,17 +123,20 @@ export const endsWithQuestionParticle = (tokens: readonly Token[], particles: Re
|
|
|
123
123
|
|
|
124
124
|
/** A series label in brackets at a heading's end, a number and a colon opening it ("(490: Employee travel)"): the manual's reference. */
|
|
125
125
|
const SERIES_LABEL_END = /[((]\p{N}+[::][^()()]*[))]$/u;
|
|
126
|
+
/** A date alone in brackets at a heading's end ((令和7年5月23日), (2025年5月23日)): the issue a series title carries, not words the writer chose. */
|
|
127
|
+
const DATE_END = /[((](?:令和|平成|昭和)?(?:\p{N}+|元)年\p{N}+月\p{N}+日[))]$/u;
|
|
126
128
|
const QUOTED = /「[^「」]*」/gu;
|
|
127
129
|
const QUOTED_NAME = "「」";
|
|
128
130
|
|
|
129
131
|
/**
|
|
130
|
-
* The words the heading's writer chose: without a series label at its end, and with another document's title, quoted
|
|
132
|
+
* The words the heading's writer chose: without a series label or a bracketed date at its end, and with another document's title, quoted
|
|
131
133
|
* right before what is done to it (「…の取扱いについて」等の一部改正, the cited-title-action word list), as one name.
|
|
132
134
|
*/
|
|
133
135
|
export const ownWordsOf = (heading: string, citedTitleActions: readonly string[]): string =>
|
|
134
136
|
heading
|
|
135
137
|
.trimEnd()
|
|
136
138
|
.replace(SERIES_LABEL_END, "")
|
|
139
|
+
.replace(DATE_END, "")
|
|
137
140
|
.trimEnd()
|
|
138
141
|
.replaceAll(QUOTED, (quote, offset: number) =>
|
|
139
142
|
citedTitleActions.some((action) => action !== "" && heading.startsWith(action, offset + quote.length)) ? QUOTED_NAME : quote,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Detector, Finding } from "../plugin.ts";
|
|
2
2
|
import { escapeRegExp } from "../orthography.ts";
|
|
3
3
|
import { formMinority } from "./form-minority.ts";
|
|
4
|
-
import { quoteAround } from "./quote-around.ts";
|
|
4
|
+
import { quoteAround, sentenceQuoteAt } from "./quote-around.ts";
|
|
5
5
|
|
|
6
6
|
// One document writing an ellipsis two ways ("..." and "…", "……" and "・・・"). Neither is called right; the less common is
|
|
7
7
|
// reported. The forms come from each language's lexicon "ellipsis".
|
|
@@ -83,7 +83,7 @@ export const ellipsisConsistency: Detector = (doc, options): Finding[] => {
|
|
|
83
83
|
severity: "info",
|
|
84
84
|
line: 0,
|
|
85
85
|
column: 0,
|
|
86
|
-
quote: quoteAround(text, ellipsis.offset, ellipsis.offset + ellipsis.form.length),
|
|
86
|
+
quote: sentenceQuoteAt(doc.sentences, ellipsis.offset) ?? quoteAround(text, ellipsis.offset, ellipsis.offset + ellipsis.form.length),
|
|
87
87
|
values: { written: ellipsis.form, usual: minority.usual.form, count: minority.odd.length, of: ellipses.length, offset: ellipsis.offset },
|
|
88
88
|
}));
|
|
89
89
|
};
|
|
@@ -283,7 +283,7 @@ const nextText = (lines: readonly SourceLine[], index: number): string => {
|
|
|
283
283
|
};
|
|
284
284
|
|
|
285
285
|
/** A header field's line (From: Ann). Not any colon: a subject may hold one (Re: Lunch, 10:00 meeting, Q3: budget). */
|
|
286
|
-
const isHeaderField = (line: string, headerFields: readonly string[]): boolean => {
|
|
286
|
+
export const isHeaderField = (line: string, headerFields: readonly string[]): boolean => {
|
|
287
287
|
const name = fieldOf(line)?.name.toLowerCase();
|
|
288
288
|
return name !== undefined && headerFields.some((field) => field.toLowerCase() === name);
|
|
289
289
|
};
|
|
@@ -323,7 +323,8 @@ export const withoutReplyMarks = (subject: string, marks: readonly string[]): st
|
|
|
323
323
|
return subject.slice(dropped).trim();
|
|
324
324
|
};
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
/** The document's subject lines, read with its language's subject, reply-mark, header, greeting and sentence-end words. */
|
|
327
|
+
export const documentSubjects = (doc: ProseDocument): SubjectLine[] =>
|
|
327
328
|
subjectLines(
|
|
328
329
|
doc.source,
|
|
329
330
|
{
|
|
@@ -334,7 +335,10 @@ export const emailSubject: Detector = (doc, options): Finding[] =>
|
|
|
334
335
|
sentenceEnds: patternsOf(doc, "email-sentence-end"),
|
|
335
336
|
},
|
|
336
337
|
doc.replyQuotes ?? [],
|
|
337
|
-
)
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
export const emailSubject: Detector = (doc, options): Finding[] =>
|
|
341
|
+
documentSubjects(doc).flatMap((line): Finding[] => {
|
|
338
342
|
const length = [...withoutReferenceSuffix(line.subject)].length;
|
|
339
343
|
if (length > 0 && length <= options.limit) return [];
|
|
340
344
|
return [
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Detector, Finding, MarkupHeading } from "../plugin.ts";
|
|
2
2
|
import { findingAt, writtenHeadings } from "./markup-finding.ts";
|
|
3
3
|
import { opensSubsection } from "./heading-number.ts";
|
|
4
|
+
import { codeFences } from "./code-fences.ts";
|
|
5
|
+
import { releasesOf } from "../structure/release-list.ts";
|
|
4
6
|
|
|
5
7
|
/** HTML のコメント(「<!-- 後で書く -->」)。読み手には見えない。一つずつ外す(間の本文ごと一つのコメントと読まない)。 */
|
|
6
8
|
const HTML_COMMENT = /<!--[\s\S]*?-->/gu;
|
|
@@ -18,5 +20,11 @@ export const emptySections = (source: string, headings: readonly MarkupHeading[]
|
|
|
18
20
|
return showsNothing(source.slice(heading.end, next?.start ?? source.length));
|
|
19
21
|
});
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
/** A changelog's release with nothing to note (one that only promotes its pre-release) is empty by the generator's design. */
|
|
24
|
+
export const emptySection: Detector = (doc): Finding[] => {
|
|
25
|
+
const headings = writtenHeadings(doc);
|
|
26
|
+
const releaseStarts = new Set(releasesOf(doc.source, headings, codeFences(doc.source)).map((release) => release.start));
|
|
27
|
+
return emptySections(doc.source, headings)
|
|
28
|
+
.filter((heading) => !releaseStarts.has(heading.start))
|
|
29
|
+
.map((heading) => findingAt(doc, heading, { heading: heading.text }));
|
|
30
|
+
};
|
|
@@ -21,6 +21,13 @@ const CAPITALISED = /^\p{Lu}\p{Ll}/u;
|
|
|
21
21
|
|
|
22
22
|
const LETTER = /\p{L}/u;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* 数の前の -ly の語は数を絞る(only 26、nearly 40)。括弧の頭で読点が続く語は呼び名の前置き((collectively, the agencies))。
|
|
26
|
+
* どちらも動詞を修飾しておらず、畳む先が無い。
|
|
27
|
+
*/
|
|
28
|
+
const qualifiesNoVerb = (tokens: readonly Token[], at: number): boolean =>
|
|
29
|
+
tokens[at + 1]?.pos === "NUM" || (tokens[at - 1]?.surface === "(" && tokens[at + 1]?.surface === ",");
|
|
30
|
+
|
|
24
31
|
/**
|
|
25
32
|
* 頭だけ大文字の -ly の語は、文の途中なら解析器が語尾で副詞と当てた名前(July、Kelly)か題の語、文頭でも行全体が題の書き方なら
|
|
26
33
|
* 題の語(Frequently Asked Questions)。どちらも動詞に畳める副詞ではない。書き手の確かさを言う副詞(probably、apparently)も、畳む先の動詞が無い。
|
|
@@ -30,7 +37,7 @@ const lyAdverbsOf = (sentence: Sentence, stance: ReadonlySet<string>): Token[] =
|
|
|
30
37
|
const first = tokens.findIndex((token) => LETTER.test(token.surface));
|
|
31
38
|
const titleLine = isTitleCase(sentence.text) === true;
|
|
32
39
|
const isTitleWord = (token: Token, at: number): boolean => CAPITALISED.test(token.surface) && (at > first || titleLine);
|
|
33
|
-
return tokens.filter((token, at) => isLyAdverb(token) && !stance.has(token.surface.toLowerCase()) && !isTitleWord(token, at));
|
|
40
|
+
return tokens.filter((token, at) => isLyAdverb(token) && !stance.has(token.surface.toLowerCase()) && !isTitleWord(token, at) && !qualifiesNoVerb(tokens, at));
|
|
34
41
|
};
|
|
35
42
|
|
|
36
43
|
/**
|
|
@@ -67,20 +74,55 @@ export const beforeConcession = (tokens: readonly Token[]): readonly Token[] =>
|
|
|
67
74
|
return at === -1 ? tokens : tokens.slice(0, at);
|
|
68
75
|
};
|
|
69
76
|
|
|
77
|
+
/** The words a be can follow in the same verb: a modal (There will be), a perfect's have (There have been), a negation (There has never been). */
|
|
78
|
+
const BEFORE_BE = new Set([
|
|
79
|
+
"will",
|
|
80
|
+
"would",
|
|
81
|
+
"may",
|
|
82
|
+
"might",
|
|
83
|
+
"can",
|
|
84
|
+
"could",
|
|
85
|
+
"should",
|
|
86
|
+
"must",
|
|
87
|
+
"shall",
|
|
88
|
+
"'ll",
|
|
89
|
+
"wo",
|
|
90
|
+
"ca",
|
|
91
|
+
"has",
|
|
92
|
+
"have",
|
|
93
|
+
"had",
|
|
94
|
+
"'ve",
|
|
95
|
+
"'d",
|
|
96
|
+
"not",
|
|
97
|
+
"n't",
|
|
98
|
+
"never",
|
|
99
|
+
]);
|
|
100
|
+
|
|
101
|
+
/** The be of the verb right after head, past the modal, have and negation before it: There were / There have been / There will not be. */
|
|
102
|
+
const beAfter = (tokens: readonly Token[], head: Token): Token | undefined => {
|
|
103
|
+
const words = tokens.filter((token) => token.span.start >= head.span.end && token.pos !== "PUNCT");
|
|
104
|
+
const at = words.findIndex((token) => !BEFORE_BE.has(token.surface.toLowerCase()));
|
|
105
|
+
const verb = words[at];
|
|
106
|
+
return verb !== undefined && BE.has(verb.lemma ?? verb.surface.toLowerCase()) ? verb : undefined;
|
|
107
|
+
};
|
|
108
|
+
|
|
70
109
|
/**
|
|
71
110
|
* There is / It is ... that は、主語を後ろへ押しやって誰が何をするのかを消す。
|
|
72
111
|
* 「There is a need to review」は、誰が必要としているのかを言っていない。
|
|
73
112
|
*/
|
|
74
|
-
|
|
113
|
+
/** The sentence's opening, from There / It through its be: the finding names the form this sentence uses (There were, It was). */
|
|
114
|
+
type Opening = { readonly head: Token; readonly be: Token };
|
|
115
|
+
|
|
116
|
+
const expletiveAt = (tokens: readonly Token[]): Opening | undefined => {
|
|
75
117
|
const head = tokens.find((token) => token.pos !== "PUNCT");
|
|
76
118
|
if (head === undefined) return undefined;
|
|
77
119
|
const lead = head.surface.toLowerCase();
|
|
78
120
|
if (lead !== "there" && lead !== "it") return undefined;
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
121
|
+
const be = beAfter(tokens, head);
|
|
122
|
+
if (be === undefined) return undefined;
|
|
81
123
|
// "it is" は "it is raining" のような正当な用法があるので、that 節を伴うときだけ数える。
|
|
82
124
|
if (lead === "it" && !beforeConcession(tokens).some((token) => token.surface.toLowerCase() === "that")) return undefined;
|
|
83
|
-
return head;
|
|
125
|
+
return { head, be };
|
|
84
126
|
};
|
|
85
127
|
|
|
86
128
|
/** In minutes of who said what, a speaker's sentences are their own phrasing, recorded as said: not the writer's to recast. */
|
|
@@ -100,7 +142,7 @@ export const expletive: Detector = (doc, options): Finding[] => {
|
|
|
100
142
|
line: 0,
|
|
101
143
|
column: 0,
|
|
102
144
|
quote: sentence.text.trim(),
|
|
103
|
-
values: {
|
|
145
|
+
values: { form: doc.source.slice(at.head.span.start, at.be.span.end), count: hits.length, limit: options.limit, offset: at.head.span.start },
|
|
104
146
|
}));
|
|
105
147
|
};
|
|
106
148
|
|
|
@@ -166,8 +208,17 @@ export const conjunctionRun: Detector = (doc, options): Finding[] => {
|
|
|
166
208
|
/** Weekday and month names, capitalised in either style (the list leaves out May, March and August, also ordinary words). */
|
|
167
209
|
const FIXED_CASE_LISTS = ["calendar-name"] as const;
|
|
168
210
|
|
|
211
|
+
/**
|
|
212
|
+
* A heading that is a name with its acronym in brackets, either way round (Contractor Performance Assessment Report
|
|
213
|
+
* (CPARS), CORs (Contracting Officer Representatives)): the name keeps its capitals in either style.
|
|
214
|
+
*/
|
|
215
|
+
const NAME_THEN_ACRONYM = /^[^()]+\(\s*\p{Lu}{2,10}s?\s*\)\s*$/u;
|
|
216
|
+
const ACRONYM_THEN_NAME = /^\s*\p{Lu}{2,10}s?\s*\([^()]+\)\s*$/u;
|
|
217
|
+
const namesAcronym = (heading: string): boolean => NAME_THEN_ACRONYM.test(heading) || ACRONYM_THEN_NAME.test(heading);
|
|
218
|
+
|
|
169
219
|
const headingsOf = (sections: readonly Section[], fixedCase: ReadonlySet<string>): { readonly section: Section; readonly title: boolean }[] =>
|
|
170
220
|
sections.flatMap((section) => {
|
|
221
|
+
if (namesAcronym(section.heading)) return [];
|
|
171
222
|
const title = isTitleCase(section.heading, fixedCase);
|
|
172
223
|
return title === undefined ? [] : [{ section, title }];
|
|
173
224
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Detector, Finding } from "../plugin.ts";
|
|
2
|
+
import { findingAt } from "./markup-finding.ts";
|
|
3
|
+
import { enumerationMinorities, enumerationRuns } from "../enumeration-marks.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Item numbers written in mixed forms at one level of one list or one run of numbered paragraphs (1. 2. 3) 4.): the items in
|
|
7
|
+
* the run's minority form that count on with the others. Code and markup are read as the reader sees them (the prose view).
|
|
8
|
+
*/
|
|
9
|
+
export const enumerationMarkerMix: Detector = (doc): Finding[] =>
|
|
10
|
+
enumerationRuns(doc.prose ?? doc.source).flatMap((items) =>
|
|
11
|
+
enumerationMinorities(items).map(({ item, usual, count }) =>
|
|
12
|
+
findingAt(doc, { start: item.start, end: item.lineEnd }, { mark: item.mark, usual: usual.mark, count }),
|
|
13
|
+
),
|
|
14
|
+
);
|