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,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 詩や文章の題の行で、日付や年を添える開いたままの角括弧(「Year of Meteors [1859-60」)。題の印の書き方で、閉じ忘れではない。
|
|
3
|
+
* text は節の文字列で、offset は開きの位置。題は前後を空行で挟んだ一行で、開きの前に題の字があり、開きの後ろは行の終わりまで数を含む。
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** 題の行の長さの上限。これより長い行は本文の一行。 */
|
|
7
|
+
const MAX_TITLE_LENGTH = 80;
|
|
8
|
+
|
|
9
|
+
const DIGIT = /\d/u;
|
|
10
|
+
const BLANK = /^[ \t\u3000]*$/u;
|
|
11
|
+
|
|
12
|
+
const lineStartAt = (text: string, offset: number): number => text.lastIndexOf("\n", offset - 1) + 1;
|
|
13
|
+
|
|
14
|
+
const lineEndAt = (text: string, offset: number): number => {
|
|
15
|
+
const end = text.indexOf("\n", offset);
|
|
16
|
+
return end === -1 ? text.length : end;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const blankBefore = (text: string, lineStart: number): boolean => lineStart === 0 || BLANK.test(text.slice(lineStartAt(text, lineStart - 1), lineStart - 1));
|
|
20
|
+
|
|
21
|
+
const blankAfter = (text: string, lineEnd: number): boolean => lineEnd >= text.length || BLANK.test(text.slice(lineEnd + 1, lineEndAt(text, lineEnd + 1)));
|
|
22
|
+
|
|
23
|
+
export const isTitleDateOpen = (text: string, offset: number): boolean => {
|
|
24
|
+
if (text.charAt(offset) !== "[") return false;
|
|
25
|
+
const start = lineStartAt(text, offset);
|
|
26
|
+
const end = lineEndAt(text, offset);
|
|
27
|
+
const note = text.slice(offset + 1, end);
|
|
28
|
+
return (
|
|
29
|
+
text.slice(start, offset).trim() !== "" &&
|
|
30
|
+
end - start <= MAX_TITLE_LENGTH &&
|
|
31
|
+
!note.includes("]") &&
|
|
32
|
+
DIGIT.test(note) &&
|
|
33
|
+
blankBefore(text, start) &&
|
|
34
|
+
blankAfter(text, end)
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -143,8 +143,21 @@ export const unresolvedReferences = (source: string, markup: Markup): Span[] =>
|
|
|
143
143
|
const emptyLinks = (doc: ProseDocument, markup: Markup): Finding[] =>
|
|
144
144
|
markup.links.filter((link) => link.destination.trim() === "").map((link) => findingAt(doc, link, { link: quoteOf(doc.source, link) }, "empty"));
|
|
145
145
|
|
|
146
|
+
/**
|
|
147
|
+
* MDN の決まった節を作るマクロと、その節に MDN が付ける名前。訳した文書でも見出しの字からではなく、この名前で指す
|
|
148
|
+
* (「## ブラウザーの互換性」の下の {{Compat}} は #browser_compatibility)。
|
|
149
|
+
*/
|
|
150
|
+
const MDN_SECTION_MACROS: readonly (readonly [string, string])[] = [
|
|
151
|
+
["{{Compat", "browser_compatibility"],
|
|
152
|
+
["{{Specifications", "specifications"],
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
/** 文書が書いたマクロが名前を付ける節。 */
|
|
156
|
+
const macroAnchors = (source: string): string[] => MDN_SECTION_MACROS.filter(([macro]) => source.includes(macro)).map(([, id]) => id);
|
|
157
|
+
|
|
146
158
|
const missingAnchors = (doc: ProseDocument, markup: Markup): Finding[] => {
|
|
147
|
-
const
|
|
159
|
+
const written = anchorsOf(markup);
|
|
160
|
+
const anchors = { ...written, ids: new Set([...written.ids, ...macroAnchors(doc.source)]) };
|
|
148
161
|
return markup.links
|
|
149
162
|
.filter((link) => link.destination.startsWith("#") && !reachesAnchor(link.destination, anchors))
|
|
150
163
|
.map((link) => findingAt(doc, link, { link: quoteOf(doc.source, link), target: link.destination }, "anchor"));
|
|
@@ -119,6 +119,17 @@ const notWrittenAsTerm = (tokens: readonly Token[], start: number, end: number,
|
|
|
119
119
|
return tokens.slice(start + 1, end - 1).some((token) => isCapitalised(token) && small.has(token.surface.toLowerCase()));
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
+
/** Small words capitalised in mid-sentence that make the sentence title-case writing (Plus Of Any Revenue From Awarded Contract). */
|
|
123
|
+
const TITLE_CASE_SMALL_WORDS = 2;
|
|
124
|
+
|
|
125
|
+
/** A sentence that capitalises its small words in mid-sentence: every word is capitalised, so none names a term. */
|
|
126
|
+
const capitalisesSmallWords = (tokens: readonly Token[], small: ReadonlySet<string>): boolean =>
|
|
127
|
+
tokens.slice(1).filter((token) => isCapitalised(token) && small.has(token.surface.toLowerCase())).length >= TITLE_CASE_SMALL_WORDS;
|
|
128
|
+
|
|
129
|
+
/** One word that is the last word of a longer run earlier in the sentence: a shortened back-reference (Master Purchase Commitments … such Commitments). */
|
|
130
|
+
const shortensEarlierRun = (tokens: readonly Token[], runs: readonly Run[], at: number): boolean =>
|
|
131
|
+
runs.some((run) => run.end - run.start > 1 && run.end <= at && tokens[run.end - 1]?.surface === tokens[at]?.surface);
|
|
132
|
+
|
|
122
133
|
const inside = (offset: number, spans: readonly Span[]): boolean => spans.some((span) => span.start <= offset && offset < span.end);
|
|
123
134
|
|
|
124
135
|
/** Used like a defined term: after a lower-case word, and not a modifier of a lower-case noun after it (the Premium plan). */
|
|
@@ -304,17 +315,20 @@ export const capitalisedTerms = (input: CapitalisedInput): CapitalisedTerm[] =>
|
|
|
304
315
|
const divisions = new Set(input.words.divisions.flatMap(formsOf));
|
|
305
316
|
const known = new Set([...input.defined.map((definition) => definition.term), ...input.named, ...input.words.names].flatMap(formsOf));
|
|
306
317
|
const isKnown = (term: string): boolean => partsOf(term).some((part) => formsOf(part).some((form) => known.has(form)));
|
|
307
|
-
const uses = input.sentences.flatMap((tokens) =>
|
|
308
|
-
|
|
318
|
+
const uses = input.sentences.flatMap((tokens) => {
|
|
319
|
+
if (capitalisesSmallWords(tokens, small)) return [];
|
|
320
|
+
const runs = runsOf(tokens, joiners, near);
|
|
321
|
+
return runs.flatMap(({ start, end }): CapitalisedTerm[] => {
|
|
309
322
|
const first = tokens[start];
|
|
310
323
|
const last = tokens[end - 1];
|
|
311
324
|
if (first === undefined || last === undefined || !placedLikeATerm(tokens[start - 1], tokens[end])) return [];
|
|
325
|
+
if (end - start === 1 && shortensEarlierRun(tokens, runs, start)) return [];
|
|
312
326
|
if (inside(first.span.start, input.marked) || formsOf(first.surface).some((form) => divisions.has(form))) return [];
|
|
313
327
|
const term = input.source.slice(first.span.start, last.span.end);
|
|
314
328
|
if (isKnown(term) || isName(tokens, start, end, term) || notWrittenAsTerm(tokens, start, end, small)) return [];
|
|
315
329
|
return writtenInLowerCase(input.readable, term) ? [] : [{ offset: first.span.start, term }];
|
|
316
|
-
})
|
|
317
|
-
);
|
|
330
|
+
});
|
|
331
|
+
});
|
|
318
332
|
return uses.filter((use, index) => uses.findIndex((other) => formsOf(other.term).some((form) => formsOf(use.term).includes(form))) === index);
|
|
319
333
|
};
|
|
320
334
|
|
|
@@ -11,6 +11,7 @@ import { tableRateMismatches, type ChangeTable, type ColumnRole, type ColumnWord
|
|
|
11
11
|
import { cellsOf, tablesOf } from "../facts/table-facts.ts";
|
|
12
12
|
import { linesOf } from "../structure/lines.ts";
|
|
13
13
|
import { proseAndTablesOf } from "../table-text.ts";
|
|
14
|
+
import { withTiedFigures } from "../structure/change-rate-tied.ts";
|
|
14
15
|
|
|
15
16
|
const patternsOf = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
|
|
16
17
|
|
|
@@ -152,6 +153,15 @@ const columnWordsOf = (doc: ProseDocument): ColumnWord[] =>
|
|
|
152
153
|
const changeTablesOf = (doc: ProseDocument): ChangeTable[] =>
|
|
153
154
|
tablesOf(linesOf(proseAndTablesOf(doc))).map((table) => ({ header: cellsOf(table.header), rows: table.rows.map(cellsOf) }));
|
|
154
155
|
|
|
156
|
+
const NOUN: ReadonlySet<string> = new Set(["NOUN", "PROPN"]);
|
|
157
|
+
|
|
158
|
+
/** Whether the token starting at offset is a noun, as the tagger says; undefined when no token starts there or none is tagged. */
|
|
159
|
+
const nounAt = (doc: ProseDocument, offset: number): boolean | undefined => {
|
|
160
|
+
const { tokens, index } = tokenAt(doc, offset);
|
|
161
|
+
const pos = tokens[index]?.pos ?? "";
|
|
162
|
+
return pos === "" ? undefined : NOUN.has(pos);
|
|
163
|
+
};
|
|
164
|
+
|
|
155
165
|
const tableIssues = (doc: ProseDocument): StructureIssue[] => {
|
|
156
166
|
const words = columnWordsOf(doc);
|
|
157
167
|
return words.length === 0 ? [] : tableRateMismatches(changeTablesOf(doc), words);
|
|
@@ -163,13 +173,28 @@ const sentenceIssues = (doc: ProseDocument): StructureIssue[] => {
|
|
|
163
173
|
const units = patternsOf(doc, "percent-unit");
|
|
164
174
|
const multipliers = patternsOf(doc, "amount-multiplier").map((word) => word.toLowerCase());
|
|
165
175
|
const taken = nodes.map((node) => node.span);
|
|
166
|
-
const
|
|
176
|
+
const counted = countedFigures(doc, taken, multipliers);
|
|
177
|
+
const rates = ratesOf(doc, nodes, units);
|
|
178
|
+
const directions = directionsOf(doc);
|
|
179
|
+
const marks = marksOf(doc, "change-base");
|
|
180
|
+
const tie = {
|
|
181
|
+
source: doc.source,
|
|
182
|
+
rates,
|
|
183
|
+
directions,
|
|
184
|
+
marks,
|
|
185
|
+
counted,
|
|
186
|
+
quantities: taken,
|
|
187
|
+
percentWords: units,
|
|
188
|
+
multipliers,
|
|
189
|
+
isNounAt: (offset: number) => nounAt(doc, offset),
|
|
190
|
+
};
|
|
191
|
+
const figures = withTiedFigures(tie, [...treeFigures(doc, nodes, units, multipliers), ...counted]);
|
|
167
192
|
const text = {
|
|
168
193
|
sentences: doc.sentences.map((sentence) => sentence.span),
|
|
169
194
|
figures,
|
|
170
|
-
rates
|
|
171
|
-
directions
|
|
172
|
-
marks
|
|
195
|
+
rates,
|
|
196
|
+
directions,
|
|
197
|
+
marks,
|
|
173
198
|
targets: marksOf(doc, "change-target"),
|
|
174
199
|
periods: periodsOf(doc, figures),
|
|
175
200
|
breaks: breaksOf(doc),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Detector, DetectorOptions, DocumentProfile, Finding, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
2
2
|
import { compacted } from "./gram-place.ts";
|
|
3
|
-
import { leadingCounter, trailingOrdinals, trailingPrefix } from "./counter-edge.ts";
|
|
3
|
+
import { leadingCounter, trailingOrdinals, trailingPrefix, trailingQuantity } from "./counter-edge.ts";
|
|
4
4
|
import { trailingAddressee, type AddresseeSuffix } from "./addressee-edge.ts";
|
|
5
5
|
import { leadingPrefix, trailingTitle, type AddresseeWords } from "./addressee-title-edge.ts";
|
|
6
6
|
import {
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
followsUnit,
|
|
9
9
|
fillsGloss,
|
|
10
10
|
holdsName,
|
|
11
|
+
inWorkTitle,
|
|
11
12
|
isListItem,
|
|
12
13
|
labelsLines,
|
|
13
14
|
leadingDate,
|
|
@@ -20,7 +21,7 @@ import { isNameList } from "./name-list-sentence.ts";
|
|
|
20
21
|
import { maskAddresses } from "../address-chain.ts";
|
|
21
22
|
import { isAddressRun } from "./place-run.ts";
|
|
22
23
|
import { isOneName } from "./name-run.ts";
|
|
23
|
-
import { isOrganisationHead, isOrganisationRun, type OrganisationWords } from "./organisation-run.ts";
|
|
24
|
+
import { closesAfterDot, isOrganisationHead, isOrganisationRun, type OrganisationWords } from "./organisation-run.ts";
|
|
24
25
|
import { endsInTitle, inStatuteTitle, isTitlePosition, isTitledName, repeatedRuns, titleBody, type TitleWords } from "./titled-run.ts";
|
|
25
26
|
import { proseText } from "../measure.ts";
|
|
26
27
|
import { maskSpans } from "../mask.ts";
|
|
@@ -60,6 +61,8 @@ type KanjiRun = {
|
|
|
60
61
|
readonly listItem: boolean;
|
|
61
62
|
/** 連なりを中に含む括弧(ENCLOSING_MARKS)の中身の、文書全体の座標での範囲。 */
|
|
62
63
|
readonly brackets: readonly Span[];
|
|
64
|
+
/** 連なりが、引用の中の引用でない二重鉤括弧『』の中にある(『原爆犠牲国民学校教師と子どもの碑』)。 */
|
|
65
|
+
readonly inWorkTitle: boolean;
|
|
63
66
|
};
|
|
64
67
|
|
|
65
68
|
const SPACE = /\s/gu;
|
|
@@ -104,6 +107,7 @@ const runsOf = (sentence: Sentence, profile: DocumentProfile | undefined, names:
|
|
|
104
107
|
alone: false,
|
|
105
108
|
listItem: false,
|
|
106
109
|
brackets: [],
|
|
110
|
+
inWorkTitle: false,
|
|
107
111
|
};
|
|
108
112
|
const span = { start: sentence.span.start + start, end: sentence.span.start + last + 1 };
|
|
109
113
|
const after = sentence.text.slice(0, start).trim() === "" ? sentence.text.slice(last + 1) : undefined;
|
|
@@ -125,6 +129,7 @@ const runsOf = (sentence: Sentence, profile: DocumentProfile | undefined, names:
|
|
|
125
129
|
alone,
|
|
126
130
|
listItem,
|
|
127
131
|
brackets,
|
|
132
|
+
inWorkTitle: inWorkTitle(sentence.text, start, last + 1),
|
|
128
133
|
};
|
|
129
134
|
});
|
|
130
135
|
};
|
|
@@ -186,15 +191,6 @@ const isPlaceName = (tokens: readonly Token[], span: Span, words: NameWords, for
|
|
|
186
191
|
return isAddressRun(tokens, covering, words.topUnits) || isOneName(tokens, covering) || isOrganisationRun(tokens, covering, words.organisation, formBefore);
|
|
187
192
|
};
|
|
188
193
|
|
|
189
|
-
/** 連なりのすぐ後ろの、中黒で続く語の並び(・適応小委員会、・学位授与機構)。 */
|
|
190
|
-
const DOTTED_TAIL = /^(?:・[一-鿿ァ-ヶー]+)+/u;
|
|
191
|
-
|
|
192
|
-
/** 連なりの後ろ(next)が中黒で続き、最後の語が組織の語で閉じるか(社会保障審議会企業年金・個人年金部会の「・個人年金部会」)。 */
|
|
193
|
-
const closesAfterDot = (next: string, units: readonly string[]): boolean => {
|
|
194
|
-
const last = DOTTED_TAIL.exec(next)?.[0].split("・").at(-1);
|
|
195
|
-
return last !== undefined && units.some((unit) => last.endsWith(unit));
|
|
196
|
-
};
|
|
197
|
-
|
|
198
194
|
/** 中黒の後ろで閉じる組織の名前の前半(独立行政法人大学改革支援・学位授与機構の「独立行政法人大学改革支援」)。 */
|
|
199
195
|
const isDottedName = (tokens: readonly Token[], span: Span, run: KanjiRun, organisation: OrganisationWords, formBefore: boolean): boolean =>
|
|
200
196
|
closesAfterDot(run.next, organisation.units) && isOrganisationHead(tokens, coveringOf(tokens, span), organisation, formBefore);
|
|
@@ -224,6 +220,7 @@ const tailOf = (tokens: readonly Token[], run: KanjiRun, span: Span, words: Name
|
|
|
224
220
|
const suffix =
|
|
225
221
|
prefix === undefined
|
|
226
222
|
? (trailingOrdinals(tokens, span, run.text) ??
|
|
223
|
+
trailingQuantity(tokens, span, run.text) ??
|
|
227
224
|
trailingConjunction(tokens, span.start, span.end, run.text) ??
|
|
228
225
|
trailingAddressee(tokens, span.end, run.text, words.addressee) ??
|
|
229
226
|
trailingAddressee(tokens, span.end, run.text, words.listSuffixes))
|
|
@@ -259,7 +256,7 @@ const measuredOf = (tokens: readonly Token[], run: KanjiRun, span: Span, words:
|
|
|
259
256
|
|
|
260
257
|
/** 書き手が名前として示した連なり(括弧でくくった、一行に置いた、用語集の見出し語、文脈で名前と分かる)。 */
|
|
261
258
|
const isPresentedName = (run: KanjiRun, context: RunContext): boolean =>
|
|
262
|
-
run.quoted || run.label || (context.headwords && run.alone) || isNamedByContext(run, context.words);
|
|
259
|
+
run.quoted || run.inWorkTitle || run.label || (context.headwords && run.alone) || isNamedByContext(run, context.words);
|
|
263
260
|
|
|
264
261
|
/**
|
|
265
262
|
* 数えない連なりは空。頭の、数に付いた助数詞(2日日本弁護士連合会の「日」)と、尻の、数に付く接頭の語(施行令第172条の「第」)と
|
|
@@ -285,19 +282,18 @@ const surfaceWithin = (token: Token, span: Span): string =>
|
|
|
285
282
|
/**
|
|
286
283
|
* 連なりの、知っている語(文書がほかで単独で使う組織の名前と法令の名前、連なりを閉じる決まった語、職名の前後の人の名前)を外した残りのうち、最も長いもの。
|
|
287
284
|
* 安全保障理事会常任理事国は(安全保障理事会を単独で使う文書なら)「常任理事国」、日本国内閣総理大臣は「日本国」を数える。
|
|
288
|
-
*
|
|
289
|
-
* 連なりの中ほどの、並べた物の後ろに付く語(高齢運転者等専用駐車区間の「等」)は、語の終わりを見せるので、その前後を別に数える。
|
|
285
|
+
* 名前に普通の語が続く連なり(日本弁護士連合会臨時総会決議)は、名前がその文書で単独で使われていなければ、まるごと数える。連なりの中ほどの、並べた物の後ろに付く語(高齢運転者等専用駐車区間の「等」)は語の終わりを、前を指す語(事業当連結会計年度の「当」)は語の頭を見せるので、その前後を別に数える。
|
|
290
286
|
*/
|
|
291
287
|
const longestUnknown = (tokens: readonly Token[], rest: Span, keptHead: string, context: RunContext): string => {
|
|
292
288
|
const runTokens = coveringOf(tokens, rest).flatMap((index) => tokens.slice(index, index + 1));
|
|
293
289
|
const words = runTokens.map((token) => surfaceWithin(token, rest));
|
|
294
|
-
const
|
|
290
|
+
const breaks = [...context.words.listSuffixes, ...context.words.references];
|
|
295
291
|
// A run as long as the text holds no known word; reading it word by word would take a pass per word.
|
|
296
|
-
if (!holdsKnown(words, [...context.terms, ...context.words.knownWords],
|
|
292
|
+
if (!holdsKnown(words, [...context.terms, ...context.words.knownWords], breaks)) return keptHead + words.join("");
|
|
297
293
|
const isKnown = (start: number, end: number): boolean => {
|
|
298
294
|
const piece = words.slice(start, end).join("");
|
|
299
295
|
return (
|
|
300
|
-
(end === start + 1 && isInnerSuffix(words, start,
|
|
296
|
+
(end === start + 1 && isInnerSuffix(words, start, breaks)) ||
|
|
301
297
|
context.terms.has(piece) ||
|
|
302
298
|
(end === words.length && context.words.knownWords.has(piece)) ||
|
|
303
299
|
isTitledPerson(runTokens, words, { start, end }, context.words.knownWords, context.maxKnownWords)
|
|
@@ -2,9 +2,7 @@ import type { Detector, Finding, Lexicon, ProseDocument, Span } from "../plugin.
|
|
|
2
2
|
import { escapeRegExp } from "../orthography.ts";
|
|
3
3
|
import { isQuotedAlone } from "../quoted-span.ts";
|
|
4
4
|
import { findingAt, markupOf } from "./markup-finding.ts";
|
|
5
|
-
|
|
6
|
-
/** One marker a chat interface leaves when its answer is pasted: where it is and what was written. */
|
|
7
|
-
export type ChatMarker = { readonly matched: string; readonly span: Span };
|
|
5
|
+
import { wholeMarks, type ChatMarker } from "./chat-mark-extent.ts";
|
|
8
6
|
|
|
9
7
|
/** Every place a lexicon pattern is written in `text`, case and all, in the order they appear. */
|
|
10
8
|
export const markersIn = (text: string, lexicon: Lexicon): ChatMarker[] =>
|
|
@@ -69,9 +67,10 @@ export const standsAlone = (source: string, span: Span): boolean => {
|
|
|
69
67
|
return withoutSurrounding(`${before}${marker}${after}`) === marker;
|
|
70
68
|
};
|
|
71
69
|
|
|
72
|
-
/** Each
|
|
70
|
+
/** Each mark is a leftover in its own right, so each is reported once, whole, from the first. */
|
|
73
71
|
export const chatCitationResidue: Detector = (doc, options): Finding[] => {
|
|
74
|
-
const
|
|
72
|
+
const found = markersIn(doc.source, options.lexicon ?? []).filter((marker) => reachesReader(doc, marker.span) && !standsAlone(doc.source, marker.span));
|
|
73
|
+
const markers = wholeMarks(doc.source, found);
|
|
75
74
|
if (markers.length === 0 || markers.length < options.limit) return [];
|
|
76
75
|
return markers.map((marker) => findingAt(doc, marker.span, { matched: marker.matched, count: markers.length, limit: options.limit }));
|
|
77
76
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
/** One marker a chat interface leaves when its answer is pasted: where it is and what was written. */
|
|
4
|
+
export type ChatMarker = { readonly matched: string; readonly span: Span };
|
|
5
|
+
|
|
6
|
+
const CLOSING_OF: Readonly<Record<string, string>> = { "[": "]", "【": "】" };
|
|
7
|
+
const OPENING_OF: Readonly<Record<string, string>> = { "]": "[", "】": "【" };
|
|
8
|
+
const LEAD_IN = ":";
|
|
9
|
+
|
|
10
|
+
const lineEndAfter = (source: string, index: number): number => {
|
|
11
|
+
const end = source.indexOf("\n", index);
|
|
12
|
+
return end === -1 ? source.length : end;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** Where the bracket opened at `open` closes on its line (just after the closer), or undefined when it does not. */
|
|
16
|
+
const closedAt = (source: string, open: number): number | undefined => {
|
|
17
|
+
const closer = CLOSING_OF[source[open] ?? ""];
|
|
18
|
+
if (closer === undefined) return undefined;
|
|
19
|
+
const close = source.indexOf(closer, open + 1);
|
|
20
|
+
return close === -1 || close >= lineEndAfter(source, open) ? undefined : close + 1;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** A marker that opens a bracket (contentReference[) runs to its closer and any {…} right after it. */
|
|
24
|
+
const forwardEnd = (source: string, span: Span): number => {
|
|
25
|
+
const opened = span.end - 1;
|
|
26
|
+
const closed = CLOSING_OF[source[opened] ?? ""] === undefined ? undefined : closedAt(source, opened);
|
|
27
|
+
const end = closed ?? span.end;
|
|
28
|
+
return source[end] === "{" ? (closedBraceAt(source, end) ?? end) : end;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const closedBraceAt = (source: string, open: number): number | undefined => {
|
|
32
|
+
const close = source.indexOf("}", open + 1);
|
|
33
|
+
return close === -1 || close >= lineEndAfter(source, open) ? undefined : close + 1;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** A marker that closes a bracket it did not open (†source】) starts where that bracket opens on its line. */
|
|
37
|
+
const backwardStart = (source: string, span: Span): number => {
|
|
38
|
+
const written = source.slice(span.start, span.end);
|
|
39
|
+
const opener = OPENING_OF[written.at(-1) ?? ""];
|
|
40
|
+
if (opener === undefined || written.includes(opener)) return span.start;
|
|
41
|
+
const lineStart = source.lastIndexOf("\n", span.start - 1) + 1;
|
|
42
|
+
const open = source.lastIndexOf(opener, span.start - 1);
|
|
43
|
+
return open < lineStart ? span.start : open;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** The whole mark a marker belongs to as written (:contentReference[oaicite:0]{index=0}, 【4:0†source】). */
|
|
47
|
+
export const markExtent = (source: string, span: Span): Span => {
|
|
48
|
+
const start = backwardStart(source, span);
|
|
49
|
+
const end = forwardEnd(source, span);
|
|
50
|
+
const widened = end > span.end || start < span.start;
|
|
51
|
+
return { start: widened && source[start - 1] === LEAD_IN ? start - 1 : start, end };
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** One marker per mark: each widened to its whole mark, and the markers inside a mark already taken dropped. */
|
|
55
|
+
export const wholeMarks = (source: string, markers: readonly ChatMarker[]): ChatMarker[] =>
|
|
56
|
+
markers
|
|
57
|
+
.map((marker) => markExtent(source, marker.span))
|
|
58
|
+
.toSorted((left, right) => left.start - right.start || right.end - left.end)
|
|
59
|
+
.reduce<Span[]>((kept, span) => {
|
|
60
|
+
const last = kept.at(-1);
|
|
61
|
+
return last !== undefined && span.start < last.end ? kept : [...kept, span];
|
|
62
|
+
}, [])
|
|
63
|
+
.map((span) => ({ matched: source.slice(span.start, span.end), span }));
|
|
@@ -3,6 +3,7 @@ import { isWithinAny, quotedIn } from "../quoted-span.ts";
|
|
|
3
3
|
import { definitionWordsOf, isParallelDefinition } from "./parallel-definition.ts";
|
|
4
4
|
import { continuesThrough } from "./register.ts";
|
|
5
5
|
import { beatsOf } from "./ending-refrain.ts";
|
|
6
|
+
import { isFlattenedTable } from "./sentence-parts.ts";
|
|
6
7
|
|
|
7
8
|
// The shape of a clause read from its words: how it ends, a paired word left alone, an adverb that needs a
|
|
8
9
|
// negation, a particle used where another one belongs. Every word comes from a lexicon; this file knows parts of speech.
|
|
@@ -63,13 +64,15 @@ const opensItem = (sentence: Sentence): boolean => ITEM_LABEL.test(sentence.text
|
|
|
63
64
|
/**
|
|
64
65
|
* Runs of consecutive sentences with the same ending. A sentence with no ending to compare closes a run, and so does a
|
|
65
66
|
* question run together with the next one inside a single sentence (これはリストか?順序付きか?などです。): it is not the writer's ending.
|
|
66
|
-
* A
|
|
67
|
+
* A table a converter flattened into a sentence (its cells and the note after it) closes a run too: its stop is the note's, not
|
|
68
|
+
* the end of a sentence the writer built on the one before. A sentence opening a labelled item ([通信関連]…) starts a new run:
|
|
69
|
+
* entries of a list end alike by design.
|
|
67
70
|
*/
|
|
68
|
-
export const endingRuns = (sentences: readonly Sentence[]): Ended[][] =>
|
|
71
|
+
export const endingRuns = (sentences: readonly Sentence[], eras: readonly string[] = []): Ended[][] =>
|
|
69
72
|
sentences
|
|
70
73
|
.map((sentence, index) => ({
|
|
71
74
|
sentence,
|
|
72
|
-
ending: continuesThrough(sentences, index) ? undefined : endingOf(sentence),
|
|
75
|
+
ending: continuesThrough(sentences, index) || isFlattenedTable(sentence.text, eras) ? undefined : endingOf(sentence),
|
|
73
76
|
opensItem: opensItem(sentence),
|
|
74
77
|
}))
|
|
75
78
|
.reduce<Ended[][]>((runs, ended) => {
|
|
@@ -97,8 +100,9 @@ const runFinding = (run: readonly Ended[], limit: number): Finding => {
|
|
|
97
100
|
*/
|
|
98
101
|
export const endingRun: Detector = (doc, options): Finding[] => {
|
|
99
102
|
const words = definitionWordsOf(options.lexicon);
|
|
103
|
+
const eras = (doc.lexicons["calendar-era"] ?? []).map((entry) => entry.pattern);
|
|
100
104
|
return doc.paragraphs.flatMap((paragraph) =>
|
|
101
|
-
endingRuns(paragraph.sentences)
|
|
105
|
+
endingRuns(paragraph.sentences, eras)
|
|
102
106
|
.map((run) => ({ run, sentences: run.map(({ sentence }) => sentence) }))
|
|
103
107
|
.filter(({ sentences }) => beatsOf(sentences, patternsOf(options.lexicon, "being")) > options.limit && !isParallelDefinition(sentences, words))
|
|
104
108
|
.map(({ run }) => runFinding(run, options.limit)),
|
|
@@ -41,13 +41,11 @@ const occurrencesOf = (text: string, word: string): Span[] =>
|
|
|
41
41
|
}));
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* prefer
|
|
44
|
+
* prefer の「使わない書き方」が動詞のとき、活用した形の範囲(文の中の字の位置)。「使う書き方」の中に出たものは除く。
|
|
45
45
|
* 大文字小文字だけ違う組(Javascript・JavaScript)は語で照らすと区別が消えるので、字で探す側に任せる。
|
|
46
46
|
*/
|
|
47
|
-
export const
|
|
47
|
+
export const conjugatedSpansOutside = (sentence: Sentence, entry: LexiconEntry, use: string): Span[] => {
|
|
48
48
|
if (entry.pattern.toLowerCase() === use.toLowerCase()) return [];
|
|
49
49
|
const covered = occurrencesOf(sentence.text, use);
|
|
50
|
-
return conjugatedSpans(sentence, entry)
|
|
51
|
-
.filter((span) => !covered.some((cover) => cover.start <= span.start && span.end <= cover.end))
|
|
52
|
-
.map((span) => span.start);
|
|
50
|
+
return conjugatedSpans(sentence, entry).filter((span) => !covered.some((cover) => cover.start <= span.start && span.end <= cover.end));
|
|
53
51
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { pairMinority, type PairUses } from "./contraction-minority.ts";
|
|
2
2
|
import { blankRanges, isTermList, withoutMentions, withoutQuotations } from "./contraction-mention.ts";
|
|
3
3
|
import { stressedWords } from "./contraction-emphasis.ts";
|
|
4
|
-
import { noticeSentences, talksAboutContractions, warningSentences } from "./contraction-set-apart.ts";
|
|
4
|
+
import { noticeSentences, plainSummarySentences, talksAboutContractions, warningSentences } from "./contraction-set-apart.ts";
|
|
5
5
|
import { escapeRegExp, straightApostrophes } from "../orthography.ts";
|
|
6
6
|
import type { Detector, Finding, ProseDocument, Sentence, Span } from "../plugin.ts";
|
|
7
7
|
|
|
@@ -76,6 +76,12 @@ const emphasisOf = (doc: ProseDocument): readonly Span[] => (doc.prose === undef
|
|
|
76
76
|
export const contractionMix: Detector = (doc, options): Finding[] => {
|
|
77
77
|
const stressed = emphasisOf(doc);
|
|
78
78
|
const notices = noticeSentences(doc.paragraphs, doc.lexicons["notice-phrase"] ?? []);
|
|
79
|
+
const summaries = plainSummarySentences(
|
|
80
|
+
doc.paragraphs,
|
|
81
|
+
doc.sections,
|
|
82
|
+
doc.source,
|
|
83
|
+
(doc.lexicons["summary-label"] ?? []).map((entry) => entry.pattern),
|
|
84
|
+
);
|
|
79
85
|
const terms = doc.lexicons["contraction-term"] ?? [];
|
|
80
86
|
const warnings = warningSentences(
|
|
81
87
|
doc.paragraphs,
|
|
@@ -90,7 +96,7 @@ export const contractionMix: Detector = (doc, options): Finding[] => {
|
|
|
90
96
|
return pair === undefined || pair.count > options.limit ? [] : [pair];
|
|
91
97
|
});
|
|
92
98
|
const hits = doc.sentences.flatMap((sentence) => {
|
|
93
|
-
if (!isWriters(sentence) || warnings.has(sentence)) return [];
|
|
99
|
+
if (!isWriters(sentence) || warnings.has(sentence) || summaries.has(sentence)) return [];
|
|
94
100
|
const pointable = pointableText(sentence, stressed);
|
|
95
101
|
const pair = mixed.find((candidate) => usesMinority(pointable, candidate));
|
|
96
102
|
return pair === undefined ? [] : [{ sentence, pair }];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { entryIn } from "./lexicon-match.ts";
|
|
2
2
|
import { warningTextStart } from "../warning-action.ts";
|
|
3
|
-
import type { LexiconEntry, Paragraph, Sentence } from "../plugin.ts";
|
|
3
|
+
import type { LexiconEntry, Paragraph, Section, Sentence } from "../plugin.ts";
|
|
4
4
|
|
|
5
5
|
// Sentences whose forms say nothing about the writer's choice of register. Pure: reads paragraphs, sentences and the source;
|
|
6
|
-
// the words come from the language's notice-phrase, contraction-term and warning-label lexicons.
|
|
6
|
+
// the words come from the language's notice-phrase, contraction-term, summary-label and warning-label lexicons.
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The sentences of a paragraph of disclaimer wording (…does not constitute or imply its endorsement…). A publisher appends
|
|
@@ -42,6 +42,26 @@ const opensWarning = (text: string, labels: readonly string[]): boolean => {
|
|
|
42
42
|
return isLabel(ADMONITION.exec(text)?.[1], labels);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
+
const opensWith = (paragraph: Paragraph, source: string, labels: readonly string[]): boolean =>
|
|
46
|
+
warningTextStart(source.slice(paragraph.span.start, paragraph.span.end).trimStart(), labels) !== undefined;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The plain-language register of a document that sums its clauses up beside them (**Short version:** _You may close your
|
|
50
|
+
* Account at any time._): the labelled summaries and the introduction before the first heading. Its forms are a register the
|
|
51
|
+
* writer chose apart from the clauses: counted, never pointed at. Without a labelled summary, nothing is set apart.
|
|
52
|
+
*/
|
|
53
|
+
export const plainSummarySentences = (
|
|
54
|
+
paragraphs: readonly Paragraph[],
|
|
55
|
+
sections: readonly Section[],
|
|
56
|
+
source: string,
|
|
57
|
+
labels: readonly string[],
|
|
58
|
+
): Set<Sentence> => {
|
|
59
|
+
const summaries = paragraphs.filter((paragraph) => opensWith(paragraph, source, labels));
|
|
60
|
+
if (summaries.length === 0) return new Set();
|
|
61
|
+
const introduction = sections.filter((section) => section.depth === 0).flatMap((section) => section.sentences);
|
|
62
|
+
return new Set([...summaries.flatMap((paragraph) => paragraph.sentences), ...introduction]);
|
|
63
|
+
};
|
|
64
|
+
|
|
45
65
|
/**
|
|
46
66
|
* The sentences of a warning (Do not run this on an internet-facing cluster.). A warning spells the negative out for
|
|
47
67
|
* stress, as a writer bolds a word: counted, never pointed at.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Lexicon, LexiconEntry, Sentence } from "../plugin.ts";
|
|
1
|
+
import type { Lexicon, LexiconEntry, Sentence, Token } from "../plugin.ts";
|
|
2
2
|
import { escapeRegExp } from "../orthography.ts";
|
|
3
3
|
import { comparableText, comparableWords, entryCloses, entryIn, entryOpens, entryRanges } from "./lexicon-match.ts";
|
|
4
4
|
|
|
@@ -67,6 +67,41 @@ const opensWithWord = (sentence: Sentence, entry: LexiconEntry): boolean => {
|
|
|
67
67
|
const nextAffirms = (next: Sentence | undefined, words: ContrastWords): boolean =>
|
|
68
68
|
next !== undefined && groupOf(words.turns, ACROSS).some((turn) => opensWithWord(next, turn)) && !words.leads.some((lead) => entryIn(next, lead));
|
|
69
69
|
|
|
70
|
+
const ECHO = "echo";
|
|
71
|
+
const VERBAL: ReadonlySet<string> = new Set(["VERB", "AUX"]);
|
|
72
|
+
const SKIPPED: ReadonlySet<string> = new Set(["ADV", "PART"]);
|
|
73
|
+
|
|
74
|
+
const lemmaOf = (token: Token): string => comparableWords(token.lemma ?? token.surface);
|
|
75
|
+
|
|
76
|
+
/** The verb a denial denies: the verb right after it (didn't build → build), or its own (weren't → be). */
|
|
77
|
+
const deniedVerb = (sentence: Sentence, lead: LexiconEntry): string | undefined => {
|
|
78
|
+
const tokens = sentence.tokens ?? [];
|
|
79
|
+
const range = entryRanges(sentence, lead)[0];
|
|
80
|
+
if (range === undefined) return undefined;
|
|
81
|
+
const next = tokens.slice(range.end).find((token) => !SKIPPED.has(token.pos));
|
|
82
|
+
const own = tokens.slice(range.start, range.end).find((token) => VERBAL.has(token.pos));
|
|
83
|
+
const verb = next?.pos === "VERB" ? next : own;
|
|
84
|
+
return verb === undefined ? undefined : lemmaOf(verb);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** The verb right after the subject that opens the sentence (We built → build). */
|
|
88
|
+
const affirmedVerb = (sentence: Sentence): string | undefined => {
|
|
89
|
+
const verb = (sentence.tokens ?? []).slice(1).find((token) => !SKIPPED.has(token.pos));
|
|
90
|
+
return verb !== undefined && VERBAL.has(verb.pos) ? lemmaOf(verb) : undefined;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* A denial whose own subject (We, You) opens the next sentence and says the denied verb again, without a denial
|
|
95
|
+
* (We didn't build this for speed. We built it for teams.). Another verb is the story going on (We didn't have backups. We lost the data.).
|
|
96
|
+
*/
|
|
97
|
+
const echoAffirms = (sentence: Sentence, lead: LexiconEntry, next: Sentence | undefined, words: ContrastWords): boolean => {
|
|
98
|
+
if (next === undefined || sentence.tokens === undefined || next.tokens === undefined) return false;
|
|
99
|
+
if (words.leads.some((other) => entryIn(next, other))) return false;
|
|
100
|
+
const subject = groupOf(words.turns, ECHO).find((turn) => opensWithWord(sentence, turn) && opensWithWord(next, turn));
|
|
101
|
+
const denied = subject === undefined ? undefined : deniedVerb(sentence, lead);
|
|
102
|
+
return denied !== undefined && denied === affirmedVerb(next);
|
|
103
|
+
};
|
|
104
|
+
|
|
70
105
|
const AFTER = "after";
|
|
71
106
|
const DIGIT_AFTER = /^\p{Nd}/u;
|
|
72
107
|
/** 数字と、続く助数詞一字(1回、2つ)。 */
|
|
@@ -94,7 +129,7 @@ const framesIn = (sentence: Sentence, frame: LexiconEntry, amounts: Lexicon): bo
|
|
|
94
129
|
const closesWithTurn = (sentence: Sentence, words: ContrastWords): boolean => groupOf(words.turns, CLOSING).some((turn) => entryCloses(sentence, turn));
|
|
95
130
|
|
|
96
131
|
const answeredBy = (lead: LexiconEntry, sentence: Sentence, next: Sentence | undefined, words: ContrastWords): boolean => {
|
|
97
|
-
if (lead.group === ACROSS) return nextAffirms(next, words);
|
|
132
|
+
if (lead.group === ACROSS) return nextAffirms(next, words) || echoAffirms(sentence, lead, next, words);
|
|
98
133
|
if (lead.group === CLOSING) return closesWithTurn(sentence, words);
|
|
99
134
|
return turnAfter(sentence, lead, words) || nextTurns(next, words);
|
|
100
135
|
};
|
|
@@ -34,10 +34,63 @@ export const opensWithModifiedNoun = (words: readonly Token[]): boolean => MODIF
|
|
|
34
34
|
* (… from CISA's long-term, strategic collaboration with A and B: the and joins two items, not three), or an indefinite
|
|
35
35
|
* article with adjectives only (A simple, minimalist palette of cool blue and gray), which no noun has closed yet.
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
const withoutPairedModifier = (view: View): View => {
|
|
38
38
|
const [first, second] = [firstOf(view), secondOf(view)];
|
|
39
39
|
if (first === undefined || second === undefined) return view;
|
|
40
40
|
const { tokens } = view.list.scope.sentence;
|
|
41
41
|
const coordinate = endsWithModifier(wordsOf(tokens, first.item)) && opensWithModifiedNoun(wordsOf(tokens, second.item));
|
|
42
42
|
return coordinate || isBareIndefiniteModifier(view.list.scope, first.item) ? withoutFirst(view) : view;
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
/** One modifier: an adjective, or a hyphened word (non-exclusive, royalty-free), which the parser often tags as nouns. */
|
|
46
|
+
export const isOneModifier = (words: readonly Token[]): boolean =>
|
|
47
|
+
(words.length === 1 && MODIFIER_POS.has(words[0]?.pos ?? "")) || (words.length === 3 && words[1]?.surface === HYPHEN);
|
|
48
|
+
|
|
49
|
+
/** Modifiers parted by commas (non-transferrable, non-sublicensable), which the comma after an adjective has joined into one item. */
|
|
50
|
+
const isModifierRun = (words: readonly Token[]): boolean => {
|
|
51
|
+
const comma = words.findIndex((word) => word.surface === ",");
|
|
52
|
+
if (comma === -1) return isOneModifier(words);
|
|
53
|
+
return isOneModifier(words.slice(0, comma)) && isModifierRun(words.slice(comma + 1));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** Words a modifier run before its noun may hold: modifiers, nouns, hyphens and the commas between coordinate modifiers. */
|
|
57
|
+
const RUN_POS: ReadonlySet<string> = new Set(["ADJ", "NOUN", "PROPN", "PUNCT", "X"]);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* An item that is modifiers then a noun, opening with a modifier (limited right; revocable, limited right, where the
|
|
61
|
+
* comma after an adjective has already joined two items).
|
|
62
|
+
*/
|
|
63
|
+
export const isModifiedNounRun = (words: readonly Token[]): boolean => {
|
|
64
|
+
const width = words[1]?.surface === HYPHEN ? 3 : 1;
|
|
65
|
+
return isOneModifier(words.slice(0, width)) && words.length > width && words.every((word) => RUN_POS.has(word.pos)) && NOUN_POS.has(words.at(-1)?.pos ?? "");
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** An item that ends in an indefinite article and one modifier (grants Licensee a non-exclusive). */
|
|
69
|
+
const endsWithArticleModifier = (words: readonly Token[], indefinite: ReadonlySet<string>): boolean => {
|
|
70
|
+
const at = words.findLastIndex((word) => indefinite.has(word.surface.toLowerCase()));
|
|
71
|
+
return at !== -1 && isModifierRun(words.slice(at + 1));
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** The view without its leading items while each holds only modifiers and another item follows. */
|
|
75
|
+
const withoutModifiers = (view: View, tokens: readonly Token[]): View => {
|
|
76
|
+
const [first, second] = [firstOf(view), secondOf(view)];
|
|
77
|
+
if (first === undefined || second === undefined || !isModifierRun(wordsOf(tokens, first.item))) return view;
|
|
78
|
+
return withoutModifiers(withoutFirst(view), tokens);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The list without its items when an indefinite article opens a run of single modifiers that ends in the one item with a
|
|
83
|
+
* noun (a non-exclusive, revocable, limited right and license): the article has one noun phrase, its commas part
|
|
84
|
+
* coordinate modifiers, and the and / or joins nouns inside that phrase.
|
|
85
|
+
*/
|
|
86
|
+
const withoutModifierRun = (view: View): View => {
|
|
87
|
+
const first = firstOf(view);
|
|
88
|
+
if (first === undefined || secondOf(view) === undefined) return view;
|
|
89
|
+
const { tokens, words } = view.list.scope.sentence;
|
|
90
|
+
if (!endsWithArticleModifier(wordsOf(tokens, first.item), words.indefinite ?? new Set())) return view;
|
|
91
|
+
const rest = withoutModifiers(withoutFirst(view), tokens);
|
|
92
|
+
const head = firstOf(rest);
|
|
93
|
+
return head !== undefined && secondOf(rest) === undefined && isModifiedNounRun(wordsOf(tokens, head.item)) ? rest : view;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const withoutCoordinateAdjective = (view: View): View => withoutPairedModifier(withoutModifierRun(view));
|