chaffjs 0.49.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +30 -3
- package/README.md +30 -2
- package/dist/allow.d.ts +49 -0
- package/dist/allow.d.ts.map +1 -0
- package/dist/allow.js +111 -0
- package/dist/allow.js.map +1 -0
- package/dist/announced-count.d.ts.map +1 -1
- package/dist/announced-count.js +18 -1
- package/dist/announced-count.js.map +1 -1
- package/dist/announced-list.d.ts.map +1 -1
- package/dist/announced-list.js +6 -1
- package/dist/announced-list.js.map +1 -1
- package/dist/check-source.d.ts +13 -3
- package/dist/check-source.d.ts.map +1 -1
- package/dist/check-source.js +23 -6
- package/dist/check-source.js.map +1 -1
- package/dist/cli-text.d.ts +7 -1
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +8 -2
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +16 -13
- package/dist/cli.js.map +1 -1
- package/dist/commands/eval.js +1 -1
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/suppressions.d.ts +4 -1
- package/dist/commands/suppressions.d.ts.map +1 -1
- package/dist/commands/suppressions.js +2 -2
- package/dist/commands/suppressions.js.map +1 -1
- package/dist/commands/test.js +1 -1
- package/dist/commands/test.js.map +1 -1
- package/dist/composite-signals.d.ts +3 -1
- package/dist/composite-signals.d.ts.map +1 -1
- package/dist/composite-signals.js +7 -0
- package/dist/composite-signals.js.map +1 -1
- package/dist/compound-head.d.ts +5 -2
- package/dist/compound-head.d.ts.map +1 -1
- package/dist/compound-head.js +17 -8
- package/dist/compound-head.js.map +1 -1
- package/dist/config/allow-problems.d.ts +8 -0
- package/dist/config/allow-problems.d.ts.map +1 -0
- package/dist/config/allow-problems.js +61 -0
- package/dist/config/allow-problems.js.map +1 -0
- package/dist/config/by-path-problems.d.ts +3 -0
- package/dist/config/by-path-problems.d.ts.map +1 -1
- package/dist/config/by-path-problems.js +21 -2
- package/dist/config/by-path-problems.js.map +1 -1
- package/dist/config/by-path-rules.d.ts +34 -0
- package/dist/config/by-path-rules.d.ts.map +1 -0
- package/dist/config/by-path-rules.js +53 -0
- package/dist/config/by-path-rules.js.map +1 -0
- package/dist/config/by-path.d.ts +15 -0
- package/dist/config/by-path.d.ts.map +1 -1
- package/dist/config/by-path.js.map +1 -1
- package/dist/config/consistent-problems.d.ts +5 -0
- package/dist/config/consistent-problems.d.ts.map +1 -0
- package/dist/config/consistent-problems.js +24 -0
- package/dist/config/consistent-problems.js.map +1 -0
- package/dist/config/load.d.ts +23 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +63 -10
- package/dist/config/load.js.map +1 -1
- package/dist/config/option-problems.d.ts +6 -4
- package/dist/config/option-problems.d.ts.map +1 -1
- package/dist/config/option-problems.js +5 -2
- package/dist/config/option-problems.js.map +1 -1
- package/dist/config/prefer-problems.d.ts +5 -0
- package/dist/config/prefer-problems.d.ts.map +1 -0
- package/dist/config/prefer-problems.js +15 -0
- package/dist/config/prefer-problems.js.map +1 -0
- package/dist/config/prefer.d.ts +21 -0
- package/dist/config/prefer.d.ts.map +1 -0
- package/dist/config/prefer.js +35 -0
- package/dist/config/prefer.js.map +1 -0
- package/dist/config/term-problems.d.ts +5 -0
- package/dist/config/term-problems.d.ts.map +1 -0
- package/dist/config/term-problems.js +25 -0
- package/dist/config/term-problems.js.map +1 -0
- package/dist/config/warnings.d.ts +1 -1
- package/dist/config/warnings.d.ts.map +1 -1
- package/dist/config/warnings.js +9 -2
- package/dist/config/warnings.js.map +1 -1
- package/dist/cross-variants.d.ts +1 -1
- package/dist/cross-variants.d.ts.map +1 -1
- package/dist/cross-variants.js +4 -8
- package/dist/cross-variants.js.map +1 -1
- package/dist/cross-votes.d.ts +13 -0
- package/dist/cross-votes.d.ts.map +1 -1
- package/dist/cross-votes.js +25 -2
- package/dist/cross-votes.js.map +1 -1
- package/dist/custom/parse.d.ts +9 -0
- package/dist/custom/parse.d.ts.map +1 -1
- package/dist/custom/parse.js +11 -2
- package/dist/custom/parse.js.map +1 -1
- package/dist/custom/problems.d.ts.map +1 -1
- package/dist/custom/problems.js +9 -3
- package/dist/custom/problems.js.map +1 -1
- package/dist/custom/scope-field.d.ts +7 -0
- package/dist/custom/scope-field.d.ts.map +1 -0
- package/dist/custom/scope-field.js +14 -0
- package/dist/custom/scope-field.js.map +1 -0
- package/dist/date-format.d.ts +5 -3
- package/dist/date-format.d.ts.map +1 -1
- package/dist/date-format.js +30 -5
- package/dist/date-format.js.map +1 -1
- package/dist/derived/elapsed.d.ts +4 -1
- package/dist/derived/elapsed.d.ts.map +1 -1
- package/dist/derived/elapsed.js +11 -1
- package/dist/derived/elapsed.js.map +1 -1
- package/dist/detectors/acronym-context.d.ts +3 -1
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +7 -1
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/acronym-gloss.d.ts +20 -7
- package/dist/detectors/acronym-gloss.d.ts.map +1 -1
- package/dist/detectors/acronym-gloss.js +50 -13
- package/dist/detectors/acronym-gloss.js.map +1 -1
- package/dist/detectors/agentless-passive.d.ts.map +1 -1
- package/dist/detectors/agentless-passive.js +39 -4
- package/dist/detectors/agentless-passive.js.map +1 -1
- package/dist/detectors/agreement-slip.d.ts +2 -0
- package/dist/detectors/agreement-slip.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.js +10 -3
- package/dist/detectors/agreement-slip.js.map +1 -1
- package/dist/detectors/amount-scale.js +2 -2
- package/dist/detectors/amount-scale.js.map +1 -1
- package/dist/detectors/bare-comparative.d.ts +4 -0
- package/dist/detectors/bare-comparative.d.ts.map +1 -1
- package/dist/detectors/bare-comparative.js +27 -3
- package/dist/detectors/bare-comparative.js.map +1 -1
- package/dist/detectors/blank-structure.d.ts +5 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +13 -7
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/bold-label.d.ts.map +1 -1
- package/dist/detectors/bold-label.js +12 -6
- package/dist/detectors/bold-label.js.map +1 -1
- package/dist/detectors/bracket-title-date.d.ts +6 -0
- package/dist/detectors/bracket-title-date.d.ts.map +1 -0
- package/dist/detectors/bracket-title-date.js +29 -0
- package/dist/detectors/bracket-title-date.js.map +1 -0
- package/dist/detectors/broken-link.d.ts.map +1 -1
- package/dist/detectors/broken-link.js +12 -1
- package/dist/detectors/broken-link.js.map +1 -1
- package/dist/detectors/capitalised-term.d.ts.map +1 -1
- package/dist/detectors/capitalised-term.js +24 -11
- package/dist/detectors/capitalised-term.js.map +1 -1
- package/dist/detectors/change-rate.d.ts.map +1 -1
- package/dist/detectors/change-rate.js +27 -4
- package/dist/detectors/change-rate.js.map +1 -1
- package/dist/detectors/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +12 -17
- package/dist/detectors/char-shape.js.map +1 -1
- package/dist/detectors/chat-citation.d.ts +2 -6
- package/dist/detectors/chat-citation.d.ts.map +1 -1
- package/dist/detectors/chat-citation.js +4 -2
- package/dist/detectors/chat-citation.js.map +1 -1
- package/dist/detectors/chat-mark-extent.d.ts +11 -0
- package/dist/detectors/chat-mark-extent.d.ts.map +1 -0
- package/dist/detectors/chat-mark-extent.js +53 -0
- package/dist/detectors/chat-mark-extent.js.map +1 -0
- package/dist/detectors/clause-shape.d.ts +4 -2
- package/dist/detectors/clause-shape.d.ts.map +1 -1
- package/dist/detectors/clause-shape.js +8 -4
- package/dist/detectors/clause-shape.js.map +1 -1
- package/dist/detectors/conjugated-entry.d.ts +2 -2
- package/dist/detectors/conjugated-entry.d.ts.map +1 -1
- package/dist/detectors/conjugated-entry.js +3 -5
- package/dist/detectors/conjugated-entry.js.map +1 -1
- package/dist/detectors/contraction-mix.d.ts.map +1 -1
- package/dist/detectors/contraction-mix.js +3 -2
- package/dist/detectors/contraction-mix.js.map +1 -1
- package/dist/detectors/contraction-set-apart.d.ts +7 -1
- package/dist/detectors/contraction-set-apart.d.ts.map +1 -1
- package/dist/detectors/contraction-set-apart.js +14 -1
- package/dist/detectors/contraction-set-apart.js.map +1 -1
- package/dist/detectors/contrast-frame.d.ts.map +1 -1
- package/dist/detectors/contrast-frame.js +34 -1
- package/dist/detectors/contrast-frame.js.map +1 -1
- package/dist/detectors/coordinate-adjective.d.ts +5 -3
- package/dist/detectors/coordinate-adjective.d.ts.map +1 -1
- package/dist/detectors/coordinate-adjective.js +49 -1
- package/dist/detectors/coordinate-adjective.js.map +1 -1
- package/dist/detectors/count-per-section.d.ts.map +1 -1
- package/dist/detectors/count-per-section.js +29 -23
- package/dist/detectors/count-per-section.js.map +1 -1
- package/dist/detectors/counter-edge.d.ts +11 -0
- package/dist/detectors/counter-edge.d.ts.map +1 -1
- package/dist/detectors/counter-edge.js +17 -0
- package/dist/detectors/counter-edge.js.map +1 -1
- package/dist/detectors/cross-variant.d.ts.map +1 -1
- package/dist/detectors/cross-variant.js +14 -2
- package/dist/detectors/cross-variant.js.map +1 -1
- package/dist/detectors/currency-notation.js +2 -2
- package/dist/detectors/currency-notation.js.map +1 -1
- package/dist/detectors/custom.d.ts.map +1 -1
- package/dist/detectors/custom.js +6 -4
- package/dist/detectors/custom.js.map +1 -1
- package/dist/detectors/date-format.js +1 -1
- package/dist/detectors/date-format.js.map +1 -1
- package/dist/detectors/date-repeated-day.d.ts +11 -0
- package/dist/detectors/date-repeated-day.d.ts.map +1 -0
- package/dist/detectors/date-repeated-day.js +15 -0
- package/dist/detectors/date-repeated-day.js.map +1 -0
- package/dist/detectors/date-year.d.ts.map +1 -1
- package/dist/detectors/date-year.js +8 -1
- package/dist/detectors/date-year.js.map +1 -1
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +21 -6
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +12 -2
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +1 -0
- package/dist/detectors/derived-numbers.js.map +1 -1
- package/dist/detectors/document-shape.d.ts +1 -1
- package/dist/detectors/document-shape.d.ts.map +1 -1
- package/dist/detectors/document-shape.js +4 -1
- package/dist/detectors/document-shape.js.map +1 -1
- package/dist/detectors/ellipsis.js +2 -2
- package/dist/detectors/ellipsis.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +5 -1
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +5 -3
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/empty-section.d.ts +1 -0
- package/dist/detectors/empty-section.d.ts.map +1 -1
- package/dist/detectors/empty-section.js +10 -1
- package/dist/detectors/empty-section.js.map +1 -1
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +49 -9
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/enumeration-marker.d.ts +7 -0
- package/dist/detectors/enumeration-marker.d.ts.map +1 -0
- package/dist/detectors/enumeration-marker.js +8 -0
- package/dist/detectors/enumeration-marker.js.map +1 -0
- package/dist/detectors/event-title-item.d.ts +8 -0
- package/dist/detectors/event-title-item.d.ts.map +1 -0
- package/dist/detectors/event-title-item.js +45 -0
- package/dist/detectors/event-title-item.js.map +1 -0
- package/dist/detectors/example-baseline.d.ts +5 -0
- package/dist/detectors/example-baseline.d.ts.map +1 -1
- package/dist/detectors/example-baseline.js +15 -1
- package/dist/detectors/example-baseline.js.map +1 -1
- package/dist/detectors/filler-word.d.ts +11 -0
- package/dist/detectors/filler-word.d.ts.map +1 -0
- package/dist/detectors/filler-word.js +73 -0
- package/dist/detectors/filler-word.js.map +1 -0
- package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
- package/dist/detectors/fullwidth-alnum.js +19 -0
- package/dist/detectors/fullwidth-alnum.js.map +1 -1
- package/dist/detectors/gram-furniture.d.ts +1 -0
- package/dist/detectors/gram-furniture.d.ts.map +1 -1
- package/dist/detectors/gram-furniture.js +6 -0
- package/dist/detectors/gram-furniture.js.map +1 -1
- package/dist/detectors/gram-repetition.d.ts.map +1 -1
- package/dist/detectors/gram-repetition.js +8 -2
- package/dist/detectors/gram-repetition.js.map +1 -1
- package/dist/detectors/heading-case.d.ts +1 -0
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +16 -4
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/heading-marker-no-space.d.ts +3 -0
- package/dist/detectors/heading-marker-no-space.d.ts.map +1 -0
- package/dist/detectors/heading-marker-no-space.js +49 -0
- package/dist/detectors/heading-marker-no-space.js.map +1 -0
- package/dist/detectors/hyphen-name-suffix.d.ts.map +1 -1
- package/dist/detectors/hyphen-name-suffix.js +3 -2
- package/dist/detectors/hyphen-name-suffix.js.map +1 -1
- package/dist/detectors/inline-item-label.d.ts +6 -0
- package/dist/detectors/inline-item-label.d.ts.map +1 -0
- package/dist/detectors/inline-item-label.js +68 -0
- package/dist/detectors/inline-item-label.js.map +1 -0
- package/dist/detectors/kanji-name-edge.d.ts +5 -0
- package/dist/detectors/kanji-name-edge.d.ts.map +1 -1
- package/dist/detectors/kanji-name-edge.js +9 -0
- package/dist/detectors/kanji-name-edge.js.map +1 -1
- package/dist/detectors/known-correction.d.ts.map +1 -1
- package/dist/detectors/known-correction.js +13 -1
- package/dist/detectors/known-correction.js.map +1 -1
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
- package/dist/detectors/kutoten-consistency.js +27 -6
- package/dist/detectors/kutoten-consistency.js.map +1 -1
- package/dist/detectors/lexicon-match.d.ts +2 -0
- package/dist/detectors/lexicon-match.d.ts.map +1 -1
- package/dist/detectors/lexicon-match.js +14 -3
- package/dist/detectors/lexicon-match.js.map +1 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +8 -1
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/link-definition.d.ts +3 -0
- package/dist/detectors/link-definition.d.ts.map +1 -0
- package/dist/detectors/link-definition.js +78 -0
- package/dist/detectors/link-definition.js.map +1 -0
- package/dist/detectors/list-item-asides.d.ts +7 -0
- package/dist/detectors/list-item-asides.d.ts.map +1 -0
- package/dist/detectors/list-item-asides.js +25 -0
- package/dist/detectors/list-item-asides.js.map +1 -0
- package/dist/detectors/list-item-clause.d.ts +4 -0
- package/dist/detectors/list-item-clause.d.ts.map +1 -0
- package/dist/detectors/list-item-clause.js +8 -0
- package/dist/detectors/list-item-clause.js.map +1 -0
- package/dist/detectors/list-item.d.ts +2 -0
- package/dist/detectors/list-item.d.ts.map +1 -1
- package/dist/detectors/list-item.js +6 -0
- package/dist/detectors/list-item.js.map +1 -1
- package/dist/detectors/list-items.d.ts.map +1 -1
- package/dist/detectors/list-items.js +12 -3
- package/dist/detectors/list-items.js.map +1 -1
- package/dist/detectors/list-opening-conjunction.d.ts +7 -0
- package/dist/detectors/list-opening-conjunction.d.ts.map +1 -0
- package/dist/detectors/list-opening-conjunction.js +22 -0
- package/dist/detectors/list-opening-conjunction.js.map +1 -0
- package/dist/detectors/list-parallel.d.ts.map +1 -1
- package/dist/detectors/list-parallel.js +17 -16
- package/dist/detectors/list-parallel.js.map +1 -1
- package/dist/detectors/list-run.d.ts.map +1 -1
- package/dist/detectors/list-run.js +15 -3
- package/dist/detectors/list-run.js.map +1 -1
- package/dist/detectors/list-sentence.d.ts +2 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -1
- package/dist/detectors/list-sentence.js.map +1 -1
- package/dist/detectors/list-verb-series.d.ts +6 -0
- package/dist/detectors/list-verb-series.d.ts.map +1 -0
- package/dist/detectors/list-verb-series.js +20 -0
- package/dist/detectors/list-verb-series.js.map +1 -0
- package/dist/detectors/mark-shape.d.ts +5 -2
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +40 -23
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/markdown-slip.d.ts +5 -0
- package/dist/detectors/markdown-slip.d.ts.map +1 -1
- package/dist/detectors/markdown-slip.js +23 -0
- package/dist/detectors/markdown-slip.js.map +1 -1
- package/dist/detectors/marked-word.d.ts +10 -0
- package/dist/detectors/marked-word.d.ts.map +1 -0
- package/dist/detectors/marked-word.js +30 -0
- package/dist/detectors/marked-word.js.map +1 -0
- package/dist/detectors/middle-dot.d.ts +1 -1
- package/dist/detectors/middle-dot.d.ts.map +1 -1
- package/dist/detectors/middle-dot.js +21 -2
- package/dist/detectors/middle-dot.js.map +1 -1
- package/dist/detectors/missing-final-period.d.ts.map +1 -1
- package/dist/detectors/missing-final-period.js +17 -1
- package/dist/detectors/missing-final-period.js.map +1 -1
- package/dist/detectors/name-variant-two-things.d.ts +2 -1
- package/dist/detectors/name-variant-two-things.d.ts.map +1 -1
- package/dist/detectors/name-variant-two-things.js +30 -2
- package/dist/detectors/name-variant-two-things.js.map +1 -1
- package/dist/detectors/net-amount-mismatch.d.ts.map +1 -1
- package/dist/detectors/net-amount-mismatch.js +26 -4
- package/dist/detectors/net-amount-mismatch.js.map +1 -1
- package/dist/detectors/nominalization.d.ts.map +1 -1
- package/dist/detectors/nominalization.js +17 -5
- package/dist/detectors/nominalization.js.map +1 -1
- package/dist/detectors/number-style.d.ts +2 -0
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +5 -0
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/ordinal-suffix.js +2 -2
- package/dist/detectors/ordinal-suffix.js.map +1 -1
- package/dist/detectors/ordinary-phrase.d.ts +5 -0
- package/dist/detectors/ordinary-phrase.d.ts.map +1 -1
- package/dist/detectors/ordinary-phrase.js +12 -0
- package/dist/detectors/ordinary-phrase.js.map +1 -1
- package/dist/detectors/organisation-run.d.ts +2 -0
- package/dist/detectors/organisation-run.d.ts.map +1 -1
- package/dist/detectors/organisation-run.js +7 -0
- package/dist/detectors/organisation-run.js.map +1 -1
- package/dist/detectors/orthographic-variant-kanji-word.d.ts +22 -0
- package/dist/detectors/orthographic-variant-kanji-word.d.ts.map +1 -0
- package/dist/detectors/orthographic-variant-kanji-word.js +27 -0
- package/dist/detectors/orthographic-variant-kanji-word.js.map +1 -0
- package/dist/detectors/orthographic-variant-open.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant-open.js +2 -1
- package/dist/detectors/orthographic-variant-open.js.map +1 -1
- package/dist/detectors/orthographic-variant-text.d.ts +7 -0
- package/dist/detectors/orthographic-variant-text.d.ts.map +1 -0
- package/dist/detectors/orthographic-variant-text.js +14 -0
- package/dist/detectors/orthographic-variant-text.js.map +1 -0
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +46 -23
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +24 -8
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +28 -3
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/paragraph-run.d.ts +1 -1
- package/dist/detectors/paragraph-run.d.ts.map +1 -1
- package/dist/detectors/paragraph-run.js +6 -4
- package/dist/detectors/paragraph-run.js.map +1 -1
- package/dist/detectors/phone-number-variant.d.ts.map +1 -1
- package/dist/detectors/phone-number-variant.js +2 -1
- package/dist/detectors/phone-number-variant.js.map +1 -1
- package/dist/detectors/phrase-context.d.ts +6 -0
- package/dist/detectors/phrase-context.d.ts.map +1 -0
- package/dist/detectors/phrase-context.js +12 -0
- package/dist/detectors/phrase-context.js.map +1 -0
- package/dist/detectors/phrase-match-all.d.ts +3 -0
- package/dist/detectors/phrase-match-all.d.ts.map +1 -0
- package/dist/detectors/phrase-match-all.js +47 -0
- package/dist/detectors/phrase-match-all.js.map +1 -0
- package/dist/detectors/phrase-match.d.ts +2 -1
- package/dist/detectors/phrase-match.d.ts.map +1 -1
- package/dist/detectors/phrase-match.js +25 -6
- package/dist/detectors/phrase-match.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts.map +1 -1
- package/dist/detectors/placeholder-text.js +22 -2
- package/dist/detectors/placeholder-text.js.map +1 -1
- package/dist/detectors/placeholder.d.ts +1 -0
- package/dist/detectors/placeholder.d.ts.map +1 -1
- package/dist/detectors/placeholder.js +8 -0
- package/dist/detectors/placeholder.js.map +1 -1
- package/dist/detectors/proper-noun-density.d.ts.map +1 -1
- package/dist/detectors/proper-noun-density.js +10 -6
- package/dist/detectors/proper-noun-density.js.map +1 -1
- package/dist/detectors/pseudo-heading.d.ts +9 -0
- package/dist/detectors/pseudo-heading.d.ts.map +1 -0
- package/dist/detectors/pseudo-heading.js +54 -0
- package/dist/detectors/pseudo-heading.js.map +1 -0
- package/dist/detectors/quote-around.d.ts +4 -1
- package/dist/detectors/quote-around.d.ts.map +1 -1
- package/dist/detectors/quote-around.js +28 -5
- package/dist/detectors/quote-around.js.map +1 -1
- package/dist/detectors/quoted-label.d.ts +8 -0
- package/dist/detectors/quoted-label.d.ts.map +1 -0
- package/dist/detectors/quoted-label.js +18 -0
- package/dist/detectors/quoted-label.js.map +1 -0
- package/dist/detectors/ra-nuki.d.ts +1 -7
- package/dist/detectors/ra-nuki.d.ts.map +1 -1
- package/dist/detectors/ra-nuki.js +2 -27
- package/dist/detectors/ra-nuki.js.map +1 -1
- package/dist/detectors/range-notation.js +2 -2
- package/dist/detectors/range-notation.js.map +1 -1
- package/dist/detectors/register-required.d.ts +27 -0
- package/dist/detectors/register-required.d.ts.map +1 -0
- package/dist/detectors/register-required.js +33 -0
- package/dist/detectors/register-required.js.map +1 -0
- package/dist/detectors/register-voice.d.ts +13 -1
- package/dist/detectors/register-voice.d.ts.map +1 -1
- package/dist/detectors/register-voice.js +27 -0
- package/dist/detectors/register-voice.js.map +1 -1
- package/dist/detectors/registry/enumeration-marker.d.ts +3 -0
- package/dist/detectors/registry/enumeration-marker.d.ts.map +1 -0
- package/dist/detectors/registry/enumeration-marker.js +3 -0
- package/dist/detectors/registry/enumeration-marker.js.map +1 -0
- package/dist/detectors/registry/filler-word.d.ts +3 -0
- package/dist/detectors/registry/filler-word.d.ts.map +1 -0
- package/dist/detectors/registry/filler-word.js +3 -0
- package/dist/detectors/registry/filler-word.js.map +1 -0
- package/dist/detectors/registry/heading-marker-no-space.d.ts +3 -0
- package/dist/detectors/registry/heading-marker-no-space.d.ts.map +1 -0
- package/dist/detectors/registry/heading-marker-no-space.js +3 -0
- package/dist/detectors/registry/heading-marker-no-space.js.map +1 -0
- package/dist/detectors/registry/link-definition-unused.d.ts +3 -0
- package/dist/detectors/registry/link-definition-unused.d.ts.map +1 -0
- package/dist/detectors/registry/link-definition-unused.js +3 -0
- package/dist/detectors/registry/link-definition-unused.js.map +1 -0
- package/dist/detectors/registry/phrase-match-all.d.ts +3 -0
- package/dist/detectors/registry/phrase-match-all.d.ts.map +1 -0
- package/dist/detectors/registry/phrase-match-all.js +3 -0
- package/dist/detectors/registry/phrase-match-all.js.map +1 -0
- package/dist/detectors/registry/pseudo-heading.d.ts +3 -0
- package/dist/detectors/registry/pseudo-heading.d.ts.map +1 -0
- package/dist/detectors/registry/pseudo-heading.js +3 -0
- package/dist/detectors/registry/pseudo-heading.js.map +1 -0
- package/dist/detectors/registry/reversed-link.d.ts +3 -0
- package/dist/detectors/registry/reversed-link.d.ts.map +1 -0
- package/dist/detectors/registry/reversed-link.js +3 -0
- package/dist/detectors/registry/reversed-link.js.map +1 -0
- package/dist/detectors/registry/sa-ire.d.ts +3 -0
- package/dist/detectors/registry/sa-ire.d.ts.map +1 -0
- package/dist/detectors/registry/sa-ire.js +3 -0
- package/dist/detectors/registry/sa-ire.js.map +1 -0
- package/dist/detectors/registry/table-absorbed-line.d.ts +3 -0
- package/dist/detectors/registry/table-absorbed-line.d.ts.map +1 -0
- package/dist/detectors/registry/table-absorbed-line.js +3 -0
- package/dist/detectors/registry/table-absorbed-line.js.map +1 -0
- package/dist/detectors/registry/term-consistency.d.ts +3 -0
- package/dist/detectors/registry/term-consistency.d.ts.map +1 -0
- package/dist/detectors/registry/term-consistency.js +3 -0
- package/dist/detectors/registry/term-consistency.js.map +1 -0
- package/dist/detectors/registry/term-form.d.ts +3 -0
- package/dist/detectors/registry/term-form.d.ts.map +1 -0
- package/dist/detectors/registry/term-form.js +3 -0
- package/dist/detectors/registry/term-form.js.map +1 -0
- package/dist/detectors/relative-pronoun-mix.d.ts +1 -1
- package/dist/detectors/relative-pronoun-mix.d.ts.map +1 -1
- package/dist/detectors/relative-pronoun-mix.js +14 -3
- package/dist/detectors/relative-pronoun-mix.js.map +1 -1
- package/dist/detectors/release-notes.d.ts +7 -0
- package/dist/detectors/release-notes.d.ts.map +1 -0
- package/dist/detectors/release-notes.js +12 -0
- package/dist/detectors/release-notes.js.map +1 -0
- package/dist/detectors/request-owner.d.ts +5 -1
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +53 -1
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/requirement-lists.d.ts.map +1 -1
- package/dist/detectors/requirement-lists.js +2 -0
- package/dist/detectors/requirement-lists.js.map +1 -1
- package/dist/detectors/reversed-link.d.ts +3 -0
- package/dist/detectors/reversed-link.d.ts.map +1 -0
- package/dist/detectors/reversed-link.js +31 -0
- package/dist/detectors/reversed-link.js.map +1 -0
- package/dist/detectors/sa-ire.d.ts +3 -0
- package/dist/detectors/sa-ire.d.ts.map +1 -0
- package/dist/detectors/sa-ire.js +5 -0
- package/dist/detectors/sa-ire.js.map +1 -0
- package/dist/detectors/sentence-counts.d.ts.map +1 -1
- package/dist/detectors/sentence-counts.js +24 -9
- package/dist/detectors/sentence-counts.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +35 -11
- package/dist/detectors/sentence-ending.js.map +1 -1
- package/dist/detectors/sentence-length.d.ts.map +1 -1
- package/dist/detectors/sentence-length.js +20 -3
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/sentence-rhythm.d.ts.map +1 -1
- package/dist/detectors/sentence-rhythm.js +6 -2
- package/dist/detectors/sentence-rhythm.js.map +1 -1
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +8 -3
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/structure.d.ts +1 -0
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +5 -0
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/team.d.ts.map +1 -1
- package/dist/detectors/team.js +42 -9
- package/dist/detectors/team.js.map +1 -1
- package/dist/detectors/technical-docs.d.ts +8 -1
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +16 -3
- package/dist/detectors/technical-docs.js.map +1 -1
- package/dist/detectors/term-consistency.d.ts +4 -0
- package/dist/detectors/term-consistency.d.ts.map +1 -0
- package/dist/detectors/term-consistency.js +35 -0
- package/dist/detectors/term-consistency.js.map +1 -0
- package/dist/detectors/term-form.d.ts +4 -0
- package/dist/detectors/term-form.d.ts.map +1 -0
- package/dist/detectors/term-form.js +17 -0
- package/dist/detectors/term-form.js.map +1 -0
- package/dist/detectors/token-shape.d.ts.map +1 -1
- package/dist/detectors/token-shape.js +4 -1
- package/dist/detectors/token-shape.js.map +1 -1
- package/dist/detectors/unbalanced-bracket.d.ts +1 -1
- package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
- package/dist/detectors/unbalanced-bracket.js +4 -2
- package/dist/detectors/unbalanced-bracket.js.map +1 -1
- package/dist/detectors/unit-spacing.js +2 -2
- package/dist/detectors/unit-spacing.js.map +1 -1
- package/dist/detectors/unknown-word-context.d.ts +2 -0
- package/dist/detectors/unknown-word-context.d.ts.map +1 -1
- package/dist/detectors/unknown-word-context.js +3 -0
- package/dist/detectors/unknown-word-context.js.map +1 -1
- package/dist/detectors/unknown-word.d.ts.map +1 -1
- package/dist/detectors/unknown-word.js +7 -2
- package/dist/detectors/unknown-word.js.map +1 -1
- package/dist/detectors/vague-deadline.d.ts.map +1 -1
- package/dist/detectors/vague-deadline.js +2 -1
- package/dist/detectors/vague-deadline.js.map +1 -1
- package/dist/detectors/vague-density.d.ts.map +1 -1
- package/dist/detectors/vague-density.js +10 -2
- package/dist/detectors/vague-density.js.map +1 -1
- package/dist/detectors/version-mismatch.d.ts.map +1 -1
- package/dist/detectors/version-mismatch.js +5 -1
- package/dist/detectors/version-mismatch.js.map +1 -1
- package/dist/detectors/weasel-word.d.ts.map +1 -1
- package/dist/detectors/weasel-word.js +11 -2
- package/dist/detectors/weasel-word.js.map +1 -1
- package/dist/document-prose.d.ts +17 -0
- package/dist/document-prose.d.ts.map +1 -0
- package/dist/document-prose.js +35 -0
- package/dist/document-prose.js.map +1 -0
- package/dist/document-scope.d.ts +16 -0
- package/dist/document-scope.d.ts.map +1 -0
- package/dist/document-scope.js +51 -0
- package/dist/document-scope.js.map +1 -0
- package/dist/document.d.ts +10 -1
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +26 -37
- package/dist/document.js.map +1 -1
- package/dist/enumeration-marks.d.ts +23 -0
- package/dist/enumeration-marks.d.ts.map +1 -0
- package/dist/enumeration-marks.js +184 -0
- package/dist/enumeration-marks.js.map +1 -0
- package/dist/facts/cross-facts.d.ts +1 -1
- package/dist/facts/cross-facts.d.ts.map +1 -1
- package/dist/facts/cross-facts.js +8 -3
- package/dist/facts/cross-facts.js.map +1 -1
- package/dist/facts/labelled-facts.d.ts.map +1 -1
- package/dist/facts/labelled-facts.js +7 -4
- package/dist/facts/labelled-facts.js.map +1 -1
- package/dist/file-header.d.ts +2 -6
- package/dist/file-header.d.ts.map +1 -1
- package/dist/file-header.js +1 -1
- package/dist/file-header.js.map +1 -1
- package/dist/files.d.ts +18 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +58 -8
- package/dist/files.js.map +1 -1
- package/dist/gitignore.d.ts +30 -0
- package/dist/gitignore.d.ts.map +1 -0
- package/dist/gitignore.js +68 -0
- package/dist/gitignore.js.map +1 -0
- package/dist/grade/stamp.d.ts.map +1 -1
- package/dist/grade/stamp.js +5 -0
- package/dist/grade/stamp.js.map +1 -1
- package/dist/latin-word-boundary.d.ts +5 -0
- package/dist/latin-word-boundary.d.ts.map +1 -1
- package/dist/latin-word-boundary.js +11 -0
- package/dist/latin-word-boundary.js.map +1 -1
- package/dist/levels.d.ts +14 -0
- package/dist/levels.d.ts.map +1 -1
- package/dist/levels.js +8 -3
- package/dist/levels.js.map +1 -1
- package/dist/markdown-node.d.ts +1 -0
- package/dist/markdown-node.d.ts.map +1 -1
- package/dist/markdown-node.js.map +1 -1
- package/dist/name-separator.d.ts.map +1 -1
- package/dist/name-separator.js +27 -5
- package/dist/name-separator.js.map +1 -1
- package/dist/news-dateline.d.ts +7 -0
- package/dist/news-dateline.d.ts.map +1 -0
- package/dist/news-dateline.js +24 -0
- package/dist/news-dateline.js.map +1 -0
- package/dist/phone-numbers.d.ts +5 -2
- package/dist/phone-numbers.d.ts.map +1 -1
- package/dist/phone-numbers.js +17 -3
- package/dist/phone-numbers.js.map +1 -1
- package/dist/plugin.d.ts +26 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/reasons.d.ts +4 -0
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +4 -0
- package/dist/reasons.js.map +1 -1
- package/dist/render/explain.d.ts +5 -0
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +57 -15
- package/dist/render/explain.js.map +1 -1
- package/dist/render/options.d.ts.map +1 -1
- package/dist/render/options.js +11 -6
- package/dist/render/options.js.map +1 -1
- package/dist/render/rules-json.d.ts.map +1 -1
- package/dist/render/rules-json.js +12 -2
- package/dist/render/rules-json.js.map +1 -1
- package/dist/render/summary.d.ts +5 -2
- package/dist/render/summary.d.ts.map +1 -1
- package/dist/render/summary.js +25 -4
- package/dist/render/summary.js.map +1 -1
- package/dist/render/suppressions.d.ts +6 -1
- package/dist/render/suppressions.d.ts.map +1 -1
- package/dist/render/suppressions.js +76 -3
- package/dist/render/suppressions.js.map +1 -1
- package/dist/render/text.d.ts.map +1 -1
- package/dist/render/text.js +14 -4
- package/dist/render/text.js.map +1 -1
- package/dist/rule-load.d.ts.map +1 -1
- package/dist/rule-load.js +2 -1
- package/dist/rule-load.js.map +1 -1
- package/dist/run-in-title.d.ts +4 -0
- package/dist/run-in-title.d.ts.map +1 -0
- package/dist/run-in-title.js +82 -0
- package/dist/run-in-title.js.map +1 -0
- package/dist/run.d.ts +5 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +40 -21
- package/dist/run.js.map +1 -1
- package/dist/scope-markers.d.ts +9 -0
- package/dist/scope-markers.d.ts.map +1 -0
- package/dist/scope-markers.js +19 -0
- package/dist/scope-markers.js.map +1 -0
- package/dist/scope-problem-text.d.ts +4 -0
- package/dist/scope-problem-text.d.ts.map +1 -0
- package/dist/scope-problem-text.js +17 -0
- package/dist/scope-problem-text.js.map +1 -0
- package/dist/scoped-sentences.d.ts +21 -0
- package/dist/scoped-sentences.d.ts.map +1 -0
- package/dist/scoped-sentences.js +21 -0
- package/dist/scoped-sentences.js.map +1 -0
- package/dist/setting-problems.d.ts.map +1 -1
- package/dist/setting-problems.js +4 -0
- package/dist/setting-problems.js.map +1 -1
- package/dist/spelling.js +4 -4
- package/dist/spelling.js.map +1 -1
- package/dist/stet-body.d.ts +13 -0
- package/dist/stet-body.d.ts.map +1 -0
- package/dist/stet-body.js +49 -0
- package/dist/stet-body.js.map +1 -0
- package/dist/stet.d.ts +30 -4
- package/dist/stet.d.ts.map +1 -1
- package/dist/stet.js +78 -28
- package/dist/stet.js.map +1 -1
- package/dist/structure/alert-lines.d.ts +4 -0
- package/dist/structure/alert-lines.d.ts.map +1 -0
- package/dist/structure/alert-lines.js +19 -0
- package/dist/structure/alert-lines.js.map +1 -0
- package/dist/structure/catch-all-row-blank.d.ts +9 -0
- package/dist/structure/catch-all-row-blank.d.ts.map +1 -0
- package/dist/structure/catch-all-row-blank.js +19 -0
- package/dist/structure/catch-all-row-blank.js.map +1 -0
- package/dist/structure/change-rate-tied.d.ts +22 -0
- package/dist/structure/change-rate-tied.d.ts.map +1 -0
- package/dist/structure/change-rate-tied.js +85 -0
- package/dist/structure/change-rate-tied.js.map +1 -0
- package/dist/structure/cross-definitions.d.ts +1 -1
- package/dist/structure/cross-definitions.d.ts.map +1 -1
- package/dist/structure/cross-definitions.js +3 -9
- package/dist/structure/cross-definitions.js.map +1 -1
- package/dist/structure/deadline-after-event.d.ts +1 -1
- package/dist/structure/deadline-after-event.d.ts.map +1 -1
- package/dist/structure/deadline-after-event.js +36 -9
- package/dist/structure/deadline-after-event.js.map +1 -1
- package/dist/structure/defining-names.d.ts +1 -1
- package/dist/structure/defining-names.d.ts.map +1 -1
- package/dist/structure/defining-names.js +12 -1
- package/dist/structure/defining-names.js.map +1 -1
- package/dist/structure/definition-use.d.ts +10 -1
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +4 -4
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure/leg-times.d.ts.map +1 -1
- package/dist/structure/leg-times.js +10 -2
- package/dist/structure/leg-times.js.map +1 -1
- package/dist/structure/net-amount.d.ts +16 -0
- package/dist/structure/net-amount.d.ts.map +1 -1
- package/dist/structure/net-amount.js +28 -1
- package/dist/structure/net-amount.js.map +1 -1
- package/dist/structure/period-label-conflict.d.ts +2 -2
- package/dist/structure/period-label-conflict.d.ts.map +1 -1
- package/dist/structure/period-label-conflict.js +17 -3
- package/dist/structure/period-label-conflict.js.map +1 -1
- package/dist/structure/requirement-lists.d.ts +3 -0
- package/dist/structure/requirement-lists.d.ts.map +1 -1
- package/dist/structure/requirement-lists.js +8 -2
- package/dist/structure/requirement-lists.js.map +1 -1
- package/dist/structure/serial-range.d.ts.map +1 -1
- package/dist/structure/serial-range.js +14 -6
- package/dist/structure/serial-range.js.map +1 -1
- package/dist/structure/time-marks.d.ts +10 -0
- package/dist/structure/time-marks.d.ts.map +1 -1
- package/dist/structure/time-marks.js +21 -0
- package/dist/structure/time-marks.js.map +1 -1
- package/dist/structure/version-mismatch.d.ts +6 -1
- package/dist/structure/version-mismatch.d.ts.map +1 -1
- package/dist/structure/version-mismatch.js +28 -6
- package/dist/structure/version-mismatch.js.map +1 -1
- package/dist/structure/weekday.d.ts.map +1 -1
- package/dist/structure/weekday.js +14 -1
- package/dist/structure/weekday.js.map +1 -1
- package/dist/table-cells.d.ts +1 -1
- package/dist/table-cells.d.ts.map +1 -1
- package/dist/table-cells.js.map +1 -1
- package/dist/term-form.d.ts +15 -0
- package/dist/term-form.d.ts.map +1 -0
- package/dist/term-form.js +72 -0
- package/dist/term-form.js.map +1 -0
- package/dist/term-groups.d.ts +33 -0
- package/dist/term-groups.d.ts.map +1 -0
- package/dist/term-groups.js +46 -0
- package/dist/term-groups.js.map +1 -0
- package/dist/text-scope.d.ts +35 -0
- package/dist/text-scope.d.ts.map +1 -0
- package/dist/text-scope.js +55 -0
- package/dist/text-scope.js.map +1 -0
- package/dist/topic-clause.d.ts.map +1 -1
- package/dist/topic-clause.js +85 -16
- package/dist/topic-clause.js.map +1 -1
- package/dist/unclosed-code-quote.d.ts +7 -0
- package/dist/unclosed-code-quote.d.ts.map +1 -0
- package/dist/unclosed-code-quote.js +37 -0
- package/dist/unclosed-code-quote.js.map +1 -0
- package/package.json +4 -3
- package/rules/abstract-length.yaml +1 -1
- package/rules/adverb-overuse.yaml +3 -3
- package/rules/agentless-passive.yaml +3 -3
- package/rules/agreement-slip.yaml +5 -4
- package/rules/ai-generated-composite.yaml +3 -3
- package/rules/ai-structure.yaml +1 -1
- package/rules/all-caps-shouting.yaml +1 -1
- package/rules/announced-count-mismatch.yaml +2 -2
- package/rules/announcing-opener.yaml +1 -1
- package/rules/arrival-before-departure.yaml +1 -1
- package/rules/article-sound.yaml +1 -1
- package/rules/baito-keigo.yaml +1 -1
- package/rules/bold-density.yaml +3 -3
- package/rules/bold-emphasis.yaml +1 -1
- package/rules/bold-label-list.yaml +3 -3
- package/rules/bracket-width-consistency.yaml +3 -3
- package/rules/broken-link.yaml +2 -2
- package/rules/change-rate-mismatch.yaml +2 -2
- package/rules/chat-citation-residue.yaml +1 -1
- package/rules/citation-style-mix.yaml +1 -1
- package/rules/clause-chain.yaml +1 -1
- package/rules/cliche.yaml +4 -4
- package/rules/closing-cliche.yaml +1 -1
- package/rules/closing-exhortation.yaml +1 -1
- package/rules/code-fence-language-mix.yaml +2 -2
- package/rules/cold-open.yaml +1 -1
- package/rules/colloquial-opener.yaml +1 -1
- package/rules/comparative-without-baseline.yaml +2 -2
- package/rules/concrete-evidence-density.yaml +1 -1
- package/rules/contraction-consistency.yaml +4 -4
- package/rules/cross-doc-duplicate-definition.yaml +2 -2
- package/rules/cross-doc-fact-conflict.yaml +2 -2
- package/rules/cross-doc-term-variant.yaml +6 -6
- package/rules/cushion-phrase-density.yaml +1 -1
- package/rules/date-format-consistency.yaml +2 -2
- package/rules/date-weekday-mismatch.yaml +2 -2
- package/rules/date-without-year.yaml +2 -2
- package/rules/deadline-after-event.yaml +2 -2
- package/rules/defined-term-form.yaml +2 -2
- package/rules/demonstrative-opener-run.yaml +1 -1
- package/rules/double-keigo.yaml +1 -1
- package/rules/double-negative.yaml +11 -2
- package/rules/doubled-nado.yaml +1 -1
- package/rules/elapsed-years-mismatch.yaml +2 -2
- package/rules/email-stock-courtesy.yaml +1 -1
- package/rules/email-subject-length.yaml +1 -1
- package/rules/emoji-heading.yaml +1 -1
- package/rules/empty-intensifier.yaml +1 -1
- package/rules/empty-section.yaml +2 -2
- package/rules/empty-table-cell.yaml +2 -2
- package/rules/enumeration-marker-mix.yaml +102 -0
- package/rules/excessive-hedging.yaml +1 -1
- package/rules/exclamation-width-consistency.yaml +1 -1
- package/rules/expletive-construction.yaml +3 -3
- package/rules/figurative-density.yaml +3 -3
- package/rules/filler-word.yaml +74 -0
- package/rules/fullwidth-alnum-consistency.yaml +2 -2
- package/rules/heading-marker-no-space.yaml +79 -0
- package/rules/hiragana-fukushi.yaml +1 -1
- package/rules/homophone-slip.yaml +3 -3
- package/rules/honesty-marker.yaml +1 -1
- package/rules/humble-for-others.yaml +1 -1
- package/rules/hyphen-as-dash.yaml +3 -3
- package/rules/idiom-misuse.yaml +1 -1
- package/rules/internal-jargon.yaml +1 -1
- package/rules/kana-function-word.yaml +1 -1
- package/rules/katakana-long-vowel.yaml +1 -1
- package/rules/known-misspelling.yaml +2 -2
- package/rules/kutoten-consistency.yaml +7 -3
- package/rules/latin-abbreviation-form.yaml +1 -1
- package/rules/latin-spacing.yaml +5 -5
- package/rules/link-definition-unused.yaml +107 -0
- package/rules/list-item-form-mix.yaml +2 -2
- package/rules/max-kanji-continuous.yaml +5 -2
- package/rules/max-paragraph-length.yaml +1 -1
- package/rules/max-sentence-length.yaml +3 -3
- package/rules/max-ten.yaml +1 -1
- package/rules/misconversion.yaml +2 -2
- package/rules/missing-final-period.yaml +2 -2
- package/rules/name-variant.yaml +2 -2
- package/rules/net-amount-mismatch.yaml +5 -5
- package/rules/ngram-repetition.yaml +3 -3
- package/rules/no-doubled-joshi.yaml +2 -2
- package/rules/no-em-dash.yaml +3 -3
- package/rules/no-mixed-desumasu.yaml +63 -3
- package/rules/no-nakaguro-parallel.yaml +3 -3
- package/rules/nominalization.yaml +3 -3
- package/rules/nonstandard-word.yaml +2 -2
- package/rules/number-style-consistency.yaml +2 -2
- package/rules/numbered-generic-heading.yaml +1 -1
- package/rules/numbering-gap.yaml +2 -2
- package/rules/obligation-without-deadline.yaml +2 -2
- package/rules/one-sentence-paragraph-run.yaml +3 -3
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/over-general-claim.yaml +1 -1
- package/rules/oxford-comma-consistency.yaml +4 -3
- package/rules/padded-intro.yaml +1 -1
- package/rules/period-label-conflict.yaml +2 -2
- package/rules/phone-number-variant.yaml +1 -1
- package/rules/preamble-length.yaml +3 -3
- package/rules/preferred-term.yaml +1 -1
- package/rules/proper-noun-density.yaml +1 -1
- package/rules/pseudo-heading.yaml +79 -0
- package/rules/q-fragment-answer.yaml +1 -1
- package/rules/quote-style-consistency.yaml +1 -1
- package/rules/quote-without-source.yaml +2 -2
- package/rules/redundant-expression.yaml +1 -1
- package/rules/repeated-conjunction.yaml +1 -1
- package/rules/repeated-sentence-ending.yaml +3 -3
- package/rules/repeated-sentence-head.yaml +5 -5
- package/rules/request-without-deadline.yaml +2 -2
- package/rules/required-listed-as-preferred.yaml +2 -2
- package/rules/required-sections.yaml +1 -1
- package/rules/reversed-link.yaml +78 -0
- package/rules/sa-ire.yaml +43 -0
- package/rules/sasete-itadaku.yaml +1 -1
- package/rules/sentence-initial-conjunction-run.yaml +1 -1
- package/rules/sentence-initial-so.yaml +1 -1
- package/rules/sentence-rhythm.yaml +2 -2
- package/rules/sentence-spacing-consistency.yaml +1 -1
- package/rules/serial-range-reversed.yaml +4 -4
- package/rules/shell-prompt-mix.yaml +3 -3
- package/rules/stock-transition.yaml +1 -1
- package/rules/stray-space.yaml +1 -1
- package/rules/table-absorbed-line.yaml +88 -0
- package/rules/taigen-dome-in-prose.yaml +1 -1
- package/rules/teki-overuse.yaml +3 -3
- package/rules/term-consistency.yaml +56 -0
- package/rules/term-form.yaml +56 -0
- package/rules/title-case-consistency.yaml +5 -5
- package/rules/title-length.yaml +3 -3
- package/rules/topic-predicate-distance.yaml +3 -3
- package/rules/translationese-density.yaml +1 -1
- package/rules/unbalanced-bracket.yaml +2 -2
- package/rules/uncomparable-graded.yaml +1 -1
- package/rules/undefined-acronym.yaml +5 -3
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +4 -4
- package/rules/unknown-word.yaml +2 -2
- package/rules/unqualified-superlative.yaml +1 -1
- package/rules/use-before-definition.yaml +2 -2
- package/rules/vague-word-density.yaml +3 -3
- package/rules/version-mismatch.yaml +2 -2
- package/rules/weasel-word.yaml +4 -4
- package/rules/which-that-consistency.yaml +3 -3
- package/rules/wordy-phrase.yaml +1 -1
- package/skills/chaff/SKILL.md +51 -7
- package/src/allow.ts +146 -0
- package/src/announced-count.ts +22 -1
- package/src/announced-list.ts +7 -1
- package/src/check-source.ts +33 -9
- package/src/cli-text.ts +13 -4
- package/src/cli.ts +20 -17
- package/src/commands/eval.ts +1 -1
- package/src/commands/suppressions.ts +3 -3
- package/src/commands/test.ts +1 -1
- package/src/composite-signals.ts +10 -1
- package/src/compound-head.ts +17 -8
- package/src/config/allow-problems.ts +75 -0
- package/src/config/by-path-problems.ts +29 -3
- package/src/config/by-path-rules.ts +78 -0
- package/src/config/by-path.ts +9 -0
- package/src/config/consistent-problems.ts +36 -0
- package/src/config/load.ts +87 -15
- package/src/config/option-problems.ts +8 -5
- package/src/config/prefer-problems.ts +22 -0
- package/src/config/prefer.ts +52 -0
- package/src/config/term-problems.ts +38 -0
- package/src/config/warnings.ts +9 -2
- package/src/cross-variants.ts +4 -7
- package/src/cross-votes.ts +35 -4
- package/src/custom/parse.ts +16 -3
- package/src/custom/problems.ts +9 -3
- package/src/custom/scope-field.ts +16 -0
- package/src/date-format.ts +43 -8
- package/src/derived/elapsed.ts +17 -2
- package/src/detectors/acronym-context.ts +7 -1
- package/src/detectors/acronym-gloss.ts +59 -11
- package/src/detectors/agentless-passive.ts +49 -5
- package/src/detectors/agreement-slip.ts +11 -3
- package/src/detectors/amount-scale.ts +2 -2
- package/src/detectors/bare-comparative.ts +35 -3
- package/src/detectors/blank-structure.ts +18 -9
- package/src/detectors/bold-label.ts +7 -2
- package/src/detectors/bracket-title-date.ts +36 -0
- package/src/detectors/broken-link.ts +14 -1
- package/src/detectors/capitalised-term.ts +18 -4
- package/src/detectors/change-rate.ts +29 -4
- package/src/detectors/char-shape.ts +13 -17
- package/src/detectors/chat-citation.ts +4 -5
- package/src/detectors/chat-mark-extent.ts +63 -0
- package/src/detectors/clause-shape.ts +8 -4
- package/src/detectors/conjugated-entry.ts +3 -5
- package/src/detectors/contraction-mix.ts +8 -2
- package/src/detectors/contraction-set-apart.ts +22 -2
- package/src/detectors/contrast-frame.ts +37 -2
- package/src/detectors/coordinate-adjective.ts +54 -1
- package/src/detectors/count-per-section.ts +13 -8
- package/src/detectors/counter-edge.ts +20 -0
- package/src/detectors/cross-variant.ts +16 -2
- package/src/detectors/currency-notation.ts +2 -2
- package/src/detectors/custom.ts +6 -4
- package/src/detectors/date-format.ts +1 -1
- package/src/detectors/date-repeated-day.ts +20 -0
- package/src/detectors/date-year.ts +8 -1
- package/src/detectors/defined-term-form.ts +21 -7
- package/src/detectors/definition-use.ts +12 -9
- package/src/detectors/derived-numbers.ts +1 -0
- package/src/detectors/document-shape.ts +4 -1
- package/src/detectors/ellipsis.ts +2 -2
- package/src/detectors/email-letter.ts +7 -3
- package/src/detectors/empty-section.ts +10 -2
- package/src/detectors/en-shape.ts +57 -6
- package/src/detectors/enumeration-marker.ts +14 -0
- package/src/detectors/event-title-item.ts +57 -0
- package/src/detectors/example-baseline.ts +16 -1
- package/src/detectors/filler-word.ts +96 -0
- package/src/detectors/fullwidth-alnum.ts +24 -0
- package/src/detectors/gram-furniture.ts +8 -0
- package/src/detectors/gram-repetition.ts +8 -1
- package/src/detectors/heading-case.ts +18 -4
- package/src/detectors/heading-marker-no-space.ts +62 -0
- package/src/detectors/hyphen-name-suffix.ts +3 -2
- package/src/detectors/inline-item-label.ts +98 -0
- package/src/detectors/kanji-name-edge.ts +11 -0
- package/src/detectors/known-correction.ts +17 -1
- package/src/detectors/kutoten-consistency.ts +37 -6
- package/src/detectors/lexicon-match.ts +17 -3
- package/src/detectors/lexicon.ts +10 -4
- package/src/detectors/link-definition.ts +91 -0
- package/src/detectors/list-item-asides.ts +29 -0
- package/src/detectors/list-item-clause.ts +9 -0
- package/src/detectors/list-item.ts +7 -0
- package/src/detectors/list-items.ts +13 -2
- package/src/detectors/list-opening-conjunction.ts +22 -0
- package/src/detectors/list-parallel.ts +16 -17
- package/src/detectors/list-run.ts +16 -3
- package/src/detectors/list-sentence.ts +2 -0
- package/src/detectors/list-verb-series.ts +24 -0
- package/src/detectors/mark-shape.ts +51 -27
- package/src/detectors/markdown-slip.ts +25 -1
- package/src/detectors/marked-word.ts +40 -0
- package/src/detectors/middle-dot.ts +27 -2
- package/src/detectors/missing-final-period.ts +19 -1
- package/src/detectors/name-variant-two-things.ts +37 -2
- package/src/detectors/net-amount-mismatch.ts +41 -4
- package/src/detectors/nominalization.ts +22 -5
- package/src/detectors/number-style.ts +8 -0
- package/src/detectors/ordinal-suffix.ts +2 -2
- package/src/detectors/ordinary-phrase.ts +13 -0
- package/src/detectors/organisation-run.ts +9 -0
- package/src/detectors/orthographic-variant-kanji-word.ts +33 -0
- package/src/detectors/orthographic-variant-open.ts +2 -1
- package/src/detectors/orthographic-variant-text.ts +20 -0
- package/src/detectors/orthographic-variant.ts +61 -32
- package/src/detectors/orthography.ts +36 -10
- package/src/detectors/oxford-comma.ts +28 -2
- package/src/detectors/paragraph-run.ts +9 -12
- package/src/detectors/phone-number-variant.ts +2 -1
- package/src/detectors/phrase-context.ts +19 -0
- package/src/detectors/phrase-match-all.ts +57 -0
- package/src/detectors/phrase-match.ts +31 -6
- package/src/detectors/placeholder-text.ts +36 -3
- package/src/detectors/placeholder.ts +10 -0
- package/src/detectors/proper-noun-density.ts +14 -6
- package/src/detectors/pseudo-heading.ts +59 -0
- package/src/detectors/quote-around.ts +37 -6
- package/src/detectors/quoted-label.ts +22 -0
- package/src/detectors/ra-nuki.ts +3 -34
- package/src/detectors/range-notation.ts +2 -2
- package/src/detectors/register-required.ts +56 -0
- package/src/detectors/register-voice.ts +36 -1
- package/src/detectors/registry/enumeration-marker.ts +4 -0
- package/src/detectors/registry/filler-word.ts +4 -0
- package/src/detectors/registry/heading-marker-no-space.ts +4 -0
- package/src/detectors/registry/link-definition-unused.ts +4 -0
- package/src/detectors/registry/phrase-match-all.ts +4 -0
- package/src/detectors/registry/pseudo-heading.ts +4 -0
- package/src/detectors/registry/reversed-link.ts +4 -0
- package/src/detectors/registry/sa-ire.ts +4 -0
- package/src/detectors/registry/table-absorbed-line.ts +4 -0
- package/src/detectors/registry/term-consistency.ts +4 -0
- package/src/detectors/registry/term-form.ts +4 -0
- package/src/detectors/relative-pronoun-mix.ts +18 -3
- package/src/detectors/release-notes.ts +19 -0
- package/src/detectors/request-owner.ts +62 -2
- package/src/detectors/requirement-lists.ts +2 -0
- package/src/detectors/reversed-link.ts +39 -0
- package/src/detectors/sa-ire.ts +7 -0
- package/src/detectors/sentence-counts.ts +35 -13
- package/src/detectors/sentence-ending.ts +53 -12
- package/src/detectors/sentence-length.ts +28 -4
- package/src/detectors/sentence-rhythm.ts +6 -2
- package/src/detectors/signals.ts +12 -3
- package/src/detectors/structure.ts +4 -0
- package/src/detectors/team.ts +50 -12
- package/src/detectors/technical-docs.ts +27 -3
- package/src/detectors/term-consistency.ts +41 -0
- package/src/detectors/term-form.ts +17 -0
- package/src/detectors/token-shape.ts +4 -1
- package/src/detectors/unbalanced-bracket.ts +4 -2
- package/src/detectors/unit-spacing.ts +2 -2
- package/src/detectors/unknown-word-context.ts +6 -0
- package/src/detectors/unknown-word.ts +7 -1
- package/src/detectors/vague-deadline.ts +2 -1
- package/src/detectors/vague-density.ts +10 -2
- package/src/detectors/version-mismatch.ts +7 -1
- package/src/detectors/weasel-word.ts +13 -2
- package/src/document-prose.ts +43 -0
- package/src/document-scope.ts +66 -0
- package/src/document.ts +43 -50
- package/src/enumeration-marks.ts +233 -0
- package/src/facts/cross-facts.ts +10 -4
- package/src/facts/labelled-facts.ts +7 -4
- package/src/file-header.ts +3 -5
- package/src/files.ts +87 -8
- package/src/gitignore.ts +83 -0
- package/src/grade/stamp.ts +5 -0
- package/src/latin-word-boundary.ts +12 -0
- package/src/levels.ts +9 -3
- package/src/markdown-node.ts +1 -0
- package/src/name-separator.ts +29 -7
- package/src/news-dateline.ts +29 -0
- package/src/phone-numbers.ts +19 -3
- package/src/plugin.ts +23 -3
- package/src/reasons.ts +8 -0
- package/src/render/explain.ts +72 -17
- package/src/render/options.ts +12 -6
- package/src/render/rules-json.ts +16 -2
- package/src/render/summary.ts +33 -4
- package/src/render/suppressions.ts +101 -4
- package/src/render/text.ts +20 -7
- package/src/rule-load.ts +3 -2
- package/src/run-in-title.ts +91 -0
- package/src/run.ts +53 -16
- package/src/scope-markers.ts +25 -0
- package/src/scope-problem-text.ts +21 -0
- package/src/scoped-sentences.ts +41 -0
- package/src/setting-problems.ts +4 -0
- package/src/spelling.ts +4 -4
- package/src/stet-body.ts +74 -0
- package/src/stet.ts +113 -32
- package/src/structure/alert-lines.ts +19 -0
- package/src/structure/catch-all-row-blank.ts +22 -0
- package/src/structure/change-rate-tied.ts +113 -0
- package/src/structure/cross-definitions.ts +6 -9
- package/src/structure/deadline-after-event.ts +49 -10
- package/src/structure/defining-names.ts +14 -1
- package/src/structure/definition-use.ts +15 -5
- package/src/structure/leg-times.ts +16 -1
- package/src/structure/net-amount.ts +44 -5
- package/src/structure/period-label-conflict.ts +22 -7
- package/src/structure/requirement-lists.ts +14 -2
- package/src/structure/serial-range.ts +14 -6
- package/src/structure/time-marks.ts +25 -0
- package/src/structure/version-mismatch.ts +41 -8
- package/src/structure/weekday.ts +14 -1
- package/src/table-cells.ts +2 -2
- package/src/term-form.ts +99 -0
- package/src/term-groups.ts +68 -0
- package/src/text-scope.ts +79 -0
- package/src/topic-clause.ts +96 -17
- package/src/unclosed-code-quote.ts +42 -0
- package/dist/honorific-group.d.ts +0 -8
- package/dist/honorific-group.d.ts.map +0 -1
- package/dist/honorific-group.js +0 -15
- package/dist/honorific-group.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Detector, Finding, Sentence, Span, Token } from "../plugin.ts";
|
|
2
|
+
import { QUOTATION_MARKS, isWithinAny, quotedSpans } from "../quoted-span.ts";
|
|
3
|
+
|
|
4
|
+
// 言語アダプタが語に付けた印(ら抜き・さ入れ)を、文の中の言葉として指す rule の形。
|
|
5
|
+
|
|
6
|
+
/** 印の付いた語が続く並び(「食べ」「れる」)を一つにまとめた、文書の中の範囲。 */
|
|
7
|
+
const markedRuns = (tokens: readonly Token[], isMarked: (token: Token) => boolean): Span[] =>
|
|
8
|
+
tokens.reduce<Span[]>((runs, token, index) => {
|
|
9
|
+
if (!isMarked(token)) return runs;
|
|
10
|
+
const last = runs.at(-1);
|
|
11
|
+
const previous = tokens[index - 1];
|
|
12
|
+
if (last !== undefined && previous !== undefined && isMarked(previous)) return [...runs.slice(0, -1), { start: last.start, end: token.span.end }];
|
|
13
|
+
return [...runs, token.span];
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
export type MarkedWord = { readonly written: string; readonly offset: number };
|
|
17
|
+
|
|
18
|
+
/** 文の中の印の付いた言葉。鉤括弧や引用符で引いた言葉(話した言葉をそのまま引いたもの)は数えない。 */
|
|
19
|
+
export const markedWordsIn = (sentence: Sentence, isMarked: (token: Token) => boolean): MarkedWord[] => {
|
|
20
|
+
const quoted = quotedSpans(sentence.text, QUOTATION_MARKS);
|
|
21
|
+
return markedRuns(sentence.tokens ?? [], isMarked)
|
|
22
|
+
.map((run) => ({ start: run.start - sentence.span.start, end: run.end - sentence.span.start }))
|
|
23
|
+
.filter((run) => !isWithinAny(quoted, run))
|
|
24
|
+
.map((run) => ({ written: sentence.text.slice(run.start, run.end), offset: sentence.span.start + run.start }));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** 印の付いた言葉を一つずつ指す detector。指摘の matched に書いたままの言葉を入れる。 */
|
|
28
|
+
export const markedWordDetector =
|
|
29
|
+
(isMarked: (token: Token) => boolean): Detector =>
|
|
30
|
+
(doc): Finding[] =>
|
|
31
|
+
doc.sentences.flatMap((sentence) =>
|
|
32
|
+
markedWordsIn(sentence, isMarked).map((word) => ({
|
|
33
|
+
rule: "",
|
|
34
|
+
severity: "warning",
|
|
35
|
+
line: 0,
|
|
36
|
+
column: 0,
|
|
37
|
+
quote: sentence.text.trim(),
|
|
38
|
+
values: { matched: word.written, offset: word.offset },
|
|
39
|
+
})),
|
|
40
|
+
);
|
|
@@ -46,13 +46,38 @@ export const isRunTogetherList = (text: string, words: readonly string[] = []):
|
|
|
46
46
|
return items.length >= MIN_INNER_ITEMS && median(items.map((item) => [...item].length)) > MAX_WORD_ITEM_CHARS;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
/** 片仮名と中黒の一続き(クリエイティブ・コモンズ・パブリック・ライセンス)。 */
|
|
50
|
+
const KATAKANA_RUN = /[\p{Script=Katakana}ー・]+/gu;
|
|
51
|
+
const MIN_NAME_WORDS = 2;
|
|
52
|
+
|
|
53
|
+
/** 一続きの、前後の中黒を外した片仮名の語。中黒が続く所(・・)があれば語の並びと読まない。 */
|
|
54
|
+
const chainOf = (run: string): string | undefined => {
|
|
55
|
+
const parts = run.split("・");
|
|
56
|
+
const first = parts.findIndex((part) => part !== "");
|
|
57
|
+
const last = parts.findLastIndex((part) => part !== "");
|
|
58
|
+
const words = first < 0 ? [] : parts.slice(first, last + 1);
|
|
59
|
+
return words.length >= MIN_NAME_WORDS && words.every((part) => part !== "") ? words.join("・") : undefined;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** 文書が同じ一続きを何度書けば、名前と見るか。一度きりの片仮名の並び(トマト・キュウリ・ナス)は並べた語。 */
|
|
63
|
+
const NAME_REPEATS = 3;
|
|
64
|
+
|
|
65
|
+
/** 文書が繰り返し書く片仮名の名前。中黒は名前の語の切れ目で、項目を並べてはいない。 */
|
|
66
|
+
const repeatedKatakanaNames = (source: string): string[] => {
|
|
67
|
+
const chains = [...source.matchAll(KATAKANA_RUN)].flatMap((match) => chainOf(match[0]) ?? []);
|
|
68
|
+
const counts = chains.reduce((byChain, chain) => byChain.set(chain, (byChain.get(chain) ?? 0) + 1), new Map<string, number>());
|
|
69
|
+
return [...counts].flatMap(([chain, count]) => (count >= NAME_REPEATS ? [chain] : []));
|
|
70
|
+
};
|
|
71
|
+
|
|
49
72
|
/**
|
|
50
73
|
* 中黒で並べると、どこまでが 1 つの項目か分からなくなる。
|
|
51
74
|
* 「企画・開発・運用・保守体制」は、保守体制が 1 つなのか保守と体制なのか読めない。
|
|
52
|
-
* 語彙表(nakaguro-word)の、中黒を含めて 1
|
|
75
|
+
* 語彙表(nakaguro-word)の、中黒を含めて 1 語の語(キャッシュ・フロー)と、文書が繰り返し書く片仮名の名前の中黒は並べていないので数えない。
|
|
53
76
|
*/
|
|
54
77
|
export const middleDot: Detector = (doc, options): Finding[] => {
|
|
55
|
-
const words = (options.lexicon ?? []).map((entry) => entry.pattern)
|
|
78
|
+
const words = [...(options.lexicon ?? []).map((entry) => entry.pattern), ...repeatedKatakanaNames(doc.source)].toSorted(
|
|
79
|
+
(left, right) => right.length - left.length,
|
|
80
|
+
);
|
|
56
81
|
// 表や箇条書きを変換が一続きにした文(年表の行、一行一項目の箇条書き)は、中黒が並べた語の切れ目か、項目の印か読めない。
|
|
57
82
|
return doc.sentences
|
|
58
83
|
.filter((sentence) => !isFlattenedTable(sentence.text) && !isRunTogetherList(sentence.text, words))
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { isLinkLabel } from "./link-label.ts";
|
|
1
2
|
import type { Detector, Finding, LexiconEntry, Paragraph, ProseDocument, Token } from "../plugin.ts";
|
|
2
3
|
import { formMinority } from "./form-minority.ts";
|
|
3
4
|
import { captionParagraphs, slotParagraphs } from "./final-period-captions.ts";
|
|
5
|
+
import { isHeaderField } from "./email-letter.ts";
|
|
4
6
|
|
|
5
7
|
// A paragraph whose last sentence stops without its closing mark, in a document whose other paragraphs end with one. It
|
|
6
8
|
// takes no side: a document that ends none of its paragraphs with the mark (slides, labels) is not reported. The marks
|
|
@@ -113,16 +115,32 @@ const marksOf = (lexicon: readonly LexiconEntry[]): PeriodMarks => ({
|
|
|
113
115
|
labels: lexicon.filter((entry) => entry.group === "label").map((entry) => entry.pattern),
|
|
114
116
|
});
|
|
115
117
|
|
|
118
|
+
/** A paragraph of one line opened by a header field (件名:…, Subject: …): a label and its value, not a sentence. Read from the source line, since the paragraph may start past the label. */
|
|
119
|
+
const isFieldLine = (source: string, paragraph: Paragraph, fields: readonly string[]): boolean => {
|
|
120
|
+
const line = source.slice(source.lastIndexOf("\n", paragraph.span.start - 1) + 1, paragraph.span.end).trim();
|
|
121
|
+
return !line.includes("\n") && isHeaderField(line, fields);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** A paragraph of one line that is the words of a link (Google Arts & Cultureで見る): it points somewhere, and is no sentence. */
|
|
125
|
+
const isLinkLine = (text: string, paragraph: Paragraph, endings: readonly string[]): boolean => {
|
|
126
|
+
const body = bodyOf(text, paragraph);
|
|
127
|
+
return !body.includes("\n") && isLinkLabel(body, endings);
|
|
128
|
+
};
|
|
129
|
+
|
|
116
130
|
export const missingFinalPeriod: Detector = (doc: ProseDocument, options): Finding[] => {
|
|
117
131
|
const text = doc.prose ?? doc.source;
|
|
118
132
|
const marks = marksOf(doc.lexicons["final-period"] ?? []);
|
|
133
|
+
const fields = (doc.lexicons["email-header-field"] ?? []).map((entry) => entry.pattern);
|
|
119
134
|
const captions = captionParagraphs(
|
|
120
135
|
text,
|
|
121
136
|
doc.sections,
|
|
122
137
|
slotParagraphs(text, doc.paragraphs, (line) => isClosed(line, marks.ends)),
|
|
123
138
|
);
|
|
139
|
+
const linkEndings = (doc.lexicons["link-label-ending"] ?? []).map((entry) => entry.pattern);
|
|
124
140
|
const ends = doc.paragraphs.flatMap((paragraph, index) =>
|
|
125
|
-
captions.has(index)
|
|
141
|
+
captions.has(index) || isFieldLine(doc.source, paragraph, fields) || isLinkLine(text, paragraph, linkEndings)
|
|
142
|
+
? []
|
|
143
|
+
: (paragraphEnd(text, paragraph, marks, doc.paragraphs[index + 1], doc.paragraphs[index - 1]) ?? []),
|
|
126
144
|
);
|
|
127
145
|
const minority = formMinority(ends, options.limit);
|
|
128
146
|
if (minority === undefined || minority.usual.form !== "closed") return [];
|
|
@@ -75,6 +75,32 @@ const isQuotedTitleCase = (found: Found, text: string): boolean => {
|
|
|
75
75
|
return (before.match(QUOTES)?.length ?? 0) % 2 === 1 && (after.match(QUOTES)?.length ?? 0) > 0;
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
+
const OPENING_QUOTE = /["“‘']$/u;
|
|
79
|
+
const CLOSING_QUOTE = /^[.,;:!?]?["”’']/u;
|
|
80
|
+
|
|
81
|
+
/** Whether the form fills a quotation by itself (the English translation—“Yellow Stone.”): the writer shows the spelling, not a slip. */
|
|
82
|
+
const isQuotedForm = (found: Found, text: string): boolean =>
|
|
83
|
+
OPENING_QUOTE.test(text.slice(Math.max(0, found.offset - 1), found.offset)) && CLOSING_QUOTE.test(text.slice(found.offset + found.name.length));
|
|
84
|
+
|
|
85
|
+
const WORD_BEFORE_FORM = /(?<!\p{L})(\p{L}+)\s+$/u;
|
|
86
|
+
const wordBefore = (text: string, offset: number): string => WORD_BEFORE_FORM.exec(text.slice(Math.max(0, offset - 20), offset))?.[1]?.toLowerCase() ?? "";
|
|
87
|
+
|
|
88
|
+
/** A capitalised word right after a name: the name stands before a noun it qualifies (White House Press Secretary). */
|
|
89
|
+
const BEFORE_NAME = /^ \p{Lu}/u;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Whether the usual form of several words is written only after a definite article (the White House), or before a noun it
|
|
93
|
+
* qualifies (White House Press Secretary), and the pointed form
|
|
94
|
+
* is those words run together without one (Whitehouse, a senator in a roll call): an institution and a person, two things.
|
|
95
|
+
*/
|
|
96
|
+
const isArticleNamePair = (found: Found, text: string, articles: readonly string[]): boolean => {
|
|
97
|
+
if (articles.length === 0 || !found.usual.includes(" ") || found.name.includes(" ")) return false;
|
|
98
|
+
if (found.name.toLowerCase() !== found.usual.replaceAll(" ", "").toLowerCase()) return false;
|
|
99
|
+
const usualPlaces = offsetsOf(text, found.usual);
|
|
100
|
+
const asName = (offset: number): boolean => articles.includes(wordBefore(text, offset)) || BEFORE_NAME.test(text.slice(offset + found.usual.length));
|
|
101
|
+
return usualPlaces.length > 0 && usualPlaces.every(asName) && !articles.includes(wordBefore(text, found.offset));
|
|
102
|
+
};
|
|
103
|
+
|
|
78
104
|
/** Whether a Japanese name is followed at once by an auxiliary that does not follow names (咲けり の けり): a verb stem, not a name. */
|
|
79
105
|
const isVerbStem = (found: Found, tokenAt: ReadonlyMap<number, Token>, copulas: ReadonlySet<string>): boolean => {
|
|
80
106
|
const next = tokenAt.get(found.offset + found.name.length);
|
|
@@ -94,6 +120,7 @@ type Reading = {
|
|
|
94
120
|
readonly ordinary: ReadonlySet<string>;
|
|
95
121
|
readonly countArticles: readonly string[];
|
|
96
122
|
readonly wrongMarks: readonly string[];
|
|
123
|
+
readonly definiteArticles: readonly string[];
|
|
97
124
|
};
|
|
98
125
|
|
|
99
126
|
/** Where a form is written, as written, inside a longer run of letters too (RSpecで). */
|
|
@@ -135,9 +162,16 @@ const isNearPair = (reading: Reading, found: Found): boolean => {
|
|
|
135
162
|
);
|
|
136
163
|
};
|
|
137
164
|
|
|
165
|
+
/** A case, width or punctuation variant that is not a slip: a form quoted by itself, a name after "the" beside its words run together, a contraction. */
|
|
166
|
+
const isSpellingPair = (reading: Reading, found: Found): boolean =>
|
|
167
|
+
isQuotedForm(found, reading.text) ||
|
|
168
|
+
isArticleNamePair(found, reading.text, reading.definiteArticles) ||
|
|
169
|
+
isContractionPair(found.name, found.usual, reading.text);
|
|
170
|
+
|
|
138
171
|
/**
|
|
139
172
|
* The finding is not two forms of one name: a one-letter variant that is two names (isNearPair), ・ listing two words, a
|
|
140
|
-
* direction and its inverse, a title quoted in capitals, a
|
|
173
|
+
* direction and its inverse, a title quoted in capitals, a form quoted by itself, a name after "the" beside the same words
|
|
174
|
+
* run together without it, a contraction printed with and without its apostrophe, a piece of
|
|
141
175
|
* a file name or URL, a form shown as wrong on purpose, a verb stem. ordinary holds the words read as names that are
|
|
142
176
|
* ordinary words in small letters (name-ordinary-word.ts).
|
|
143
177
|
*/
|
|
@@ -159,13 +193,14 @@ export const twoThingsIn = (
|
|
|
159
193
|
ordinary,
|
|
160
194
|
countArticles: patternsOf(doc, "name-count-article"),
|
|
161
195
|
wrongMarks: patternsOf(doc, "name-wrong-mark"),
|
|
196
|
+
definiteArticles: patternsOf(doc, "name-definite-article"),
|
|
162
197
|
};
|
|
163
198
|
return (found) =>
|
|
164
199
|
(found.kind === "near" && isNearPair(reading, found)) ||
|
|
165
200
|
isListedPair(found.name, found.usual) ||
|
|
166
201
|
(found.kind === "order" && isInverseOrder(found.name, found.usual, reading.directions)) ||
|
|
167
202
|
isQuotedTitleCase(found, reading.text) ||
|
|
168
|
-
(found.kind === "spelling" &&
|
|
203
|
+
(found.kind === "spelling" && isSpellingPair(reading, found)) ||
|
|
169
204
|
isInFileName(reading.text, found.offset, found.name.length) ||
|
|
170
205
|
isShownWrong(reading, found) ||
|
|
171
206
|
(found.kind === "reading" && isVerbStem(found, reading.tokenAt, reading.copulas));
|
|
@@ -7,9 +7,22 @@ import { cellsOf, tablesOf } from "../facts/table-facts.ts";
|
|
|
7
7
|
import { withoutEdgeMarks } from "../facts/trim-marks.ts";
|
|
8
8
|
import { proseAndTablesOf } from "../table-text.ts";
|
|
9
9
|
import { quoteAt } from "./structure-tree.ts";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
documentNetMismatch,
|
|
12
|
+
sectionAmounts,
|
|
13
|
+
sectionNetMismatch,
|
|
14
|
+
tableAmounts,
|
|
15
|
+
tableNetMismatches,
|
|
16
|
+
type DocumentLabels,
|
|
17
|
+
type LabelledLine,
|
|
18
|
+
type NetCell,
|
|
19
|
+
type NetIssue,
|
|
20
|
+
type NetWords,
|
|
21
|
+
} from "../structure/net-amount.ts";
|
|
11
22
|
|
|
12
23
|
const RULE = "net-amount-mismatch";
|
|
24
|
+
/** Lexicon: the names of a payslip read across the whole document when each is set out on its own (総支給額, 控除合計, 差引支給額). */
|
|
25
|
+
const DOCUMENT_LABEL = "net-amount-document-label";
|
|
13
26
|
const HEADING = /^#{1,6}[ \t]/u;
|
|
14
27
|
/** A line that is a label and an amount, after any list marker: "- 総支給額:117,380円", "Net pay: $1,396.41". */
|
|
15
28
|
const LIST_MARKER = /^[ \t]*(?:[-*+]|\d{1,3}[.)])?[ \t]*/u;
|
|
@@ -63,17 +76,41 @@ export const sectionsOf = (lines: readonly Line[], sourceLines: readonly Line[])
|
|
|
63
76
|
[[]],
|
|
64
77
|
);
|
|
65
78
|
|
|
79
|
+
const sectionLabelledLines = (lines: readonly Line[], source: string): LabelledLine[][] =>
|
|
80
|
+
sectionsOf(lines, linesOf(source)).map((section) => section.filter((line) => !line.text.includes("|")).flatMap(labelledLineOf));
|
|
81
|
+
|
|
66
82
|
const sectionIssues = (lines: readonly Line[], source: string, words: NetWords): NetIssue[] =>
|
|
67
|
-
|
|
68
|
-
const issue = sectionNetMismatch(section
|
|
83
|
+
sectionLabelledLines(lines, source).flatMap((section) => {
|
|
84
|
+
const issue = sectionNetMismatch(section, words);
|
|
69
85
|
return issue === undefined ? [] : [issue];
|
|
70
86
|
});
|
|
71
87
|
|
|
88
|
+
const documentLabelsOf = (doc: ProseDocument): DocumentLabels => ({
|
|
89
|
+
gross: patternsOf(doc, DOCUMENT_LABEL, "gross"),
|
|
90
|
+
deduction: patternsOf(doc, DOCUMENT_LABEL, "deduction"),
|
|
91
|
+
net: patternsOf(doc, DOCUMENT_LABEL, "net"),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
/** The three names of a payslip set out in sections or tables of their own, read across the whole document. */
|
|
95
|
+
const documentIssues = (doc: ProseDocument, lines: readonly Line[], words: NetWords): NetIssue[] => {
|
|
96
|
+
const tables = tablesOf(lines).map((table) => [plainCellsOf(table.header), ...table.rows.map(plainCellsOf)]);
|
|
97
|
+
const sections = sectionLabelledLines(lines, doc.source);
|
|
98
|
+
const amounts = [
|
|
99
|
+
...tables.flatMap(([header = [], ...rows]) => tableAmounts(header, rows, words)),
|
|
100
|
+
...sections.flatMap((section) => sectionAmounts(section, words)),
|
|
101
|
+
];
|
|
102
|
+
const labelTexts = [...tables.flat(2).map((cell) => cell.text), ...sections.flat().map((line) => line.label)];
|
|
103
|
+
const issue = documentNetMismatch(amounts, labelTexts, documentLabelsOf(doc), words);
|
|
104
|
+
return issue === undefined ? [] : [issue];
|
|
105
|
+
};
|
|
106
|
+
|
|
72
107
|
export const netAmountMismatch: Detector = (doc): Finding[] => {
|
|
73
108
|
const words = wordsOf(doc);
|
|
74
109
|
if (words.labels.gross.length === 0 || words.labels.deduction.length + words.labels["deduction-part"].length === 0) return [];
|
|
75
110
|
const lines = linesOf(proseAndTablesOf(doc));
|
|
76
|
-
|
|
111
|
+
const issues = [...tableIssues(lines, words), ...sectionIssues(lines, doc.source, words), ...documentIssues(doc, lines, words)];
|
|
112
|
+
return issues
|
|
113
|
+
.filter((issue, index) => issues.findIndex((other) => other.offset === issue.offset) === index)
|
|
77
114
|
.toSorted((left, right) => left.offset - right.offset)
|
|
78
115
|
.map((issue) => ({
|
|
79
116
|
rule: RULE,
|
|
@@ -32,17 +32,34 @@ const phrasesIn = (sentence: Sentence, source: string, phrases: Lexicon): Hidden
|
|
|
32
32
|
})),
|
|
33
33
|
);
|
|
34
34
|
|
|
35
|
+
const touches = (left: Token | undefined, right: Token | undefined): boolean => left !== undefined && right !== undefined && left.span.end === right.span.start;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The first token of the compound noun the verbal noun ends: 塗り + 直し is 塗り直し, and 直しする is not a verb to write.
|
|
39
|
+
* Nouns written straight before it, with no space, are one word.
|
|
40
|
+
*/
|
|
41
|
+
const compoundStart = (tokens: readonly Token[], at: number): number =>
|
|
42
|
+
tokens[at - 1]?.pos === "NOUN" && touches(tokens[at - 1], tokens[at]) ? compoundStart(tokens, at - 1) : at;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The verbal noun is an event noun, or ends a compound that is one as written (計画運休, whose する form is not written, even
|
|
46
|
+
* where the tagger leaves 計画 out of the compound).
|
|
47
|
+
*/
|
|
48
|
+
const isEventNoun = (source: string, noun: Token, eventNouns: ReadonlySet<string>): boolean =>
|
|
49
|
+
eventNouns.has(noun.surface) || [...eventNouns].some((word) => word.length > noun.surface.length && source.startsWith(word, noun.span.end - word.length));
|
|
50
|
+
|
|
35
51
|
/**
|
|
36
|
-
* A carrying verb right after a verbal noun: 調査 +
|
|
52
|
+
* A carrying verb right after a verbal noun: 調査 + を実施した, the noun read with the compound it ends (塗り直し). Both sides are named in the dictionary form, the noun and the
|
|
37
53
|
* entry (調査を実施する), and the verb to write is the noun and the entry's instead_of (調査 + する).
|
|
38
54
|
*/
|
|
39
|
-
const lightVerbsIn = (sentence: Sentence, lightVerbs: Lexicon, eventNouns: ReadonlySet<string>): Hidden[] => {
|
|
55
|
+
const lightVerbsIn = (sentence: Sentence, source: string, lightVerbs: Lexicon, eventNouns: ReadonlySet<string>): Hidden[] => {
|
|
40
56
|
const tokens = sentence.tokens ?? [];
|
|
41
57
|
return lightVerbs.flatMap((entry) =>
|
|
42
58
|
entryRanges(sentence, entry).flatMap((range): Hidden[] => {
|
|
43
59
|
const noun = tokens[range.start - 1];
|
|
44
|
-
if (!isVerbalNoun(noun) ||
|
|
45
|
-
|
|
60
|
+
if (!isVerbalNoun(noun) || isEventNoun(source, noun, eventNouns)) return [];
|
|
61
|
+
const compound = source.slice(tokens[compoundStart(tokens, range.start - 1)]?.span.start ?? noun.span.start, noun.span.end);
|
|
62
|
+
return [{ sentence, offset: noun.span.start, matched: `${compound}${entry.pattern}`, preferred: `${compound}${entry.instead_of ?? ""}` }];
|
|
46
63
|
}),
|
|
47
64
|
);
|
|
48
65
|
};
|
|
@@ -53,7 +70,7 @@ export const hiddenVerbs = (doc: Pick<ProseDocument, "sentences" | "source" | "l
|
|
|
53
70
|
return doc.sentences
|
|
54
71
|
.flatMap((sentence) => [
|
|
55
72
|
...phrasesIn(sentence, doc.source, doc.lexicons[PHRASES] ?? []),
|
|
56
|
-
...lightVerbsIn(sentence, doc.lexicons[LIGHT_VERBS] ?? [], eventNouns),
|
|
73
|
+
...lightVerbsIn(sentence, doc.source, doc.lexicons[LIGHT_VERBS] ?? [], eventNouns),
|
|
57
74
|
])
|
|
58
75
|
.toSorted((left, right) => left.offset - right.offset);
|
|
59
76
|
};
|
|
@@ -24,6 +24,8 @@ export type NumberWords = {
|
|
|
24
24
|
readonly nameWords: readonly string[];
|
|
25
25
|
/** Kanji counts read the native way (二通り, ふたとおり): written in kanji whatever the document's style for counts. */
|
|
26
26
|
readonly nativeCounts: readonly string[];
|
|
27
|
+
/** Words that make a number and its counter the name of a thing (十円玉, 千円札): written either way, not a count. */
|
|
28
|
+
readonly nameSuffixes: readonly string[];
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
const alternation = (words: readonly string[]): string =>
|
|
@@ -78,11 +80,16 @@ const isInsideWord = (written: string, offset: number, tokens: readonly Token[])
|
|
|
78
80
|
return word.surface.slice(written.length) !== ORDINAL_SUFFIX;
|
|
79
81
|
};
|
|
80
82
|
|
|
83
|
+
/** A number and counter that a name word follows (十円玉, 100円玉, 五円硬貨): the name of a coin or a note, not a count of yen. */
|
|
84
|
+
const namesThing = (text: string, end: number, words: NumberWords): boolean =>
|
|
85
|
+
words.nameSuffixes.some((suffix) => suffix !== "" && text.startsWith(suffix, end));
|
|
86
|
+
|
|
81
87
|
const countMarks = (text: string, base: number, words: NumberWords, tokens: readonly Token[]): NumberMark[] => {
|
|
82
88
|
const pattern = countPattern(words);
|
|
83
89
|
if (pattern === undefined) return [];
|
|
84
90
|
return [...text.matchAll(pattern)].flatMap((match): NumberMark[] => {
|
|
85
91
|
const [written, digits, kanji] = match;
|
|
92
|
+
if (namesThing(text, match.index + written.length, words)) return [];
|
|
86
93
|
if (kanji !== undefined && (isIdiomNumeral(kanji) || words.nativeCounts.includes(written) || isInsideWord(written, base + match.index, tokens))) return [];
|
|
87
94
|
if (isBeforeLongerWord(digits ?? kanji ?? "", written, base + match.index, tokens)) return [];
|
|
88
95
|
return [{ kind: "count", style: digits === undefined ? "kanji" : "digits", written, offset: base + match.index }];
|
|
@@ -274,6 +281,7 @@ const wordsOf = (doc: ProseDocument): NumberWords => {
|
|
|
274
281
|
figureNouns: patterns("figure-noun"),
|
|
275
282
|
nameWords: patterns("number-name-word"),
|
|
276
283
|
nativeCounts: patterns("numeral-native-count"),
|
|
284
|
+
nameSuffixes: patterns("numeral-name-suffix"),
|
|
277
285
|
};
|
|
278
286
|
};
|
|
279
287
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Detector, Finding, Lexicon } from "../plugin.ts";
|
|
2
2
|
import { escapeRegExp } from "../orthography.ts";
|
|
3
|
-
import { quoteAround } from "./quote-around.ts";
|
|
3
|
+
import { quoteAround, sentenceQuoteAt } from "./quote-around.ts";
|
|
4
4
|
|
|
5
5
|
// 数と序数の字が合わない所(3th、22th、11st)。どの数の終わりにどの字が付くかは語彙表 ordinal-suffix が言う。
|
|
6
6
|
|
|
@@ -34,7 +34,7 @@ export const ordinalSuffix: Detector = (doc): Finding[] => {
|
|
|
34
34
|
severity: "warning",
|
|
35
35
|
line: 0,
|
|
36
36
|
column: 0,
|
|
37
|
-
quote: quoteAround(text, slip.offset, slip.offset + slip.written.length),
|
|
37
|
+
quote: sentenceQuoteAt(doc.sentences, slip.offset) ?? quoteAround(text, slip.offset, slip.offset + slip.written.length),
|
|
38
38
|
values: { written: slip.written, expected: `${slip.number}${slip.expected[0] ?? ""}`, offset: slip.offset },
|
|
39
39
|
}));
|
|
40
40
|
};
|
|
@@ -20,6 +20,19 @@ export const isNarrowedUse = (tokens: readonly Token[], at: number, pointers: re
|
|
|
20
20
|
return !pointers.some((pointer) => pointer.toLowerCase() === before.surface.toLowerCase());
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
const COORDINATORS = new Set(["and", "or"]);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The use is one of two words joined by and / or in front of a noun they share (customer and supplier information): it
|
|
27
|
+
* modifies that noun beside an ordinary word of its kind, so it is the ordinary word too. last is the use's last token.
|
|
28
|
+
*/
|
|
29
|
+
export const isCoordinatedModifier = (tokens: readonly Token[], at: number, last: number): boolean => {
|
|
30
|
+
const [partner, joiner, head] = [tokens[at - 2], tokens[at - 1], tokens[last + 1]];
|
|
31
|
+
if (partner === undefined || joiner === undefined || head === undefined) return false;
|
|
32
|
+
const lowerWord = NARROWING.has(partner.pos) && LOWER_START.test(partner.surface) && LATIN.test(partner.surface);
|
|
33
|
+
return COORDINATORS.has(joiner.surface.toLowerCase()) && lowerWord && head.pos === "NOUN" && LOWER_START.test(head.surface);
|
|
34
|
+
};
|
|
35
|
+
|
|
23
36
|
/**
|
|
24
37
|
* A partitive picks some out of the kind: "some of these terms", "many of the services". The defined term names one
|
|
25
38
|
* thing or one set, so items picked from it are the ordinary word.
|
|
@@ -114,6 +114,15 @@ export const isOrganisationRun = (tokens: readonly Token[], covering: readonly n
|
|
|
114
114
|
return head > 0 || formBefore ? segments >= 1 : segments >= 2;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
+
/** 連なりのすぐ後ろの、中黒で続く語の並び(・適応小委員会、・学位授与機構)。 */
|
|
118
|
+
const DOTTED_TAIL = /^(?:・[一-鿿ァ-ヶー]+)+/u;
|
|
119
|
+
|
|
120
|
+
/** 連なりの後ろ(next)が中黒で続き、最後の語が組織の語で閉じるか(社会保障審議会企業年金・個人年金部会の「・個人年金部会」)。 */
|
|
121
|
+
export const closesAfterDot = (next: string, units: readonly string[]): boolean => {
|
|
122
|
+
const last = DOTTED_TAIL.exec(next)?.[0].split("・").at(-1);
|
|
123
|
+
return last !== undefined && units.some((unit) => last.endsWith(unit));
|
|
124
|
+
};
|
|
125
|
+
|
|
117
126
|
/**
|
|
118
127
|
* 連なりの語(covering)が、中黒の後ろへ続いて組織の語で閉じる名前(中央環境審議会地球環境部会気候変動影響評価・適応小委員会)の前半か。
|
|
119
128
|
* 前半は、法人格か地名・固有名詞で始まるか、組織の語で閉じる区切りで始まるか、前に法人格か組織の区切りが立つ(formBefore)。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { dropsOkurigana, kanjiSkeleton } from "../kana-spelling.ts";
|
|
2
|
+
|
|
3
|
+
type KanjiWord = { readonly spelling: string; readonly compoundHead?: boolean; readonly kanaStem?: boolean; readonly compoundTail?: string };
|
|
4
|
+
|
|
5
|
+
const ONE_KANJI = /^\p{Script=Han}$/u;
|
|
6
|
+
|
|
7
|
+
export const isOneKanjiElement = (word: KanjiWord, spellings: readonly string[]): boolean =>
|
|
8
|
+
word.compoundHead === true && ONE_KANJI.test(word.spelling) && dropsOkurigana(word.spelling, spellings);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A verb's stem in kana read as its noun (つき of つきたて) meets only a kanji spelling that ends in the same kana, as the
|
|
12
|
+
* verb's noun does (付き): a kanji noun of the same sound that ends in its kanji (月) is another word.
|
|
13
|
+
*/
|
|
14
|
+
export const isStemWithoutItsKanji = (word: KanjiWord, spellings: readonly string[], skeletonOf: (spelling: string) => string): boolean =>
|
|
15
|
+
word.kanaStem === true && !spellings.some((spelling) => skeletonOf(spelling) !== "" && spelling.endsWith(word.spelling.slice(-1)));
|
|
16
|
+
|
|
17
|
+
/** Okurigana between two kanji (the し of 申し込み), which the general rules keep and official Japanese drops (申込み). */
|
|
18
|
+
const KANA_BETWEEN_KANJI = /\p{Script=Han}[ぁ-ゖ]+\p{Script=Han}/u;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A compound head in kanji alone (申込 of 申込締切, 申込書) beside spellings that keep okurigana between its kanji
|
|
22
|
+
* (申し込み画面): the general rules write the word that way and a set compound in kanji alone, so the two are one
|
|
23
|
+
* convention. It is still compared where the document writes the word in kanji alone outside a compound (休業の申出 beside
|
|
24
|
+
* 申し出期限), writes it the official way with okurigana only at the end (取扱い方法 beside 事務取扱担当者), or writes the
|
|
25
|
+
* same compound both ways (申込方法 and 申し込み方法).
|
|
26
|
+
*/
|
|
27
|
+
export const isSetCompoundBesideGeneralRules = (word: KanjiWord, group: readonly KanjiWord[]): boolean => {
|
|
28
|
+
if (word.compoundTail === undefined) return false;
|
|
29
|
+
const others = group.filter((other) => other.spelling !== word.spelling && kanjiSkeleton(other.spelling) === word.spelling);
|
|
30
|
+
if (others.length === 0 || !others.every((other) => KANA_BETWEEN_KANJI.test(other.spelling))) return false;
|
|
31
|
+
const alone = group.some((other) => other.spelling === word.spelling && other.compoundTail === undefined);
|
|
32
|
+
return !alone && !others.some((other) => other.compoundTail === word.compoundTail);
|
|
33
|
+
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import type { ProseDocument, Sentence, Span } from "../plugin.ts";
|
|
5
5
|
import { externalLinkTitleSpans } from "../link-title.ts";
|
|
6
|
+
import { runInTitleSpans } from "../run-in-title.ts";
|
|
6
7
|
import { QUOTATION_MARKS, isWithinAny, quotedSpans } from "../quoted-span.ts";
|
|
7
8
|
import { singleQuotedSpans } from "../single-quoted-span.ts";
|
|
8
9
|
import { nameSpans, touchesAny } from "../team-names.ts";
|
|
@@ -64,7 +65,7 @@ export type Names = {
|
|
|
64
65
|
export const namesOf = (doc: ProseDocument, genre: string | undefined): Names => ({
|
|
65
66
|
team: doc.names ?? [],
|
|
66
67
|
companyForms: allPatternsOf(doc, COMPANY_FORM),
|
|
67
|
-
linkTitles: externalLinkTitleSpans(doc.source, doc.links),
|
|
68
|
+
linkTitles: [...externalLinkTitleSpans(doc.source, doc.links), ...runInTitleSpans(doc.source)],
|
|
68
69
|
singleQuoted: singleQuotedSpans(doc.source),
|
|
69
70
|
mentions: allPatternsOf(doc, SPELLING_MENTION),
|
|
70
71
|
referenceLists: referenceListSpans(doc.source, allPatternsOf(doc, REFERENCE_LIST_HEADING)),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Sentence } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
const HASHTAG_MARK = "#";
|
|
4
|
+
const WORD_CHARACTER = /[\p{L}\p{N}_]/u;
|
|
5
|
+
|
|
6
|
+
/** A word written as a hashtag (#vimconf): spelled as the service matches it, like an address. */
|
|
7
|
+
export const isHashtag = (text: string, start: number): boolean => text.charAt(start - 1) === HASHTAG_MARK && !WORD_CHARACTER.test(text.charAt(start - 2));
|
|
8
|
+
|
|
9
|
+
/** A link's brackets and where it goes (`[`, `](#contentType)`, `][ref]`). The prose hides them outside tables; a cell keeps the Markdown as written. */
|
|
10
|
+
const LINK_CHROME = /\]\([^)]*\)|\]\[[^\]]*\]|\[/gu;
|
|
11
|
+
|
|
12
|
+
export const withoutLinkChrome = (text: string): string => text.replaceAll(LINK_CHROME, (chrome) => " ".repeat(chrome.length));
|
|
13
|
+
|
|
14
|
+
const INLINE_CODE = /`[^`]*`/gu;
|
|
15
|
+
|
|
16
|
+
/** A heading with its code blanked out (`kubectl create configmap`): the body's prose masks code, a heading's text keeps it. */
|
|
17
|
+
export const withoutInlineCode = (sentence: Sentence): Sentence => ({
|
|
18
|
+
...sentence,
|
|
19
|
+
text: sentence.text.replaceAll(INLINE_CODE, (code) => " ".repeat(code.length)),
|
|
20
|
+
});
|