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
|
@@ -12,9 +12,10 @@ import { withoutCoinedNames } from "../coined-hyphen-name.ts";
|
|
|
12
12
|
import { wholeWordRuns, type WholeWordRun } from "../whole-word-runs.ts";
|
|
13
13
|
import { entriesForGenre } from "../lexicon-genres.ts";
|
|
14
14
|
import { asNounWhereNominal, documentNounKeys } from "../nominal-stem.ts";
|
|
15
|
-
import {
|
|
15
|
+
import { compoundTailOf } from "../compound-head.ts";
|
|
16
16
|
import { voiceAt, voiceStarts } from "../voice-parts.ts";
|
|
17
17
|
import {
|
|
18
|
+
HIRAGANA_ONLY,
|
|
18
19
|
isCopulaReadAsVerb,
|
|
19
20
|
isCutFromKatakana,
|
|
20
21
|
isNumeral,
|
|
@@ -29,6 +30,9 @@ import { bracketedTitleRuns, titleCaseNameRuns } from "../title-case-name.ts";
|
|
|
29
30
|
import { withoutQuotedSpellings, type Quoted } from "../quoted-spelling.ts";
|
|
30
31
|
import { teFormOf, withTeFormFullVerbs, type TeForm } from "../te-form-helper.ts";
|
|
31
32
|
import { citedSpans, isOpenIn, namesOf, patternsOf, type IsOpen, type Names } from "./orthographic-variant-open.ts";
|
|
33
|
+
import { headingSentences } from "./heading-sentences.ts";
|
|
34
|
+
import { isHashtag, withoutInlineCode, withoutLinkChrome } from "./orthographic-variant-text.ts";
|
|
35
|
+
import { isOneKanjiElement, isSetCompoundBesideGeneralRules, isStemWithoutItsKanji } from "./orthographic-variant-kanji-word.ts";
|
|
32
36
|
|
|
33
37
|
/**
|
|
34
38
|
* A word found in the document: where it is, which sentence it is in, its key and spelling, how it is written when that differs, and
|
|
@@ -40,6 +44,10 @@ type Placed = KeyedWord &
|
|
|
40
44
|
readonly offset: number;
|
|
41
45
|
readonly shown?: string;
|
|
42
46
|
readonly compoundHead?: boolean;
|
|
47
|
+
/** The noun a compound head is written onto, by its reading (締切 of 申込締切). */
|
|
48
|
+
readonly compoundTail?: string;
|
|
49
|
+
/** Whether a verb's stem written in kana is read as its noun (つき of つきたて, from つく). */
|
|
50
|
+
readonly kanaStem?: boolean;
|
|
43
51
|
/** Where a run of words ends (タイヤレバー). */
|
|
44
52
|
readonly end?: number;
|
|
45
53
|
/** Whether a Latin word stands in a name of capitalised words (the Interagency Group) or in a cited work. */
|
|
@@ -72,6 +80,8 @@ const JUDGING = "orthographic-variant-judging";
|
|
|
72
80
|
*/
|
|
73
81
|
const COMPARATIVE = "orthographic-variant-comparative";
|
|
74
82
|
const COMPARATIVE_PARTICLES = new Set(["が", "で"]);
|
|
83
|
+
/** Lexicon: verbs after が that make a listed word the person (方がいない, 方がいらっしゃる), which the comparative ほう never takes. */
|
|
84
|
+
const COMPARATIVE_PERSON = "orthographic-variant-comparative-person";
|
|
75
85
|
/** Lexicon: katakana spellings of a word that name a sense of their own (モノ for goods, beside the formal noun もの). */
|
|
76
86
|
const SENSE = "orthographic-variant-katakana-sense";
|
|
77
87
|
/** Lexicon: sentences that open a separate voice (a justice's own opinion), as regular expressions. Each voice is compared on its own. */
|
|
@@ -96,6 +106,7 @@ const NAME_JOINER = "name-joiner";
|
|
|
96
106
|
type Skips = Uses & {
|
|
97
107
|
readonly skip: ReadonlySet<string>;
|
|
98
108
|
readonly comparative: ReadonlySet<string>;
|
|
109
|
+
readonly comparativePerson: ReadonlySet<string>;
|
|
99
110
|
readonly wholeWords: ReadonlyMap<string, string>;
|
|
100
111
|
readonly phraseSuffixes: ReadonlySet<string>;
|
|
101
112
|
readonly twoReadings: ReadonlyMap<string, string>;
|
|
@@ -103,9 +114,12 @@ type Skips = Uses & {
|
|
|
103
114
|
readonly nouns: ReadonlySet<string>;
|
|
104
115
|
};
|
|
105
116
|
|
|
106
|
-
/** A listed word outside the comparative frame (
|
|
107
|
-
const isOutsideComparative = ({ token, following }: InContext, comparative:
|
|
108
|
-
comparative.has(token.lemma ?? "")
|
|
117
|
+
/** A listed word outside the comparative frame (担当の方に, 方がいない): the kanji there may be the person of the same reading. */
|
|
118
|
+
const isOutsideComparative = ({ token, following }: InContext, { comparative, comparativePerson }: Skips): boolean => {
|
|
119
|
+
if (!comparative.has(token.lemma ?? "")) return false;
|
|
120
|
+
const particle = following?.[0]?.surface ?? "";
|
|
121
|
+
return !COMPARATIVE_PARTICLES.has(particle) || (particle === "が" && comparativePerson.has(following?.[1]?.lemma ?? ""));
|
|
122
|
+
};
|
|
109
123
|
|
|
110
124
|
/** A spelling listed as reading two ways, alone or with the word written onto it (様を), read as the reading in doubt. */
|
|
111
125
|
const readsTwoWays = ({ token, following }: InContext, reading: string, twoReadings: ReadonlyMap<string, string>): boolean => {
|
|
@@ -122,7 +136,7 @@ const readingKeyOf = (word: InContext, skips: Skips): string | undefined => {
|
|
|
122
136
|
const { token } = word;
|
|
123
137
|
const lemma = token.lemma;
|
|
124
138
|
if (!CONTENT.has(token.pos) || token.reading === undefined || lemma === undefined || !JAPANESE_WORD.test(lemma) || skip.has(lemma)) return undefined;
|
|
125
|
-
if (isOutsideComparative(word, skips
|
|
139
|
+
if (isOutsideComparative(word, skips)) return undefined;
|
|
126
140
|
const reading = lemmaReading(token.surface, lemma, token.reading);
|
|
127
141
|
if (reading === undefined || [...reading].length < MIN_READING || skip.has(reading) || isCutFromKatakana(word) || isCopulaReadAsVerb(word)) return undefined;
|
|
128
142
|
if (readsTwoWays(word, reading, skips.twoReadings) || isNotAWordOfItsOwn(word)) return undefined;
|
|
@@ -161,8 +175,10 @@ const readingWords = (sentence: Sentence, isOpen: IsOpen, skips: Skips): Placed[
|
|
|
161
175
|
const key = readingKeyOf(word, skips);
|
|
162
176
|
const local = token.span.start - sentence.span.start;
|
|
163
177
|
if (key === undefined || token.lemma === undefined || !isOpen(local, local + token.surface.length)) return [];
|
|
164
|
-
const
|
|
165
|
-
|
|
178
|
+
const tail = compoundTailOf(token, tokens, at, skips.phraseSuffixes);
|
|
179
|
+
const compound = tail === undefined ? { compoundHead: false } : { compoundHead: true, compoundTail: tail.reading ?? tail.surface };
|
|
180
|
+
const kanaStem = written.pos === "VERB" && token.pos === "NOUN" && HIRAGANA_ONLY.test(token.surface);
|
|
181
|
+
return [{ key, spelling: token.lemma, sentence, offset: token.span.start, ...compound, kanaStem, ...teFormOf(word, tokens, at) }];
|
|
166
182
|
}),
|
|
167
183
|
];
|
|
168
184
|
};
|
|
@@ -174,11 +190,6 @@ const readingWords = (sentence: Sentence, isOpen: IsOpen, skips: Skips): Placed[
|
|
|
174
190
|
* (取扱事業者 beside 個人情報の取扱い), so where the document writes a word both ways, its compound heads are compared apart. A head of
|
|
175
191
|
* one kanji without its okurigana (曇 of 曇雨天, beside 曇り) is a Sino-Japanese element of the compound and is not compared at all.
|
|
176
192
|
*/
|
|
177
|
-
const ONE_KANJI = /^\p{Script=Han}$/u;
|
|
178
|
-
|
|
179
|
-
const isOneKanjiElement = (word: Placed, spellings: readonly string[]): boolean =>
|
|
180
|
-
word.compoundHead === true && ONE_KANJI.test(word.spelling) && dropsOkurigana(word.spelling, spellings);
|
|
181
|
-
|
|
182
193
|
const byKanji = (words: readonly Placed[]): Placed[] =>
|
|
183
194
|
[...groupBy(words, (word) => word.key).values()].flatMap((group) => {
|
|
184
195
|
const spellings = [...new Set(group.map((word) => word.spelling))];
|
|
@@ -187,7 +198,8 @@ const byKanji = (words: readonly Placed[]): Placed[] =>
|
|
|
187
198
|
const apart = spellings.some((spelling) => dropsOkurigana(spelling, spellings)) ? "|compound" : "";
|
|
188
199
|
return group.flatMap((word): Placed[] => {
|
|
189
200
|
const own = skeletonOf(word.spelling);
|
|
190
|
-
if ((own === "" && skeletons.length > 1) || isOneKanjiElement(word, spellings)) return [];
|
|
201
|
+
if ((own === "" && (skeletons.length > 1 || isStemWithoutItsKanji(word, spellings, skeletonOf))) || isOneKanjiElement(word, spellings)) return [];
|
|
202
|
+
if (isSetCompoundBesideGeneralRules(word, group)) return [];
|
|
191
203
|
const use = word.compoundHead === true ? apart : "";
|
|
192
204
|
return [{ ...word, key: `${word.key}|${own === "" ? (skeletons[0] ?? "") : own}${use}` }];
|
|
193
205
|
});
|
|
@@ -240,12 +252,6 @@ const katakanaRunWords = (sentence: Sentence, isOpen: IsOpen): Placed[] =>
|
|
|
240
252
|
/** Whether a run holds a place another key already points at: the word inside it is said, not the run around it. */
|
|
241
253
|
const coversOffset = (run: Placed, offset: number): boolean => offset >= run.offset && offset < (run.end ?? run.offset + 1);
|
|
242
254
|
|
|
243
|
-
const HASHTAG_MARK = "#";
|
|
244
|
-
const WORD_CHARACTER = /[\p{L}\p{N}_]/u;
|
|
245
|
-
|
|
246
|
-
/** A word written as a hashtag (#vimconf): spelled as the service matches it, like an address. */
|
|
247
|
-
const isHashtag = (text: string, start: number): boolean => text.charAt(start - 1) === HASHTAG_MARK && !WORD_CHARACTER.test(text.charAt(start - 2));
|
|
248
|
-
|
|
249
255
|
const LATIN_WORD = /[A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)*/gu;
|
|
250
256
|
const LOWER = /\p{Ll}/u;
|
|
251
257
|
|
|
@@ -302,31 +308,52 @@ const findingOf = (words: readonly Placed[], odd: OddSpelling<Placed>): Finding
|
|
|
302
308
|
/** A cell that is one Latin word in lower case (openapi, contentType): a field name or a value, spelled by the data and not by the writer. */
|
|
303
309
|
const DATA_KEY_CELL = /^\p{Ll}[A-Za-z0-9]*$/u;
|
|
304
310
|
|
|
305
|
-
/**
|
|
306
|
-
|
|
311
|
+
/**
|
|
312
|
+
* A sentence, a heading or a table cell, where its words are the writer's, whether its Latin and its Japanese words are
|
|
313
|
+
* read, and its cited works.
|
|
314
|
+
*/
|
|
315
|
+
type Place = {
|
|
316
|
+
readonly sentence: Sentence;
|
|
317
|
+
readonly isOpen: IsOpen;
|
|
318
|
+
readonly readsLatin: boolean;
|
|
319
|
+
readonly readsJapanese: boolean;
|
|
320
|
+
readonly cited: readonly Span[];
|
|
321
|
+
};
|
|
307
322
|
|
|
308
323
|
/** What the words of a document are read with besides the lexicons of uses: the dictionary, and the small words inside a name (of). */
|
|
309
324
|
type Reading = { readonly isWord: (word: string) => boolean; readonly nameJoiners: readonly string[] };
|
|
310
325
|
|
|
311
|
-
/** A link's brackets and where it goes (`[`, `](#contentType)`, `][ref]`). The prose hides them outside tables; a cell keeps the Markdown as written. */
|
|
312
|
-
const LINK_CHROME = /\]\([^)]*\)|\]\[[^\]]*\]|\[/gu;
|
|
313
|
-
|
|
314
|
-
const withoutLinkChrome = (text: string): string => text.replaceAll(LINK_CHROME, (chrome) => " ".repeat(chrome.length));
|
|
315
|
-
|
|
316
326
|
/** A body cell of a table read as a sentence of its own: the prose covers tables, so a cell's words (片栗粉 in a list of ingredients) are not in the sentences. Header rows stay out. */
|
|
317
327
|
const cellPlace = (cell: TableCell, names: Names): Place => {
|
|
318
328
|
const text = withoutLinkChrome(cell.text);
|
|
319
329
|
const sentence: Sentence = { span: { start: cell.start, end: cell.end }, text, tokens: cell.tokens ?? [] };
|
|
320
|
-
return {
|
|
330
|
+
return {
|
|
331
|
+
sentence,
|
|
332
|
+
isOpen: isOpenIn(sentence, names),
|
|
333
|
+
readsLatin: !DATA_KEY_CELL.test(text.trim()),
|
|
334
|
+
readsJapanese: true,
|
|
335
|
+
cited: citedSpans(sentence, names),
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* A body sentence, read whole; or a heading, read for its Latin words only. An English heading spells its words as the
|
|
341
|
+
* body does (e-mail, email); a Japanese heading is a label, whose compound nouns drop okurigana (申込受付期間 beside 申込み)
|
|
342
|
+
* and whose category word (コーヒー) stands beside names in the body (大坊珈琲店).
|
|
343
|
+
*/
|
|
344
|
+
const textPlace = (written: Sentence, names: Names, heading: boolean): Place => {
|
|
345
|
+
const sentence = heading ? withoutInlineCode(written) : written;
|
|
346
|
+
return { sentence, isOpen: isOpenIn(sentence, names), readsLatin: true, readsJapanese: !heading, cited: citedSpans(sentence, names) };
|
|
321
347
|
};
|
|
322
348
|
|
|
323
349
|
/** The odd spellings among places that speak in one voice. */
|
|
324
350
|
const findingsIn = (placed: readonly Place[], skips: Skips, { isWord, nameJoiners }: Reading, limit: number): Finding[] => {
|
|
351
|
+
const japanese = placed.filter((place) => place.readsJapanese);
|
|
325
352
|
const reading = byKanji(
|
|
326
|
-
withTeFormFullVerbs(
|
|
353
|
+
withTeFormFullVerbs(japanese.flatMap(({ sentence, isOpen }) => readingWords(withCutNounsJoined(sentence, skips.nouns), isOpen, skips))),
|
|
327
354
|
);
|
|
328
|
-
const katakana =
|
|
329
|
-
const runs =
|
|
355
|
+
const katakana = japanese.flatMap(({ sentence, isOpen }) => katakanaWords(sentence, isOpen));
|
|
356
|
+
const runs = japanese.flatMap(({ sentence, isOpen }) => katakanaRunWords(sentence, isOpen));
|
|
330
357
|
const latin = withoutQuotedSpellings(
|
|
331
358
|
withoutCoinedNames(
|
|
332
359
|
placed.flatMap((place) => (place.readsLatin ? latinWords(place, skips.skip, nameJoiners) : [])),
|
|
@@ -349,7 +376,8 @@ const findingsIn = (placed: readonly Place[], skips: Skips, { isWord, nameJoiner
|
|
|
349
376
|
export const orthographicVariant: Detector = (doc, options): Finding[] => {
|
|
350
377
|
const names = namesOf(doc, options.genre);
|
|
351
378
|
const placed: Place[] = [
|
|
352
|
-
...doc.sentences.map((sentence) => (
|
|
379
|
+
...doc.sentences.map((sentence) => textPlace(sentence, names, false)),
|
|
380
|
+
...headingSentences(doc).map((sentence) => textPlace(sentence, names, true)),
|
|
353
381
|
...(doc.tableCells?.() ?? []).map((cell) => cellPlace(cell, names)),
|
|
354
382
|
];
|
|
355
383
|
const phraseSuffixes = new Set(patternsOf(doc, PHRASE_SUFFIX, options.genre));
|
|
@@ -362,11 +390,12 @@ export const orthographicVariant: Detector = (doc, options): Finding[] => {
|
|
|
362
390
|
means: new Set(patternsOf(doc, MEANS, options.genre)),
|
|
363
391
|
lightVerbs: new Set(patternsOf(doc, LIGHT_VERB, options.genre)),
|
|
364
392
|
comparative: new Set(patternsOf(doc, COMPARATIVE, options.genre)),
|
|
393
|
+
comparativePerson: new Set(patternsOf(doc, COMPARATIVE_PERSON, options.genre)),
|
|
365
394
|
wholeWords: new Map((doc.lexicons[WHOLE_WORD] ?? []).map((entry) => [entry.pattern, entry.group ?? entry.pattern])),
|
|
366
395
|
phraseSuffixes,
|
|
367
396
|
twoReadings: new Map(entriesForGenre(doc.lexicons[TWO_READINGS] ?? [], options.genre).map((entry) => [entry.pattern, entry.group ?? ""])),
|
|
368
397
|
nouns: documentNounKeys(
|
|
369
|
-
placed.
|
|
398
|
+
placed.flatMap(({ sentence, readsJapanese }) => (readsJapanese ? [sentence.tokens ?? []] : [])),
|
|
370
399
|
phraseSuffixes,
|
|
371
400
|
),
|
|
372
401
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Detector, Finding, LexiconEntry, ProseDocument, Sentence, Span } from "../plugin.ts";
|
|
2
|
-
import {
|
|
2
|
+
import { conjugatedSpansOutside } from "./conjugated-entry.ts";
|
|
3
3
|
import { calendarRuns, calendarUnitsOf, type CalendarUnits } from "../calendar-number.ts";
|
|
4
4
|
import { escapeRegExp, latinBoundaries, occurrencesOutside, type Boundary, type SpacingKind } from "../orthography.ts";
|
|
5
5
|
import { minorityReport, withoutSideOnTie } from "../spacing-minority.ts";
|
|
@@ -8,23 +8,48 @@ import { digitRunAround, endsWithDivisionLabel, isNumberName, sequenceLabelStart
|
|
|
8
8
|
import { isSpacedLocationPart, type FloorWords } from "../location-part.ts";
|
|
9
9
|
import { isFieldSeparator, isNameSeparator, type OrganizationWords } from "../name-separator.ts";
|
|
10
10
|
import { addressSpans, clockTimeSpans, identifierSpans, isInsideSpan } from "../spacing-code.ts";
|
|
11
|
-
import { followsHandle, isBoundSuffix, isJoinerSpace } from "../latin-word-boundary.ts";
|
|
11
|
+
import { followsHandle, isBoundSuffix, isJoinerSpace, isLoneLetter } from "../latin-word-boundary.ts";
|
|
12
12
|
import { licenceNoticeSentences } from "./licence-notice.ts";
|
|
13
13
|
import { followsCaptionLabel, isCitedEntryLine, isNumberTableBoundary, lineAt } from "../latin-spacing-source.ts";
|
|
14
|
+
import { scopedSentencesOf } from "../scoped-sentences.ts";
|
|
15
|
+
import { inScope } from "../text-scope.ts";
|
|
14
16
|
|
|
15
17
|
/** 書いた形の出現に、動詞の活用した形(行う → 行います)を足したもの。同じ位置は一度だけ。 */
|
|
16
|
-
const
|
|
17
|
-
const written = occurrencesOutside(sentence.text, entry.pattern, use);
|
|
18
|
-
const conjugated =
|
|
19
|
-
return [...written, ...conjugated].toSorted((left, right) => left - right);
|
|
18
|
+
const avoidedSpans = (sentence: Sentence, entry: LexiconEntry, use: string): Span[] => {
|
|
19
|
+
const written = occurrencesOutside(sentence.text, entry.pattern, use).map((start) => ({ start, end: start + entry.pattern.length }));
|
|
20
|
+
const conjugated = conjugatedSpansOutside(sentence, entry, use).filter((span) => !written.some((other) => other.start === span.start));
|
|
21
|
+
return [...written, ...conjugated].toSorted((left, right) => left.start - right.start);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type PreferPair = { readonly entry: LexiconEntry; readonly avoid: string; readonly use: string };
|
|
25
|
+
type PreferHit = { readonly sentence: Sentence; readonly span: Span; readonly pair: PreferPair };
|
|
26
|
+
|
|
27
|
+
const isInsideLonger = (hit: PreferHit, other: PreferHit): boolean =>
|
|
28
|
+
other.span.end - other.span.start > hit.span.end - hit.span.start && other.span.start <= hit.span.start && hit.span.end <= other.span.end;
|
|
29
|
+
|
|
30
|
+
/** 並べた書き方が重なれば(e-mail の中の mail)、長い方だけ。短い方は長い方の一部で、別の書き方ではない。 */
|
|
31
|
+
const sentenceHits = (sentence: Sentence, pairs: readonly PreferPair[]): PreferHit[] => {
|
|
32
|
+
const hits = pairs.flatMap((pair) => avoidedSpans(sentence, pair.entry, pair.use).map((span) => ({ sentence, span, pair })));
|
|
33
|
+
return hits.filter((hit) => !hits.some((other) => isInsideLonger(hit, other))).toSorted((left, right) => left.span.start - right.span.start);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** An entry with a scope reads the parts it names; one without reads the body, as every entry always has. */
|
|
37
|
+
const scopedPreferHits = (doc: ProseDocument, pairs: readonly PreferPair[]): PreferHit[] => {
|
|
38
|
+
const body = new Set(doc.sentences);
|
|
39
|
+
return scopedSentencesOf(doc).flatMap(({ sentence, scopes }) =>
|
|
40
|
+
sentenceHits(
|
|
41
|
+
sentence,
|
|
42
|
+
pairs.filter((pair) => (pair.entry.scope === undefined ? body.has(sentence) : inScope(pair.entry.scope, scopes))),
|
|
43
|
+
),
|
|
44
|
+
);
|
|
20
45
|
};
|
|
21
46
|
|
|
22
47
|
/** チームが chaff.yaml の prefer に書いた「使わない書き方」。書いていなければ何も言わない。 */
|
|
23
48
|
export const preferredTerm: Detector = (doc, options): Finding[] => {
|
|
24
49
|
const pairs = (options.lexicon ?? []).flatMap((entry) => (entry.instead_of === undefined ? [] : [{ entry, avoid: entry.pattern, use: entry.instead_of }]));
|
|
25
|
-
const hits =
|
|
26
|
-
|
|
27
|
-
|
|
50
|
+
const hits = pairs.every((pair) => pair.entry.scope === undefined)
|
|
51
|
+
? doc.sentences.flatMap((sentence) => sentenceHits(sentence, pairs))
|
|
52
|
+
: scopedPreferHits(doc, pairs);
|
|
28
53
|
if (hits.length === 0 || hits.length < options.limit) return [];
|
|
29
54
|
return hits.map((hit) => ({
|
|
30
55
|
rule: "",
|
|
@@ -32,7 +57,7 @@ export const preferredTerm: Detector = (doc, options): Finding[] => {
|
|
|
32
57
|
line: 0,
|
|
33
58
|
column: 0,
|
|
34
59
|
quote: hit.sentence.text.trim(),
|
|
35
|
-
values: { matched: hit.pair.avoid, preferred: hit.pair.use, count: hits.length, limit: options.limit, offset: hit.sentence.span.start + hit.
|
|
60
|
+
values: { matched: hit.pair.avoid, preferred: hit.pair.use, count: hits.length, limit: options.limit, offset: hit.sentence.span.start + hit.span.start },
|
|
36
61
|
}));
|
|
37
62
|
};
|
|
38
63
|
|
|
@@ -123,6 +148,7 @@ const isCounted = (sentence: Sentence, boundary: Boundary, context: NumberContex
|
|
|
123
148
|
!besideSpan(codes.addresses, boundary) &&
|
|
124
149
|
!isNameSeparator(sentence.text, boundary, sentence.tokens, sentence.span.start, context.organizations) &&
|
|
125
150
|
!isJoinerSpace(sentence.text, boundary, context.latinWords.joiners) &&
|
|
151
|
+
!isLoneLetter(sentence.text, boundary) &&
|
|
126
152
|
!isBoundSuffix(sentence.text, boundary, sentence.tokens, sentence.span.start, context.latinWords.boundSuffixes)
|
|
127
153
|
);
|
|
128
154
|
if (isInsideSpan(codes.clockTimes, digitBeside(boundary))) return false;
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
lastNoun,
|
|
25
25
|
openingKind,
|
|
26
26
|
openingOf,
|
|
27
|
+
opensAsPreposition,
|
|
27
28
|
participleOpening,
|
|
28
29
|
shapeOf,
|
|
29
30
|
shapeOfHead,
|
|
@@ -58,6 +59,7 @@ import { listContinues, walker, type Walk } from "./list-run.ts";
|
|
|
58
59
|
import { joinsUnfinished, repeatsConjunction } from "./list-joint.ts";
|
|
59
60
|
import { insideSentenceCaseTitle } from "./title-list.ts";
|
|
60
61
|
import { insideByline } from "./byline-list.ts";
|
|
62
|
+
import { withoutOpeningConjunction } from "./list-opening-conjunction.ts";
|
|
61
63
|
|
|
62
64
|
const EMPTY: TokenRange = { start: 0, end: 0 };
|
|
63
65
|
|
|
@@ -99,6 +101,8 @@ const withoutSequenceWord = (view: View): View | undefined => {
|
|
|
99
101
|
const withoutLead = (view: View): View => {
|
|
100
102
|
const afterSequence = withoutSequenceWord(view);
|
|
101
103
|
if (afterSequence !== undefined) return withoutLead(afterSequence);
|
|
104
|
+
const afterConjunction = withoutOpeningConjunction(view);
|
|
105
|
+
if (afterConjunction !== undefined) return withoutLead(afterConjunction);
|
|
102
106
|
const { scope } = view.list;
|
|
103
107
|
const [first, second] = [firstOf(view), secondOf(view)];
|
|
104
108
|
const opening = first === undefined ? undefined : openingOf(scope, first.item);
|
|
@@ -131,7 +135,7 @@ const afterClosedList = (view: View): View => {
|
|
|
131
135
|
const afterVerbAside = (view: View): View => {
|
|
132
136
|
const { scope } = view.list;
|
|
133
137
|
const [verb, aside] = [firstOf(view), secondOf(view)];
|
|
134
|
-
if (verb === undefined || aside === undefined || lastContent(scope, verb.item)?.pos !== "VERB" ||
|
|
138
|
+
if (verb === undefined || aside === undefined || lastContent(scope, verb.item)?.pos !== "VERB" || !opensAsPreposition(scope, aside.item)) return view;
|
|
135
139
|
const object = firstOf(after(view, aside));
|
|
136
140
|
return object !== undefined && opensAsNoun(scope, object.item) ? after(view, aside) : view;
|
|
137
141
|
};
|
|
@@ -164,9 +168,30 @@ const opensAsNoun = (scope: ItemScope, item: TokenRange): boolean => {
|
|
|
164
168
|
return opening !== undefined && (opening.pos === "DET" || NOMINAL.has(opening.pos));
|
|
165
169
|
};
|
|
166
170
|
|
|
171
|
+
/** 導入の句の頭(前置詞・接続詞・副詞・to・分詞)で始まる項目。 */
|
|
172
|
+
const opensAsLead = (scope: ItemScope, item: TokenRange): boolean => {
|
|
173
|
+
const opening = openingOf(scope, item);
|
|
174
|
+
return opening !== undefined && (LEAD_POS.has(opening.pos) || isParticiple(opening));
|
|
175
|
+
};
|
|
176
|
+
|
|
167
177
|
/** 項目が読点で閉じず、節の終わり(文の終わりか ; : —)まで続く。 */
|
|
168
178
|
const runsToClauseEnd = (scope: ItemScope, item: TokenRange): boolean => scope.sentence.tokens[item.end]?.surface !== ",";
|
|
169
179
|
|
|
180
|
+
/**
|
|
181
|
+
* 名前のすぐ後ろの、関係詞(who / which)で始まる項目は、読点で挟んで名前に添えた節(Tom, who repaired radios for forty years
|
|
182
|
+
* before he retired, gently opened the back and quickly found a loose wire)。名前も節も並びの項目ではなく、並びがあるなら節の後ろから
|
|
183
|
+
* (Alice, who leads design, Bob, Carol, and Dan は Bob からの 3 つ)。関係詞の語は語彙表 aside-relative が言う。
|
|
184
|
+
* 導入の句(To create a list in the editor, which uses no fixed font, you can look … and count)に添えた節も同じ。
|
|
185
|
+
* 動詞で始まる項目(Review the docs, which are long, fix typos, and ship)は述語の並びの項目なので残す。
|
|
186
|
+
*/
|
|
187
|
+
const afterRelativeAside = (view: View): View => {
|
|
188
|
+
const { scope } = view.list;
|
|
189
|
+
const [name, aside] = [firstOf(view), secondOf(view)];
|
|
190
|
+
if (name === undefined || aside === undefined || !(opensAsNoun(scope, name.item) || opensAsLead(scope, name.item))) return view;
|
|
191
|
+
const opening = openingOf(scope, aside.item)?.surface.toLowerCase() ?? "";
|
|
192
|
+
return scope.sentence.words.asideRelative?.has(opening) === true ? after(view, aside) : view;
|
|
193
|
+
};
|
|
194
|
+
|
|
170
195
|
const opensAsPredicate = (scope: ItemScope, item: TokenRange): boolean => {
|
|
171
196
|
const opening = openingOf(scope, item);
|
|
172
197
|
return opening !== undefined && VERBAL.has(opening.pos) && !isParticiple(opening);
|
|
@@ -360,7 +385,7 @@ const listAt = (list: ItemList, at: number, walk: Walk): boolean | undefined =>
|
|
|
360
385
|
const { scope } = list;
|
|
361
386
|
if (closesExampleAside(wholeList(list), at)) return undefined;
|
|
362
387
|
const afterItem = itemAfter(scope, at);
|
|
363
|
-
const opened = afterClosedList(withoutLead(afterVerbAside(afterClauseTurn(withoutCoordinateAdjective(wholeList(list)), afterItem))));
|
|
388
|
+
const opened = afterClosedList(withoutLead(afterRelativeAside(afterVerbAside(afterClauseTurn(withoutCoordinateAdjective(wholeList(list)), afterItem)))));
|
|
364
389
|
const items = fromParticiplePhrase(fromExample(opened, afterItem), afterItem);
|
|
365
390
|
if (listContinues(scope, afterItem, walk) || isAppositive(scope, at, items, afterItem) || insideLastItem(scope, at, items, afterItem)) return undefined;
|
|
366
391
|
if (namesDivision(items) || qualifiesPrevious(items)) return undefined;
|
|
@@ -420,6 +445,7 @@ export const oxfordComma: Detector = (doc, options): Finding[] => {
|
|
|
420
445
|
indefinite: patternsOf(doc.lexicons["indefinite-article"]),
|
|
421
446
|
elision: (doc.lexicons["elision-mark"] ?? []).map((entry) => entry.pattern),
|
|
422
447
|
openListEnd: patternsOf(doc.lexicons["open-list-end"]),
|
|
448
|
+
asideRelative: patternsOf(doc.lexicons["aside-relative"]),
|
|
423
449
|
};
|
|
424
450
|
const judged = doc.sentences.flatMap((sentence) => {
|
|
425
451
|
const oxford = oxfordIn(sentence.tokens ?? [], words, doc.source);
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import type { Detector, Finding } from "../plugin.ts";
|
|
1
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
2
|
import { oneSentenceRuns } from "../paragraph-runs.ts";
|
|
3
3
|
import { referenceListSpans } from "../reference-lists.ts";
|
|
4
4
|
|
|
5
|
-
/** How much of the run's first paragraph the finding quotes. */
|
|
5
|
+
/** How much of the run's first paragraph the finding quotes when it holds no sentence; it never runs past the paragraph. */
|
|
6
6
|
const QUOTE_LENGTH = 80;
|
|
7
7
|
|
|
8
|
+
/** The headings whose paragraphs are entries, not prose: a reference list's, and a footnotes section's (each note its own paragraph). */
|
|
9
|
+
const entryListHeadings = (doc: ProseDocument): string[] =>
|
|
10
|
+
["reference-list-heading", "note-list-heading"].flatMap((lexicon) => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern));
|
|
11
|
+
|
|
8
12
|
/**
|
|
9
13
|
* Runs of one-sentence paragraphs longer than the limit: every sentence set apart as its own paragraph, so nothing is grouped
|
|
10
14
|
* and the reader cannot see which points belong together. One finding per run, at its first paragraph. A reference list's
|
|
11
|
-
* entries are a list, and are not counted.
|
|
15
|
+
* entries and a footnotes section's notes are a list, and are not counted.
|
|
12
16
|
*/
|
|
13
17
|
export const oneSentenceParagraphRun: Detector = (doc, options): Finding[] =>
|
|
14
|
-
oneSentenceRuns(
|
|
15
|
-
doc.source,
|
|
16
|
-
doc.paragraphs,
|
|
17
|
-
referenceListSpans(
|
|
18
|
-
doc.source,
|
|
19
|
-
(doc.lexicons["reference-list-heading"] ?? []).map((entry) => entry.pattern),
|
|
20
|
-
),
|
|
21
|
-
)
|
|
18
|
+
oneSentenceRuns(doc.source, doc.paragraphs, referenceListSpans(doc.source, entryListHeadings(doc)))
|
|
22
19
|
.filter((run) => run.length > options.limit)
|
|
23
20
|
.flatMap((run) => {
|
|
24
21
|
const first = run[0];
|
|
@@ -29,7 +26,7 @@ export const oneSentenceParagraphRun: Detector = (doc, options): Finding[] =>
|
|
|
29
26
|
severity: "info",
|
|
30
27
|
line: 0,
|
|
31
28
|
column: 0,
|
|
32
|
-
quote: doc.source.slice(first.span.start, first.span.start + QUOTE_LENGTH).trim(),
|
|
29
|
+
quote: first.sentences[0]?.text.trim() ?? doc.source.slice(first.span.start, Math.min(first.span.start + QUOTE_LENGTH, first.span.end)).trim(),
|
|
33
30
|
values: { count: run.length, limit: options.limit, offset: first.span.start },
|
|
34
31
|
},
|
|
35
32
|
];
|
|
@@ -7,7 +7,8 @@ import type { Detector, Finding } from "../plugin.ts";
|
|
|
7
7
|
export const phoneNumberVariant: Detector = (doc, options): Finding[] => {
|
|
8
8
|
const labels = options.lexicon ?? [];
|
|
9
9
|
if (labels.length === 0) return [];
|
|
10
|
-
|
|
10
|
+
const links = (doc.lexicons["phone-label-link"] ?? []).map((entry) => entry.pattern);
|
|
11
|
+
return phoneVariants(labelledPhoneNumbers(doc.prose ?? doc.source, labels, links)).map(({ number, other }) => ({
|
|
11
12
|
rule: "",
|
|
12
13
|
severity: "info",
|
|
13
14
|
line: 0,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// A worn phrase whose words also have a plain sense ("Empty the tray at the end of the day", "Every version is on the
|
|
2
|
+
// same page") counts only where its sentence reads it as the figure. The language's word list gives, for each such
|
|
3
|
+
// phrase (group), regular expressions of the figurative use; a phrase without any counts everywhere. Pure.
|
|
4
|
+
import type { LexiconEntry, Sentence } from "../plugin.ts";
|
|
5
|
+
|
|
6
|
+
export type PhraseContexts = ReadonlyMap<string, readonly RegExp[]>;
|
|
7
|
+
|
|
8
|
+
export const phraseContextsOf = (entries: readonly LexiconEntry[]): PhraseContexts =>
|
|
9
|
+
entries.reduce((contexts, entry) => {
|
|
10
|
+
const phrase = entry.group?.toLowerCase();
|
|
11
|
+
if (phrase === undefined) return contexts;
|
|
12
|
+
return new Map([...contexts, [phrase, [...(contexts.get(phrase) ?? []), new RegExp(entry.pattern, "iu")]]]);
|
|
13
|
+
}, new Map<string, readonly RegExp[]>());
|
|
14
|
+
|
|
15
|
+
/** Whether the sentence uses the entry as the figure: no context listed for it, or one of its contexts matches. */
|
|
16
|
+
export const inFigurativeContext = (sentence: Sentence, entry: LexiconEntry, contexts: PhraseContexts): boolean => {
|
|
17
|
+
const patterns = contexts.get(entry.pattern.toLowerCase());
|
|
18
|
+
return patterns === undefined || patterns.some((pattern) => pattern.test(sentence.text));
|
|
19
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Detector, Finding, Lexicon, Sentence } from "../plugin.ts";
|
|
2
|
+
import { entryEnds } from "./lexicon-match.ts";
|
|
3
|
+
import { quotedPattern } from "./quoted-pattern.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* phrase-match の、文の中の違う言い回しをみな名指す版。指摘は phrase-match と同じく文ごとに一つで、位置も文の頭。
|
|
7
|
+
* 一つの文に「ないわけではありません」と「ないとは限りません」があれば、一つ目だけを言うと二つ目を直し忘れる。
|
|
8
|
+
* 重なる二つの語が同じ位置で終われば一回で、名指すのは語彙表で先に書いた語。並びは文の中で終わる順。
|
|
9
|
+
*/
|
|
10
|
+
type Named = { readonly sentence: Sentence; readonly phrases: readonly string[] };
|
|
11
|
+
|
|
12
|
+
const firstEnds = (sentence: Sentence, lexicon: Lexicon): { readonly phrase: string; readonly end: number }[] =>
|
|
13
|
+
lexicon.flatMap((entry) => {
|
|
14
|
+
const ends = entryEnds(sentence, entry);
|
|
15
|
+
return ends.length === 0 ? [] : [{ phrase: quotedPattern(entry.pattern), end: Math.min(...ends) }];
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const phrasesIn = (sentence: Sentence, lexicon: Lexicon): string[] => {
|
|
19
|
+
const byEnd = new Map<number, string>();
|
|
20
|
+
firstEnds(sentence, lexicon).forEach(({ phrase, end }) => {
|
|
21
|
+
if (!byEnd.has(end)) byEnd.set(end, phrase);
|
|
22
|
+
});
|
|
23
|
+
const ordered = [...byEnd].toSorted(([left], [right]) => left - right).map(([, phrase]) => phrase);
|
|
24
|
+
return [...new Set(ordered)];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** 違う言い回しが二つなら both、三つ以上なら many の文言。 */
|
|
28
|
+
const variantOf = (kinds: number): Pick<Finding, "variant"> => {
|
|
29
|
+
if (kinds === 2) return { variant: "both" };
|
|
30
|
+
return kinds > 2 ? { variant: "many" } : {};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const findingOf = ({ sentence, phrases }: Named, count: number, limit: number): Finding => ({
|
|
34
|
+
rule: "",
|
|
35
|
+
severity: "warning",
|
|
36
|
+
line: 0,
|
|
37
|
+
column: 0,
|
|
38
|
+
quote: sentence.text.trim(),
|
|
39
|
+
...variantOf(phrases.length),
|
|
40
|
+
values: {
|
|
41
|
+
matched: phrases[0] ?? "",
|
|
42
|
+
...(phrases.length > 1 ? { other: phrases[1] ?? "", kinds: phrases.length } : {}),
|
|
43
|
+
count,
|
|
44
|
+
limit,
|
|
45
|
+
offset: sentence.span.start,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const phraseMatchAll: Detector = (doc, options): Finding[] => {
|
|
50
|
+
const lexicon = options.lexicon ?? [];
|
|
51
|
+
if (lexicon.length === 0) return [];
|
|
52
|
+
const named = doc.sentences.flatMap((sentence) => {
|
|
53
|
+
const phrases = phrasesIn(sentence, lexicon);
|
|
54
|
+
return phrases.length === 0 ? [] : [{ sentence, phrases }];
|
|
55
|
+
});
|
|
56
|
+
return named.length < options.limit ? [] : named.map((item) => findingOf(item, named.length, options.limit));
|
|
57
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Detector, DetectorOptions, Finding, Lexicon, LexiconEntry, ProseDocument, Sentence } from "../plugin.ts";
|
|
2
|
-
import { entryEnds, entryIn, entryOpens } from "./lexicon-match.ts";
|
|
2
|
+
import { entryEnds, entryIn, entryOpens, entryRanges, entryWrittenIn } from "./lexicon-match.ts";
|
|
3
3
|
import { externalLinkTitleSpans } from "../link-title.ts";
|
|
4
|
+
import { referenceListSpans } from "../reference-lists.ts";
|
|
4
5
|
import { mentionCuesOf, onlyInTitles, onlyMentioned } from "./mentioned-phrase.ts";
|
|
6
|
+
import { inFigurativeContext, phraseContextsOf } from "./phrase-context.ts";
|
|
5
7
|
import { closingSentences } from "../closing-paragraph.ts";
|
|
6
8
|
import { quotedPattern } from "./quoted-pattern.ts";
|
|
7
9
|
|
|
@@ -23,12 +25,28 @@ type Hit = { readonly sentence: Sentence; readonly matched: string };
|
|
|
23
25
|
/** Whether the entry's words in the sentence count as a use. phrase-match counts every one. */
|
|
24
26
|
type IsUsed = (sentence: Sentence, entry: LexiconEntry) => boolean;
|
|
25
27
|
|
|
28
|
+
/** Some place of the entry in the sentence is not followed by a word of a part of speech the entry names in not_before_pos. Without tokens every place counts. */
|
|
29
|
+
const freeOfNextWord = (sentence: Sentence, entry: LexiconEntry): boolean => {
|
|
30
|
+
const blocked = entry.not_before_pos;
|
|
31
|
+
const tokens = sentence.tokens;
|
|
32
|
+
const ranges = entryRanges(sentence, entry);
|
|
33
|
+
if (blocked === undefined || tokens === undefined || ranges.length === 0) return true;
|
|
34
|
+
return ranges.some((range) => !blocked.includes(tokens[range.end]?.pos ?? ""));
|
|
35
|
+
};
|
|
36
|
+
|
|
26
37
|
/** An entry marked opens counts only at the head of the sentence: 「近年、」 opens a stock opening, 「その後、近年の」 is a plain word. */
|
|
27
|
-
const writtenIn = (sentence: Sentence, entry: LexiconEntry): boolean =>
|
|
38
|
+
const writtenIn = (sentence: Sentence, entry: LexiconEntry): boolean =>
|
|
39
|
+
(entry.opens === true ? entryOpens(sentence, entry) : entryIn(sentence, entry)) && freeOfNextWord(sentence, entry);
|
|
40
|
+
|
|
41
|
+
/** The entry the sentence holds; one written in the very form (reverted back) wins over one met through its base form (revert back). */
|
|
42
|
+
const entryHeldBy = (sentence: Sentence, lexicon: Lexicon, isUsed: IsUsed): LexiconEntry | undefined => {
|
|
43
|
+
const held = lexicon.filter((entry) => writtenIn(sentence, entry) && isUsed(sentence, entry));
|
|
44
|
+
return held.find((entry) => entryWrittenIn(sentence, entry)) ?? held[0];
|
|
45
|
+
};
|
|
28
46
|
|
|
29
47
|
const hitsIn = (sentences: readonly Sentence[], lexicon: Lexicon, isUsed: IsUsed = () => true): Hit[] =>
|
|
30
48
|
sentences.flatMap((sentence) => {
|
|
31
|
-
const matched =
|
|
49
|
+
const matched = entryHeldBy(sentence, lexicon, isUsed);
|
|
32
50
|
return matched === undefined ? [] : [{ sentence, matched: quotedPattern(matched.pattern) }];
|
|
33
51
|
});
|
|
34
52
|
|
|
@@ -64,12 +82,19 @@ export const phraseMatchWhere = (doc: ProseDocument, options: DetectorOptions, i
|
|
|
64
82
|
|
|
65
83
|
/**
|
|
66
84
|
* phrase-match の、言葉として名指しただけの言い回し(the phrase "…", 「…」という言い方)を数えない版(mentioned-phrase.ts)。
|
|
67
|
-
* 参考文献のリンクに写した外のページの題名([文章の極意は…](https://…)
|
|
85
|
+
* 参考文献のリンクに写した外のページの題名([文章の極意は…](https://…))と、文献一覧に写した著作の題の言い回しも、書き手の言葉ではないので数えない。
|
|
86
|
+
* 字どおりの意味にも読める言い回し(at the end of the day)は、cliche-figurative が言う比喩の文脈の文だけで数える(phrase-context.ts)。
|
|
68
87
|
*/
|
|
69
88
|
export const phraseInUse: Detector = (doc, options): Finding[] => {
|
|
70
89
|
const cues = mentionCuesOf(doc.lexicons["mention-cue"] ?? []);
|
|
71
|
-
const
|
|
72
|
-
const
|
|
90
|
+
const headings = (doc.lexicons["reference-list-heading"] ?? []).map((entry) => entry.pattern);
|
|
91
|
+
const titles = [...externalLinkTitleSpans(doc.source, doc.links), ...referenceListSpans(doc.source, headings)];
|
|
92
|
+
const figurative = phraseContextsOf(doc.lexicons["cliche-figurative"] ?? []);
|
|
93
|
+
const hits = phraseHits(
|
|
94
|
+
doc,
|
|
95
|
+
options,
|
|
96
|
+
(sentence, entry) => !onlyMentioned(sentence, entry, cues) && !onlyInTitles(sentence, entry, titles) && inFigurativeContext(sentence, entry, figurative),
|
|
97
|
+
);
|
|
73
98
|
return hits.length < options.limit ? [] : findingsOf(hits, options.limit);
|
|
74
99
|
};
|
|
75
100
|
|
|
@@ -31,6 +31,7 @@ const withoutClosers = (text: string): string => {
|
|
|
31
31
|
const MARKER = "marker";
|
|
32
32
|
const INSTRUCTION = "instruction";
|
|
33
33
|
const LABEL = "label";
|
|
34
|
+
const CLOSING = "closing";
|
|
34
35
|
|
|
35
36
|
const innerOf = (match: RegExpExecArray): string => (match[1] ?? match[2] ?? match[3] ?? "").trim().toLowerCase();
|
|
36
37
|
|
|
@@ -41,13 +42,40 @@ const holdsWord = (inner: string, words: Lexicon): boolean =>
|
|
|
41
42
|
return inner === pattern || (inner.startsWith(pattern) && /^[\s'’]/u.test(inner.slice(pattern.length)));
|
|
42
43
|
});
|
|
43
44
|
|
|
45
|
+
/** A bracket a closing word ends: two to four words, each opening with a capital ([Candidate Name], [Start Date]). */
|
|
46
|
+
const TITLED_BLANK = /^(?:\p{Lu}[\p{L}'’-]*\s+){1,3}\p{Lu}\p{L}*$/u;
|
|
47
|
+
|
|
48
|
+
const rawInnerOf = (match: RegExpExecArray): string => (match[1] ?? match[2] ?? match[3] ?? "").trim();
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 括弧の中身が、語彙表の closing の語で終わる、語の頭がみな大文字の二語から四語か([Candidate Name]、[Start Date])。
|
|
52
|
+
* 小文字の語を挟む編者の補い([the defendant's name])や一語の注記([sic])は空欄ではない。
|
|
53
|
+
*/
|
|
54
|
+
const endsWithWord = (inner: string, words: Lexicon): boolean =>
|
|
55
|
+
TITLED_BLANK.test(inner) && words.some((word) => inner.toLowerCase().endsWith(` ${word.pattern.toLowerCase()}`));
|
|
56
|
+
|
|
44
57
|
/** 括弧の中身が指示の書き出しで始まるか(ここに会社名を書く)。 */
|
|
45
58
|
const opensWith = (inner: string, words: Lexicon): boolean => words.some((word) => inner.startsWith(word.pattern.toLowerCase()));
|
|
46
59
|
|
|
47
60
|
const spanOf = (match: RegExpExecArray): Span => ({ start: match.index, end: match.index + match[0].length });
|
|
48
61
|
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
/** A bracket glued into a web or mail address (hello@[yourcompany].com, example.com/[yourname]): the address goes on after it. */
|
|
63
|
+
const ADDRESS_BEFORE = /[@/.]$/u;
|
|
64
|
+
const ADDRESS_AFTER = /^(?:\.\p{L}|\/)/u;
|
|
65
|
+
const ONE_TOKEN = /^[\p{Ll}\d_-]+$/u;
|
|
66
|
+
|
|
67
|
+
/** A bracket inside an address holds one run-together lowercase token that opens with a bracket word ([yourcoworkingspace]). */
|
|
68
|
+
const isAddressBlank = (text: string, match: RegExpExecArray, inner: string, words: Lexicon): boolean =>
|
|
69
|
+
ADDRESS_BEFORE.test(text.slice(0, match.index)) &&
|
|
70
|
+
ADDRESS_AFTER.test(text.slice(match.index + match[0].length)) &&
|
|
71
|
+
ONE_TOKEN.test(inner) &&
|
|
72
|
+
words.some((word) => inner.startsWith(word.pattern.toLowerCase()));
|
|
73
|
+
|
|
74
|
+
const holdsBlank = (text: string, match: RegExpExecArray, holds: (inner: string, raw: string, match: RegExpExecArray) => boolean): boolean =>
|
|
75
|
+
!FILLED_AFTER.test(text.slice(match.index + match[0].length)) && holds(innerOf(match), rawInnerOf(match), match);
|
|
76
|
+
|
|
77
|
+
const bracketedSpans = (text: string, pattern: RegExp, holds: (inner: string, raw: string, match: RegExpExecArray) => boolean): Span[] =>
|
|
78
|
+
[...text.matchAll(pattern)].filter((match) => holdsBlank(text, match, holds)).map(spanOf);
|
|
51
79
|
|
|
52
80
|
/**
|
|
53
81
|
* A value left as a marker: the whole text is the marker ("TBD", 「未定」), or the marker opens it before a colon
|
|
@@ -163,13 +191,18 @@ export const placeholderSpans = (text: string, words: Lexicon): Span[] => {
|
|
|
163
191
|
const instructions = words.filter((word) => word.group === INSTRUCTION);
|
|
164
192
|
const markers = words.filter((word) => word.group === MARKER);
|
|
165
193
|
const labels = words.filter((word) => word.group === LABEL);
|
|
194
|
+
const closings = words.filter((word) => word.group === CLOSING);
|
|
166
195
|
const blankWords = {
|
|
167
196
|
suffixes: words.filter((word) => word.group === BLANK_SUFFIX),
|
|
168
197
|
prefixes: words.filter((word) => word.group === BLANK_PREFIX),
|
|
169
198
|
units: words.filter((word) => word.group === BLANK_UNIT),
|
|
170
199
|
};
|
|
171
200
|
return [
|
|
172
|
-
...bracketedSpans(
|
|
201
|
+
...bracketedSpans(
|
|
202
|
+
text,
|
|
203
|
+
BRACKETED,
|
|
204
|
+
(inner, raw, match) => holdsWord(inner, bracketWords) || endsWithWord(raw, closings) || isAddressBlank(text, match, inner, bracketWords),
|
|
205
|
+
),
|
|
173
206
|
...(instructions.length === 0 ? [] : bracketedSpans(text, PARENTHESIZED, (inner) => opensWith(inner, instructions))),
|
|
174
207
|
...lineMarkerSpans(text, markers, labels),
|
|
175
208
|
...blankMarkSpans(text, blankWords),
|