chaffjs 0.27.1 → 0.29.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.md +2 -1
- package/dist/ai-score/of-document.d.ts.map +1 -1
- package/dist/ai-score/of-document.js +23 -14
- package/dist/ai-score/of-document.js.map +1 -1
- package/dist/ai-score/render.d.ts.map +1 -1
- package/dist/ai-score/render.js +13 -4
- package/dist/ai-score/render.js.map +1 -1
- package/dist/ai-score/score.d.ts +16 -1
- package/dist/ai-score/score.d.ts.map +1 -1
- package/dist/ai-score/score.js +15 -3
- package/dist/ai-score/score.js.map +1 -1
- package/dist/ai-score/signals.d.ts +2 -4
- package/dist/ai-score/signals.d.ts.map +1 -1
- package/dist/ai-score/signals.js +11 -2
- package/dist/ai-score/signals.js.map +1 -1
- package/dist/ai-score/text.d.ts +2 -0
- package/dist/ai-score/text.d.ts.map +1 -1
- package/dist/ai-score/text.js +4 -2
- package/dist/ai-score/text.js.map +1 -1
- package/dist/announced-count.d.ts +2 -0
- package/dist/announced-count.d.ts.map +1 -1
- package/dist/announced-count.js +14 -7
- package/dist/announced-count.js.map +1 -1
- package/dist/check-source.d.ts +3 -1
- package/dist/check-source.d.ts.map +1 -1
- package/dist/check-source.js +3 -1
- package/dist/check-source.js.map +1 -1
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +42 -18
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/cite-claims.d.ts +36 -0
- package/dist/commands/cite-claims.d.ts.map +1 -0
- package/dist/commands/cite-claims.js +81 -0
- package/dist/commands/cite-claims.js.map +1 -0
- package/dist/commands/cite-page.d.ts +14 -0
- package/dist/commands/cite-page.d.ts.map +1 -0
- package/dist/commands/cite-page.js +47 -0
- package/dist/commands/cite-page.js.map +1 -0
- package/dist/commands/cite-scaffold.d.ts +16 -0
- package/dist/commands/cite-scaffold.d.ts.map +1 -0
- package/dist/commands/cite-scaffold.js +21 -0
- package/dist/commands/cite-scaffold.js.map +1 -0
- package/dist/commands/cite.d.ts +3 -12
- package/dist/commands/cite.d.ts.map +1 -1
- package/dist/commands/cite.js +110 -51
- package/dist/commands/cite.js.map +1 -1
- package/dist/company-names.d.ts +34 -0
- package/dist/company-names.d.ts.map +1 -0
- package/dist/company-names.js +158 -0
- package/dist/company-names.js.map +1 -0
- package/dist/default-values.d.ts +17 -0
- package/dist/default-values.d.ts.map +1 -0
- package/dist/default-values.js +134 -0
- package/dist/default-values.js.map +1 -0
- package/dist/deprecated-use.d.ts +17 -0
- package/dist/deprecated-use.d.ts.map +1 -0
- package/dist/deprecated-use.js +95 -0
- package/dist/deprecated-use.js.map +1 -0
- package/dist/derived/number-word-counts.d.ts +10 -0
- package/dist/derived/number-word-counts.d.ts.map +1 -0
- package/dist/derived/number-word-counts.js +21 -0
- package/dist/derived/number-word-counts.js.map +1 -0
- package/dist/derived/stays.d.ts +43 -0
- package/dist/derived/stays.d.ts.map +1 -0
- package/dist/derived/stays.js +105 -0
- package/dist/derived/stays.js.map +1 -0
- package/dist/detectors/acronym-context.d.ts +2 -2
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +6 -0
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/address-word.d.ts +3 -0
- package/dist/detectors/address-word.d.ts.map +1 -0
- package/dist/detectors/address-word.js +7 -0
- package/dist/detectors/address-word.js.map +1 -0
- package/dist/detectors/agreement-slip.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.js +4 -1
- package/dist/detectors/agreement-slip.js.map +1 -1
- package/dist/detectors/ai-phrasing.d.ts +0 -4
- package/dist/detectors/ai-phrasing.d.ts.map +1 -1
- package/dist/detectors/ai-phrasing.js +5 -1
- package/dist/detectors/ai-phrasing.js.map +1 -1
- package/dist/detectors/amount-range.d.ts +3 -0
- package/dist/detectors/amount-range.d.ts.map +1 -0
- package/dist/detectors/amount-range.js +38 -0
- package/dist/detectors/amount-range.js.map +1 -0
- package/dist/detectors/amount-scale.d.ts +8 -0
- package/dist/detectors/amount-scale.d.ts.map +1 -0
- package/dist/detectors/amount-scale.js +74 -0
- package/dist/detectors/amount-scale.js.map +1 -0
- package/dist/detectors/announced-count.d.ts +1 -1
- package/dist/detectors/announced-count.d.ts.map +1 -1
- package/dist/detectors/announced-count.js +18 -3
- package/dist/detectors/announced-count.js.map +1 -1
- package/dist/detectors/bare-comparative.d.ts.map +1 -1
- package/dist/detectors/bare-comparative.js +4 -1
- package/dist/detectors/bare-comparative.js.map +1 -1
- package/dist/detectors/block-quotation.d.ts +13 -0
- package/dist/detectors/block-quotation.d.ts.map +1 -0
- package/dist/detectors/block-quotation.js +86 -0
- package/dist/detectors/block-quotation.js.map +1 -0
- package/dist/detectors/bracket-label.d.ts +10 -0
- package/dist/detectors/bracket-label.d.ts.map +1 -0
- package/dist/detectors/bracket-label.js +51 -0
- package/dist/detectors/bracket-label.js.map +1 -0
- package/dist/detectors/change-rate.d.ts.map +1 -1
- package/dist/detectors/change-rate.js +12 -1
- package/dist/detectors/change-rate.js.map +1 -1
- package/dist/detectors/citation-entry.d.ts +5 -0
- package/dist/detectors/citation-entry.d.ts.map +1 -1
- package/dist/detectors/citation-entry.js +19 -5
- package/dist/detectors/citation-entry.js.map +1 -1
- package/dist/detectors/code-before.d.ts +6 -0
- package/dist/detectors/code-before.d.ts.map +1 -0
- package/dist/detectors/code-before.js +15 -0
- package/dist/detectors/code-before.js.map +1 -0
- package/dist/detectors/connective-hierarchy.d.ts +11 -1
- package/dist/detectors/connective-hierarchy.d.ts.map +1 -1
- package/dist/detectors/connective-hierarchy.js +26 -6
- package/dist/detectors/connective-hierarchy.js.map +1 -1
- package/dist/detectors/currency-notation.d.ts +3 -1
- package/dist/detectors/currency-notation.d.ts.map +1 -1
- package/dist/detectors/currency-notation.js +4 -3
- package/dist/detectors/currency-notation.js.map +1 -1
- package/dist/detectors/date-outside-period.d.ts +4 -0
- package/dist/detectors/date-outside-period.d.ts.map +1 -0
- package/dist/detectors/date-outside-period.js +34 -0
- package/dist/detectors/date-outside-period.js.map +1 -0
- package/dist/detectors/default-values.d.ts +3 -0
- package/dist/detectors/default-values.d.ts.map +1 -0
- package/dist/detectors/default-values.js +14 -0
- package/dist/detectors/default-values.js.map +1 -0
- package/dist/detectors/defined-term-form.d.ts +6 -2
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +72 -12
- 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 +8 -1
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/deprecated-use.d.ts +3 -0
- package/dist/detectors/deprecated-use.d.ts.map +1 -0
- package/dist/detectors/deprecated-use.js +14 -0
- package/dist/detectors/deprecated-use.js.map +1 -0
- package/dist/detectors/derived-numbers.d.ts +1 -1
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +79 -16
- package/dist/detectors/derived-numbers.js.map +1 -1
- package/dist/detectors/document-shape.d.ts +1 -0
- 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/due-date.d.ts +3 -0
- package/dist/detectors/due-date.d.ts.map +1 -0
- package/dist/detectors/due-date.js +38 -0
- package/dist/detectors/due-date.js.map +1 -0
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +17 -9
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/fact-consistency.d.ts.map +1 -1
- package/dist/detectors/fact-consistency.js +89 -2
- package/dist/detectors/fact-consistency.js.map +1 -1
- package/dist/detectors/heading-echo.d.ts.map +1 -1
- package/dist/detectors/heading-echo.js +10 -1
- package/dist/detectors/heading-echo.js.map +1 -1
- package/dist/detectors/kana-function-word.d.ts +12 -0
- package/dist/detectors/kana-function-word.d.ts.map +1 -0
- package/dist/detectors/kana-function-word.js +59 -0
- package/dist/detectors/kana-function-word.js.map +1 -0
- package/dist/detectors/line-amount.d.ts +3 -0
- package/dist/detectors/line-amount.d.ts.map +1 -0
- package/dist/detectors/line-amount.js +22 -0
- package/dist/detectors/line-amount.js.map +1 -0
- package/dist/detectors/location-pointer.d.ts +6 -0
- package/dist/detectors/location-pointer.d.ts.map +1 -0
- package/dist/detectors/location-pointer.js +22 -0
- package/dist/detectors/location-pointer.js.map +1 -0
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +13 -1
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/nado-closed-list.d.ts +3 -0
- package/dist/detectors/nado-closed-list.d.ts.map +1 -0
- package/dist/detectors/nado-closed-list.js +21 -0
- package/dist/detectors/nado-closed-list.js.map +1 -0
- package/dist/detectors/name-variant.d.ts.map +1 -1
- package/dist/detectors/name-variant.js +92 -10
- package/dist/detectors/name-variant.js.map +1 -1
- package/dist/detectors/next-word.d.ts.map +1 -1
- package/dist/detectors/next-word.js +41 -8
- package/dist/detectors/next-word.js.map +1 -1
- package/dist/detectors/number-word-figure.d.ts +5 -0
- package/dist/detectors/number-word-figure.d.ts.map +1 -0
- package/dist/detectors/number-word-figure.js +32 -0
- package/dist/detectors/number-word-figure.js.map +1 -0
- package/dist/detectors/obligation-without-deadline.d.ts +39 -0
- package/dist/detectors/obligation-without-deadline.d.ts.map +1 -0
- package/dist/detectors/obligation-without-deadline.js +148 -0
- package/dist/detectors/obligation-without-deadline.js.map +1 -0
- package/dist/detectors/open-end-names.d.ts +23 -0
- package/dist/detectors/open-end-names.d.ts.map +1 -0
- package/dist/detectors/open-end-names.js +95 -0
- package/dist/detectors/open-end-names.js.map +1 -0
- package/dist/detectors/ordinal-run-gaps.d.ts +8 -0
- package/dist/detectors/ordinal-run-gaps.d.ts.map +1 -0
- package/dist/detectors/ordinal-run-gaps.js +80 -0
- package/dist/detectors/ordinal-run-gaps.js.map +1 -0
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +26 -9
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +5 -0
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/parameter-table.d.ts +3 -0
- package/dist/detectors/parameter-table.d.ts.map +1 -0
- package/dist/detectors/parameter-table.js +16 -0
- package/dist/detectors/parameter-table.js.map +1 -0
- package/dist/detectors/phone-number-variant.d.ts +3 -0
- package/dist/detectors/phone-number-variant.d.ts.map +1 -0
- package/dist/detectors/phone-number-variant.js +18 -0
- package/dist/detectors/phone-number-variant.js.map +1 -0
- package/dist/detectors/prerequisite-order.d.ts +3 -0
- package/dist/detectors/prerequisite-order.d.ts.map +1 -0
- package/dist/detectors/prerequisite-order.js +30 -0
- package/dist/detectors/prerequisite-order.js.map +1 -0
- package/dist/detectors/quote-unnamed-speaker.d.ts +3 -0
- package/dist/detectors/quote-unnamed-speaker.d.ts.map +1 -0
- package/dist/detectors/quote-unnamed-speaker.js +18 -0
- package/dist/detectors/quote-unnamed-speaker.js.map +1 -0
- package/dist/detectors/quote-without-source.d.ts +12 -2
- package/dist/detectors/quote-without-source.d.ts.map +1 -1
- package/dist/detectors/quote-without-source.js +45 -11
- package/dist/detectors/quote-without-source.js.map +1 -1
- package/dist/detectors/registry/amount-range.d.ts +3 -0
- package/dist/detectors/registry/amount-range.d.ts.map +1 -0
- package/dist/detectors/registry/amount-range.js +3 -0
- package/dist/detectors/registry/amount-range.js.map +1 -0
- package/dist/detectors/registry/amount-scale.d.ts +3 -0
- package/dist/detectors/registry/amount-scale.d.ts.map +1 -0
- package/dist/detectors/registry/amount-scale.js +3 -0
- package/dist/detectors/registry/amount-scale.js.map +1 -0
- package/dist/detectors/registry/arrival-before-departure.d.ts +3 -0
- package/dist/detectors/registry/arrival-before-departure.d.ts.map +1 -0
- package/dist/detectors/registry/arrival-before-departure.js +3 -0
- package/dist/detectors/registry/arrival-before-departure.js.map +1 -0
- package/dist/detectors/registry/date-outside-period.d.ts +3 -0
- package/dist/detectors/registry/date-outside-period.d.ts.map +1 -0
- package/dist/detectors/registry/date-outside-period.js +3 -0
- package/dist/detectors/registry/date-outside-period.js.map +1 -0
- package/dist/detectors/registry/default-values.d.ts +3 -0
- package/dist/detectors/registry/default-values.d.ts.map +1 -0
- package/dist/detectors/registry/default-values.js +3 -0
- package/dist/detectors/registry/default-values.js.map +1 -0
- package/dist/detectors/registry/deprecated-use.d.ts +3 -0
- package/dist/detectors/registry/deprecated-use.d.ts.map +1 -0
- package/dist/detectors/registry/deprecated-use.js +3 -0
- package/dist/detectors/registry/deprecated-use.js.map +1 -0
- package/dist/detectors/registry/due-date.d.ts +3 -0
- package/dist/detectors/registry/due-date.d.ts.map +1 -0
- package/dist/detectors/registry/due-date.js +3 -0
- package/dist/detectors/registry/due-date.js.map +1 -0
- package/dist/detectors/registry/kana-function-word.d.ts +3 -0
- package/dist/detectors/registry/kana-function-word.d.ts.map +1 -0
- package/dist/detectors/registry/kana-function-word.js +3 -0
- package/dist/detectors/registry/kana-function-word.js.map +1 -0
- package/dist/detectors/registry/line-amount.d.ts +3 -0
- package/dist/detectors/registry/line-amount.d.ts.map +1 -0
- package/dist/detectors/registry/line-amount.js +3 -0
- package/dist/detectors/registry/line-amount.js.map +1 -0
- package/dist/detectors/registry/nado-closed-list.d.ts +3 -0
- package/dist/detectors/registry/nado-closed-list.d.ts.map +1 -0
- package/dist/detectors/registry/nado-closed-list.js +3 -0
- package/dist/detectors/registry/nado-closed-list.js.map +1 -0
- package/dist/detectors/registry/number-word-figure.d.ts +3 -0
- package/dist/detectors/registry/number-word-figure.d.ts.map +1 -0
- package/dist/detectors/registry/number-word-figure.js +3 -0
- package/dist/detectors/registry/number-word-figure.js.map +1 -0
- package/dist/detectors/registry/obligation-without-deadline.d.ts +3 -0
- package/dist/detectors/registry/obligation-without-deadline.d.ts.map +1 -0
- package/dist/detectors/registry/obligation-without-deadline.js +3 -0
- package/dist/detectors/registry/obligation-without-deadline.js.map +1 -0
- package/dist/detectors/registry/parameter-table.d.ts +3 -0
- package/dist/detectors/registry/parameter-table.d.ts.map +1 -0
- package/dist/detectors/registry/parameter-table.js +3 -0
- package/dist/detectors/registry/parameter-table.js.map +1 -0
- package/dist/detectors/registry/phone-number-variant.d.ts +3 -0
- package/dist/detectors/registry/phone-number-variant.d.ts.map +1 -0
- package/dist/detectors/registry/phone-number-variant.js +3 -0
- package/dist/detectors/registry/phone-number-variant.js.map +1 -0
- package/dist/detectors/registry/prerequisite-order.d.ts +3 -0
- package/dist/detectors/registry/prerequisite-order.d.ts.map +1 -0
- package/dist/detectors/registry/prerequisite-order.js +3 -0
- package/dist/detectors/registry/prerequisite-order.js.map +1 -0
- package/dist/detectors/registry/quote-unnamed-speaker.d.ts +3 -0
- package/dist/detectors/registry/quote-unnamed-speaker.d.ts.map +1 -0
- package/dist/detectors/registry/quote-unnamed-speaker.js +3 -0
- package/dist/detectors/registry/quote-unnamed-speaker.js.map +1 -0
- package/dist/detectors/registry/tax-amount.d.ts +3 -0
- package/dist/detectors/registry/tax-amount.d.ts.map +1 -0
- package/dist/detectors/registry/tax-amount.js +3 -0
- package/dist/detectors/registry/tax-amount.js.map +1 -0
- package/dist/detectors/registry/time-order.d.ts +3 -0
- package/dist/detectors/registry/time-order.d.ts.map +1 -0
- package/dist/detectors/registry/time-order.js +3 -0
- package/dist/detectors/registry/time-order.js.map +1 -0
- package/dist/detectors/registry/ui-label.d.ts +3 -0
- package/dist/detectors/registry/ui-label.d.ts.map +1 -0
- package/dist/detectors/registry/ui-label.js +3 -0
- package/dist/detectors/registry/ui-label.js.map +1 -0
- package/dist/detectors/registry/undefined-call.d.ts +3 -0
- package/dist/detectors/registry/undefined-call.d.ts.map +1 -0
- package/dist/detectors/registry/undefined-call.js +3 -0
- package/dist/detectors/registry/undefined-call.js.map +1 -0
- package/dist/detectors/registry/undefined-term.d.ts +3 -0
- package/dist/detectors/registry/undefined-term.d.ts.map +1 -0
- package/dist/detectors/registry/undefined-term.js +3 -0
- package/dist/detectors/registry/undefined-term.js.map +1 -0
- package/dist/detectors/registry/version-order.d.ts +3 -0
- package/dist/detectors/registry/version-order.d.ts.map +1 -0
- package/dist/detectors/registry/version-order.js +3 -0
- package/dist/detectors/registry/version-order.js.map +1 -0
- package/dist/detectors/registry/warning-action.d.ts +3 -0
- package/dist/detectors/registry/warning-action.d.ts.map +1 -0
- package/dist/detectors/registry/warning-action.js +3 -0
- package/dist/detectors/registry/warning-action.js.map +1 -0
- package/dist/detectors/requirement-smell.d.ts.map +1 -1
- package/dist/detectors/requirement-smell.js +25 -8
- package/dist/detectors/requirement-smell.js.map +1 -1
- package/dist/detectors/structure-tree.d.ts +12 -4
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +31 -14
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/superlative-scope.d.ts.map +1 -1
- package/dist/detectors/superlative-scope.js +11 -1
- package/dist/detectors/superlative-scope.js.map +1 -1
- package/dist/detectors/tax-amount.d.ts +3 -0
- package/dist/detectors/tax-amount.d.ts.map +1 -0
- package/dist/detectors/tax-amount.js +19 -0
- package/dist/detectors/tax-amount.js.map +1 -0
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +5 -1
- package/dist/detectors/technical-docs.js.map +1 -1
- package/dist/detectors/term-extension.d.ts +14 -0
- package/dist/detectors/term-extension.d.ts.map +1 -0
- package/dist/detectors/term-extension.js +67 -0
- package/dist/detectors/term-extension.js.map +1 -0
- package/dist/detectors/time-order.d.ts +4 -0
- package/dist/detectors/time-order.d.ts.map +1 -0
- package/dist/detectors/time-order.js +32 -0
- package/dist/detectors/time-order.js.map +1 -0
- package/dist/detectors/ui-label.d.ts +3 -0
- package/dist/detectors/ui-label.d.ts.map +1 -0
- package/dist/detectors/ui-label.js +16 -0
- package/dist/detectors/ui-label.js.map +1 -0
- package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
- package/dist/detectors/unbalanced-bracket.js +8 -13
- package/dist/detectors/unbalanced-bracket.js.map +1 -1
- package/dist/detectors/undefined-call.d.ts +3 -0
- package/dist/detectors/undefined-call.d.ts.map +1 -0
- package/dist/detectors/undefined-call.js +18 -0
- package/dist/detectors/undefined-call.js.map +1 -0
- package/dist/detectors/undefined-term.d.ts +22 -0
- package/dist/detectors/undefined-term.d.ts.map +1 -0
- package/dist/detectors/undefined-term.js +85 -0
- package/dist/detectors/undefined-term.js.map +1 -0
- package/dist/detectors/unknown-word.d.ts +1 -1
- package/dist/detectors/unknown-word.js +3 -3
- package/dist/detectors/unknown-word.js.map +1 -1
- package/dist/detectors/vague-deadline.d.ts +4 -0
- package/dist/detectors/vague-deadline.d.ts.map +1 -1
- package/dist/detectors/vague-deadline.js +3 -3
- package/dist/detectors/vague-deadline.js.map +1 -1
- package/dist/detectors/version-mismatch.d.ts.map +1 -1
- package/dist/detectors/version-mismatch.js +18 -1
- package/dist/detectors/version-mismatch.js.map +1 -1
- package/dist/detectors/version-order.d.ts +3 -0
- package/dist/detectors/version-order.d.ts.map +1 -0
- package/dist/detectors/version-order.js +43 -0
- package/dist/detectors/version-order.js.map +1 -0
- package/dist/detectors/warning-action.d.ts +3 -0
- package/dist/detectors/warning-action.d.ts.map +1 -0
- package/dist/detectors/warning-action.js +48 -0
- package/dist/detectors/warning-action.js.map +1 -0
- package/dist/facts/condition-pairs.d.ts +51 -0
- package/dist/facts/condition-pairs.d.ts.map +1 -0
- package/dist/facts/condition-pairs.js +203 -0
- package/dist/facts/condition-pairs.js.map +1 -0
- package/dist/facts/counted-facts.d.ts +16 -0
- package/dist/facts/counted-facts.d.ts.map +1 -0
- package/dist/facts/counted-facts.js +45 -0
- package/dist/facts/counted-facts.js.map +1 -0
- package/dist/facts/event-dates.d.ts +26 -0
- package/dist/facts/event-dates.d.ts.map +1 -0
- package/dist/facts/event-dates.js +38 -0
- package/dist/facts/event-dates.js.map +1 -0
- package/dist/facts/fact-scope.d.ts +2 -0
- package/dist/facts/fact-scope.d.ts.map +1 -1
- package/dist/facts/fact-scope.js +5 -0
- package/dist/facts/fact-scope.js.map +1 -1
- package/dist/facts/labelled-facts.d.ts +2 -0
- package/dist/facts/labelled-facts.d.ts.map +1 -1
- package/dist/facts/labelled-facts.js +9 -1
- package/dist/facts/labelled-facts.js.map +1 -1
- package/dist/facts/table-facts.d.ts +16 -0
- package/dist/facts/table-facts.d.ts.map +1 -1
- package/dist/facts/table-facts.js +2 -2
- package/dist/facts/table-facts.js.map +1 -1
- package/dist/grade/ai-score.d.ts +1 -1
- package/dist/grade/ai-score.d.ts.map +1 -1
- package/dist/grade/text.js +2 -2
- package/dist/grade/text.js.map +1 -1
- package/dist/heading-numbering.js +2 -2
- package/dist/heading-numbering.js.map +1 -1
- package/dist/html/fetch-page.d.ts +20 -0
- package/dist/html/fetch-page.d.ts.map +1 -0
- package/dist/html/fetch-page.js +51 -0
- package/dist/html/fetch-page.js.map +1 -0
- package/dist/html/fetched-text.d.ts +5 -0
- package/dist/html/fetched-text.d.ts.map +1 -0
- package/dist/html/fetched-text.js +25 -0
- package/dist/html/fetched-text.js.map +1 -0
- package/dist/html/html-content-block.d.ts +6 -0
- package/dist/html/html-content-block.d.ts.map +1 -0
- package/dist/html/html-content-block.js +86 -0
- package/dist/html/html-content-block.js.map +1 -0
- package/dist/html/html-elements.d.ts +41 -0
- package/dist/html/html-elements.d.ts.map +1 -0
- package/dist/html/html-elements.js +91 -0
- package/dist/html/html-elements.js.map +1 -0
- package/dist/html/html-footnote-marks.d.ts +2 -0
- package/dist/html/html-footnote-marks.d.ts.map +1 -0
- package/dist/html/html-footnote-marks.js +15 -0
- package/dist/html/html-footnote-marks.js.map +1 -0
- package/dist/html/html-heading-links.d.ts +6 -0
- package/dist/html/html-heading-links.d.ts.map +1 -0
- package/dist/html/html-heading-links.js +71 -0
- package/dist/html/html-heading-links.js.map +1 -0
- package/dist/html/html-lost-tags.d.ts +3 -0
- package/dist/html/html-lost-tags.d.ts.map +1 -0
- package/dist/html/html-lost-tags.js +11 -0
- package/dist/html/html-lost-tags.js.map +1 -0
- package/dist/html/html-markdown.d.ts +2 -0
- package/dist/html/html-markdown.d.ts.map +1 -0
- package/dist/html/html-markdown.js +347 -0
- package/dist/html/html-markdown.js.map +1 -0
- package/dist/html/html-preformatted.d.ts +17 -0
- package/dist/html/html-preformatted.d.ts.map +1 -0
- package/dist/html/html-preformatted.js +82 -0
- package/dist/html/html-preformatted.js.map +1 -0
- package/dist/html/html-reader-only.d.ts +6 -0
- package/dist/html/html-reader-only.d.ts.map +1 -0
- package/dist/html/html-reader-only.js +63 -0
- package/dist/html/html-reader-only.js.map +1 -0
- package/dist/html/html-run-in-headings.d.ts +2 -0
- package/dist/html/html-run-in-headings.d.ts.map +1 -0
- package/dist/html/html-run-in-headings.js +36 -0
- package/dist/html/html-run-in-headings.js.map +1 -0
- package/dist/html/html-tables.d.ts +3 -0
- package/dist/html/html-tables.d.ts.map +1 -0
- package/dist/html/html-tables.js +58 -0
- package/dist/html/html-tables.js.map +1 -0
- package/dist/html/html-widgets.d.ts +3 -0
- package/dist/html/html-widgets.d.ts.map +1 -0
- package/dist/html/html-widgets.js +71 -0
- package/dist/html/html-widgets.js.map +1 -0
- package/dist/html/markup-text.d.ts +5 -0
- package/dist/html/markup-text.d.ts.map +1 -0
- package/dist/html/markup-text.js +32 -0
- package/dist/html/markup-text.js.map +1 -0
- package/dist/html/page-document.d.ts +9 -0
- package/dist/html/page-document.d.ts.map +1 -0
- package/dist/html/page-document.js +19 -0
- package/dist/html/page-document.js.map +1 -0
- package/dist/inline-count.d.ts +19 -0
- package/dist/inline-count.d.ts.map +1 -0
- package/dist/inline-count.js +109 -0
- package/dist/inline-count.js.map +1 -0
- package/dist/kana-spelling.d.ts +5 -0
- package/dist/kana-spelling.d.ts.map +1 -1
- package/dist/kana-spelling.js +5 -0
- package/dist/kana-spelling.js.map +1 -1
- package/dist/location-part.d.ts +13 -0
- package/dist/location-part.d.ts.map +1 -0
- package/dist/location-part.js +24 -0
- package/dist/location-part.js.map +1 -0
- package/dist/nado-closed-list.d.ts +20 -0
- package/dist/nado-closed-list.d.ts.map +1 -0
- package/dist/nado-closed-list.js +72 -0
- package/dist/nado-closed-list.js.map +1 -0
- package/dist/name-cue.d.ts +17 -0
- package/dist/name-cue.d.ts.map +1 -0
- package/dist/name-cue.js +29 -0
- package/dist/name-cue.js.map +1 -0
- package/dist/name-variants.d.ts +41 -5
- package/dist/name-variants.d.ts.map +1 -1
- package/dist/name-variants.js +93 -8
- package/dist/name-variants.js.map +1 -1
- package/dist/paragraph-runs.d.ts +6 -1
- package/dist/paragraph-runs.d.ts.map +1 -1
- package/dist/paragraph-runs.js +9 -2
- package/dist/paragraph-runs.js.map +1 -1
- package/dist/parameter-table.d.ts +19 -0
- package/dist/parameter-table.d.ts.map +1 -0
- package/dist/parameter-table.js +191 -0
- package/dist/parameter-table.js.map +1 -0
- package/dist/phone-numbers.d.ts +23 -0
- package/dist/phone-numbers.d.ts.map +1 -0
- package/dist/phone-numbers.js +83 -0
- package/dist/phone-numbers.js.map +1 -0
- package/dist/place-names.d.ts +55 -0
- package/dist/place-names.d.ts.map +1 -0
- package/dist/place-names.js +196 -0
- package/dist/place-names.js.map +1 -0
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/prerequisite-order.d.ts +16 -0
- package/dist/prerequisite-order.d.ts.map +1 -0
- package/dist/prerequisite-order.js +29 -0
- package/dist/prerequisite-order.js.map +1 -0
- package/dist/profile/parse.d.ts.map +1 -1
- package/dist/profile/parse.js +10 -1
- package/dist/profile/parse.js.map +1 -1
- package/dist/reasons.d.ts +2 -0
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +2 -0
- package/dist/reasons.js.map +1 -1
- package/dist/render/rules-json.d.ts.map +1 -1
- package/dist/render/rules-json.js +4 -0
- package/dist/render/rules-json.js.map +1 -1
- package/dist/render/rules-table.d.ts.map +1 -1
- package/dist/render/rules-table.js +6 -2
- package/dist/render/rules-table.js.map +1 -1
- package/dist/rule-genres.d.ts +5 -2
- package/dist/rule-genres.d.ts.map +1 -1
- package/dist/rule-genres.js +2 -0
- package/dist/rule-genres.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.d.ts.map +1 -1
- package/dist/run.js +5 -1
- package/dist/run.js.map +1 -1
- package/dist/spelling.d.ts +2 -0
- package/dist/spelling.d.ts.map +1 -1
- package/dist/spelling.js +6 -0
- package/dist/spelling.js.map +1 -1
- package/dist/structure/action-due.d.ts +21 -0
- package/dist/structure/action-due.d.ts.map +1 -0
- package/dist/structure/action-due.js +126 -0
- package/dist/structure/action-due.js.map +1 -0
- package/dist/structure/amount-range.d.ts +30 -0
- package/dist/structure/amount-range.d.ts.map +1 -0
- package/dist/structure/amount-range.js +153 -0
- package/dist/structure/amount-range.js.map +1 -0
- package/dist/structure/amount-scale.d.ts +35 -0
- package/dist/structure/amount-scale.d.ts.map +1 -0
- package/dist/structure/amount-scale.js +83 -0
- package/dist/structure/amount-scale.js.map +1 -0
- package/dist/structure/cite.d.ts +5 -2
- package/dist/structure/cite.d.ts.map +1 -1
- package/dist/structure/cite.js +20 -1
- package/dist/structure/cite.js.map +1 -1
- package/dist/structure/counted-amounts.d.ts +12 -0
- package/dist/structure/counted-amounts.d.ts.map +1 -0
- package/dist/structure/counted-amounts.js +30 -0
- package/dist/structure/counted-amounts.js.map +1 -0
- package/dist/structure/date-order.d.ts +24 -3
- package/dist/structure/date-order.d.ts.map +1 -1
- package/dist/structure/date-order.js +49 -17
- package/dist/structure/date-order.js.map +1 -1
- package/dist/structure/date-outside-period.d.ts +27 -0
- package/dist/structure/date-outside-period.d.ts.map +1 -0
- package/dist/structure/date-outside-period.js +86 -0
- package/dist/structure/date-outside-period.js.map +1 -0
- package/dist/structure/definition-use.d.ts +5 -2
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +11 -3
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure/due-date.d.ts +19 -0
- package/dist/structure/due-date.d.ts.map +1 -0
- package/dist/structure/due-date.js +30 -0
- package/dist/structure/due-date.js.map +1 -0
- package/dist/structure/heading-runs.d.ts +9 -0
- package/dist/structure/heading-runs.d.ts.map +1 -0
- package/dist/structure/heading-runs.js +23 -0
- package/dist/structure/heading-runs.js.map +1 -0
- package/dist/structure/install-pin.d.ts +46 -0
- package/dist/structure/install-pin.d.ts.map +1 -0
- package/dist/structure/install-pin.js +85 -0
- package/dist/structure/install-pin.js.map +1 -0
- package/dist/structure/leg-times.d.ts +34 -0
- package/dist/structure/leg-times.d.ts.map +1 -0
- package/dist/structure/leg-times.js +135 -0
- package/dist/structure/leg-times.js.map +1 -0
- package/dist/structure/line-amount-unit.d.ts +24 -0
- package/dist/structure/line-amount-unit.d.ts.map +1 -0
- package/dist/structure/line-amount-unit.js +24 -0
- package/dist/structure/line-amount-unit.js.map +1 -0
- package/dist/structure/line-amount.d.ts +40 -0
- package/dist/structure/line-amount.d.ts.map +1 -0
- package/dist/structure/line-amount.js +118 -0
- package/dist/structure/line-amount.js.map +1 -0
- package/dist/structure/number-word-figure.d.ts +37 -0
- package/dist/structure/number-word-figure.d.ts.map +1 -0
- package/dist/structure/number-word-figure.js +151 -0
- package/dist/structure/number-word-figure.js.map +1 -0
- package/dist/structure/numbering.d.ts +1 -0
- package/dist/structure/numbering.d.ts.map +1 -1
- package/dist/structure/numbering.js +3 -0
- package/dist/structure/numbering.js.map +1 -1
- package/dist/structure/ordinal-runs.d.ts +45 -0
- package/dist/structure/ordinal-runs.d.ts.map +1 -0
- package/dist/structure/ordinal-runs.js +78 -0
- package/dist/structure/ordinal-runs.js.map +1 -0
- package/dist/structure/percent-sum-prose.d.ts +1 -1
- package/dist/structure/percent-sum-prose.d.ts.map +1 -1
- package/dist/structure/percent-sum-prose.js +45 -3
- package/dist/structure/percent-sum-prose.js.map +1 -1
- package/dist/structure/percent-sum.d.ts +8 -0
- package/dist/structure/percent-sum.d.ts.map +1 -1
- package/dist/structure/percent-sum.js +8 -1
- package/dist/structure/percent-sum.js.map +1 -1
- package/dist/structure/release-list.d.ts +9 -0
- package/dist/structure/release-list.d.ts.map +1 -0
- package/dist/structure/release-list.js +46 -0
- package/dist/structure/release-list.js.map +1 -0
- package/dist/structure/share-column.d.ts +7 -0
- package/dist/structure/share-column.d.ts.map +1 -0
- package/dist/structure/share-column.js +22 -0
- package/dist/structure/share-column.js.map +1 -0
- package/dist/structure/stated-period.d.ts +31 -0
- package/dist/structure/stated-period.d.ts.map +1 -0
- package/dist/structure/stated-period.js +127 -0
- package/dist/structure/stated-period.js.map +1 -0
- package/dist/structure/subject-change.d.ts +8 -0
- package/dist/structure/subject-change.d.ts.map +1 -0
- package/dist/structure/subject-change.js +31 -0
- package/dist/structure/subject-change.js.map +1 -0
- package/dist/structure/tax.d.ts +25 -0
- package/dist/structure/tax.d.ts.map +1 -0
- package/dist/structure/tax.js +86 -0
- package/dist/structure/tax.js.map +1 -0
- package/dist/structure/time-marks.d.ts +58 -0
- package/dist/structure/time-marks.d.ts.map +1 -0
- package/dist/structure/time-marks.js +74 -0
- package/dist/structure/time-marks.js.map +1 -0
- package/dist/structure/time-order.d.ts +21 -0
- package/dist/structure/time-order.d.ts.map +1 -0
- package/dist/structure/time-order.js +108 -0
- package/dist/structure/time-order.js.map +1 -0
- package/dist/structure/title-lines.d.ts +8 -0
- package/dist/structure/title-lines.d.ts.map +1 -0
- package/dist/structure/title-lines.js +27 -0
- package/dist/structure/title-lines.js.map +1 -0
- package/dist/structure/total.d.ts.map +1 -1
- package/dist/structure/total.js +3 -1
- package/dist/structure/total.js.map +1 -1
- package/dist/structure/version-mismatch.d.ts +1 -5
- package/dist/structure/version-mismatch.d.ts.map +1 -1
- package/dist/structure/version-mismatch.js +65 -12
- package/dist/structure/version-mismatch.js.map +1 -1
- package/dist/structure/version-order.d.ts +23 -0
- package/dist/structure/version-order.d.ts.map +1 -0
- package/dist/structure/version-order.js +67 -0
- package/dist/structure/version-order.js.map +1 -0
- package/dist/table-text.d.ts +9 -0
- package/dist/table-text.d.ts.map +1 -0
- package/dist/table-text.js +36 -0
- package/dist/table-text.js.map +1 -0
- package/dist/ui-labels.d.ts +16 -0
- package/dist/ui-labels.d.ts.map +1 -0
- package/dist/ui-labels.js +42 -0
- package/dist/ui-labels.js.map +1 -0
- package/dist/undefined-call.d.ts +13 -0
- package/dist/undefined-call.d.ts.map +1 -0
- package/dist/undefined-call.js +55 -0
- package/dist/undefined-call.js.map +1 -0
- package/dist/unnamed-speaker.d.ts +23 -0
- package/dist/unnamed-speaker.d.ts.map +1 -0
- package/dist/unnamed-speaker.js +176 -0
- package/dist/unnamed-speaker.js.map +1 -0
- package/dist/warning-action.d.ts +22 -0
- package/dist/warning-action.d.ts.map +1 -0
- package/dist/warning-action.js +58 -0
- package/dist/warning-action.js.map +1 -0
- package/genres.yaml +2 -0
- package/package.json +4 -3
- package/profiles/statute.yaml +8 -0
- package/rules/agreement-slip.yaml +2 -2
- package/rules/amount-range-reversed.yaml +52 -0
- package/rules/amount-scale-consistency.yaml +74 -0
- package/rules/announced-count-mismatch.yaml +9 -4
- package/rules/arrival-before-departure.yaml +48 -0
- package/rules/change-rate-mismatch.yaml +5 -4
- package/rules/connective-hierarchy.yaml +3 -3
- package/rules/currency-notation-consistency.yaml +2 -2
- package/rules/date-order.yaml +9 -4
- package/rules/date-outside-period.yaml +64 -0
- package/rules/default-value-mismatch.yaml +79 -0
- package/rules/defined-term-form.yaml +9 -7
- package/rules/deprecated-option-used.yaml +78 -0
- package/rules/doubled-nado.yaml +28 -12
- package/rules/due-before-issue.yaml +68 -0
- package/rules/duplicate-definition.yaml +2 -2
- package/rules/duration-mismatch.yaml +12 -4
- package/rules/elapsed-years-mismatch.yaml +2 -2
- package/rules/heading-echo.yaml +2 -2
- package/rules/hyphen-as-dash.yaml +2 -2
- package/rules/kana-function-word.yaml +58 -0
- package/rules/latin-spacing.yaml +6 -5
- package/rules/line-amount-mismatch.yaml +58 -0
- package/rules/nado-closed-list.yaml +77 -0
- package/rules/name-variant.yaml +17 -2
- package/rules/number-word-figure-mismatch.yaml +76 -0
- package/rules/numbering-gap.yaml +2 -2
- package/rules/obligation-without-deadline.yaml +95 -0
- package/rules/one-sentence-paragraph-run.yaml +2 -3
- package/rules/parameter-table-mismatch.yaml +90 -0
- package/rules/percent-sum-mismatch.yaml +2 -2
- package/rules/phone-number-variant.yaml +68 -0
- package/rules/prerequisite-after-step.yaml +78 -0
- package/rules/quote-unnamed-speaker.yaml +67 -0
- package/rules/quote-without-source.yaml +6 -6
- package/rules/requirement-smell.yaml +3 -3
- package/rules/sentence-initial-conjunction-run.yaml +13 -7
- package/rules/summary-fact-mismatch.yaml +4 -4
- package/rules/tax-mismatch.yaml +71 -0
- package/rules/time-order.yaml +65 -0
- package/rules/title-length.yaml +2 -2
- package/rules/ui-label-variant.yaml +70 -0
- package/rules/unbalanced-bracket.yaml +4 -4
- package/rules/uncomparable-graded.yaml +29 -10
- package/rules/undefined-function-call.yaml +77 -0
- package/rules/undefined-term.yaml +72 -0
- package/rules/unknown-word.yaml +2 -2
- package/rules/unqualified-superlative.yaml +2 -2
- package/rules/use-before-definition.yaml +2 -2
- package/rules/version-mismatch.yaml +12 -4
- package/rules/version-order.yaml +85 -0
- package/rules/very-adjective.yaml +31 -13
- package/rules/warning-without-action.yaml +64 -0
- package/rules/wordy-phrase.yaml +27 -9
- package/src/ai-score/of-document.ts +19 -9
- package/src/ai-score/render.ts +24 -4
- package/src/ai-score/score.ts +24 -3
- package/src/ai-score/signals.ts +12 -2
- package/src/ai-score/text.ts +7 -2
- package/src/announced-count.ts +19 -12
- package/src/check-source.ts +11 -2
- package/src/cli-text.ts +42 -18
- package/src/cli.ts +2 -1
- package/src/commands/cite-claims.ts +103 -0
- package/src/commands/cite-page.ts +61 -0
- package/src/commands/cite-scaffold.ts +27 -0
- package/src/commands/cite.ts +127 -58
- package/src/company-names.ts +202 -0
- package/src/default-values.ts +158 -0
- package/src/deprecated-use.ts +122 -0
- package/src/derived/number-word-counts.ts +28 -0
- package/src/derived/stays.ts +145 -0
- package/src/detectors/acronym-context.ts +10 -2
- package/src/detectors/address-word.ts +9 -0
- package/src/detectors/agreement-slip.ts +7 -1
- package/src/detectors/ai-phrasing.ts +6 -1
- package/src/detectors/amount-range.ts +54 -0
- package/src/detectors/amount-scale.ts +96 -0
- package/src/detectors/announced-count.ts +29 -11
- package/src/detectors/bare-comparative.ts +7 -2
- package/src/detectors/block-quotation.ts +95 -0
- package/src/detectors/bracket-label.ts +58 -0
- package/src/detectors/change-rate.ts +15 -2
- package/src/detectors/citation-entry.ts +20 -5
- package/src/detectors/code-before.ts +14 -0
- package/src/detectors/connective-hierarchy.ts +39 -11
- package/src/detectors/currency-notation.ts +4 -3
- package/src/detectors/date-outside-period.ts +38 -0
- package/src/detectors/default-values.ts +17 -0
- package/src/detectors/defined-term-form.ts +84 -15
- package/src/detectors/definition-use.ts +10 -2
- package/src/detectors/deprecated-use.ts +17 -0
- package/src/detectors/derived-numbers.ts +115 -17
- package/src/detectors/document-shape.ts +6 -1
- package/src/detectors/due-date.ts +47 -0
- package/src/detectors/en-shape.ts +27 -11
- package/src/detectors/fact-consistency.ts +110 -2
- package/src/detectors/heading-echo.ts +11 -1
- package/src/detectors/kana-function-word.ts +71 -0
- package/src/detectors/line-amount.ts +33 -0
- package/src/detectors/location-pointer.ts +30 -0
- package/src/detectors/mark-shape.ts +18 -1
- package/src/detectors/nado-closed-list.ts +25 -0
- package/src/detectors/name-variant.ts +114 -11
- package/src/detectors/next-word.ts +56 -9
- package/src/detectors/number-word-figure.ts +43 -0
- package/src/detectors/obligation-without-deadline.ts +192 -0
- package/src/detectors/open-end-names.ts +140 -0
- package/src/detectors/ordinal-run-gaps.ts +101 -0
- package/src/detectors/orthographic-variant.ts +39 -14
- package/src/detectors/orthography.ts +6 -1
- package/src/detectors/parameter-table.ts +17 -0
- package/src/detectors/phone-number-variant.ts +18 -0
- package/src/detectors/prerequisite-order.ts +35 -0
- package/src/detectors/quote-unnamed-speaker.ts +19 -0
- package/src/detectors/quote-without-source.ts +57 -10
- package/src/detectors/registry/amount-range.ts +4 -0
- package/src/detectors/registry/amount-scale.ts +4 -0
- package/src/detectors/registry/arrival-before-departure.ts +4 -0
- package/src/detectors/registry/date-outside-period.ts +4 -0
- package/src/detectors/registry/default-values.ts +4 -0
- package/src/detectors/registry/deprecated-use.ts +4 -0
- package/src/detectors/registry/due-date.ts +4 -0
- package/src/detectors/registry/kana-function-word.ts +4 -0
- package/src/detectors/registry/line-amount.ts +4 -0
- package/src/detectors/registry/nado-closed-list.ts +4 -0
- package/src/detectors/registry/number-word-figure.ts +4 -0
- package/src/detectors/registry/obligation-without-deadline.ts +4 -0
- package/src/detectors/registry/parameter-table.ts +4 -0
- package/src/detectors/registry/phone-number-variant.ts +4 -0
- package/src/detectors/registry/prerequisite-order.ts +4 -0
- package/src/detectors/registry/quote-unnamed-speaker.ts +4 -0
- package/src/detectors/registry/tax-amount.ts +4 -0
- package/src/detectors/registry/time-order.ts +4 -0
- package/src/detectors/registry/ui-label.ts +4 -0
- package/src/detectors/registry/undefined-call.ts +4 -0
- package/src/detectors/registry/undefined-term.ts +4 -0
- package/src/detectors/registry/version-order.ts +4 -0
- package/src/detectors/registry/warning-action.ts +4 -0
- package/src/detectors/requirement-smell.ts +29 -9
- package/src/detectors/structure-tree.ts +43 -21
- package/src/detectors/superlative-scope.ts +13 -1
- package/src/detectors/tax-amount.ts +25 -0
- package/src/detectors/technical-docs.ts +7 -1
- package/src/detectors/term-extension.ts +67 -0
- package/src/detectors/time-order.ts +49 -0
- package/src/detectors/ui-label.ts +17 -0
- package/src/detectors/unbalanced-bracket.ts +7 -14
- package/src/detectors/undefined-call.ts +19 -0
- package/src/detectors/undefined-term.ts +103 -0
- package/src/detectors/unknown-word.ts +3 -3
- package/src/detectors/vague-deadline.ts +3 -3
- package/src/detectors/version-mismatch.ts +26 -5
- package/src/detectors/version-order.ts +50 -0
- package/src/detectors/warning-action.ts +49 -0
- package/src/facts/condition-pairs.ts +289 -0
- package/src/facts/counted-facts.ts +59 -0
- package/src/facts/event-dates.ts +63 -0
- package/src/facts/fact-scope.ts +6 -0
- package/src/facts/labelled-facts.ts +13 -1
- package/src/facts/table-facts.ts +3 -3
- package/src/grade/ai-score.ts +1 -1
- package/src/grade/text.ts +2 -2
- package/src/heading-numbering.ts +2 -2
- package/src/html/fetch-page.ts +64 -0
- package/src/html/fetched-text.ts +32 -0
- package/src/html/html-content-block.ts +107 -0
- package/src/html/html-elements.ts +127 -0
- package/src/html/html-footnote-marks.ts +20 -0
- package/src/html/html-heading-links.ts +93 -0
- package/src/html/html-lost-tags.ts +14 -0
- package/src/html/html-markdown.ts +481 -0
- package/src/html/html-preformatted.ts +110 -0
- package/src/html/html-reader-only.ts +82 -0
- package/src/html/html-run-in-headings.ts +43 -0
- package/src/html/html-tables.ts +76 -0
- package/src/html/html-widgets.ts +114 -0
- package/src/html/markup-text.ts +35 -0
- package/src/html/page-document.ts +22 -0
- package/src/inline-count.ts +146 -0
- package/src/kana-spelling.ts +7 -0
- package/src/location-part.ts +30 -0
- package/src/nado-closed-list.ts +106 -0
- package/src/name-cue.ts +35 -0
- package/src/name-variants.ts +152 -11
- package/src/paragraph-runs.ts +12 -2
- package/src/parameter-table.ts +208 -0
- package/src/phone-numbers.ts +98 -0
- package/src/place-names.ts +248 -0
- package/src/plugin.ts +4 -0
- package/src/prerequisite-order.ts +39 -0
- package/src/profile/parse.ts +10 -1
- package/src/reasons.ts +4 -0
- package/src/render/rules-json.ts +4 -0
- package/src/render/rules-table.ts +6 -3
- package/src/rule-genres.ts +5 -2
- package/src/rule-load.ts +3 -2
- package/src/run.ts +3 -1
- package/src/spelling.ts +8 -0
- package/src/structure/action-due.ts +179 -0
- package/src/structure/amount-range.ts +219 -0
- package/src/structure/amount-scale.ts +115 -0
- package/src/structure/cite.ts +21 -2
- package/src/structure/counted-amounts.ts +42 -0
- package/src/structure/date-order.ts +72 -22
- package/src/structure/date-outside-period.ts +127 -0
- package/src/structure/definition-use.ts +24 -3
- package/src/structure/due-date.ts +46 -0
- package/src/structure/heading-runs.ts +24 -0
- package/src/structure/install-pin.ts +115 -0
- package/src/structure/leg-times.ts +198 -0
- package/src/structure/line-amount-unit.ts +35 -0
- package/src/structure/line-amount.ts +162 -0
- package/src/structure/number-word-figure.ts +199 -0
- package/src/structure/numbering.ts +3 -0
- package/src/structure/ordinal-runs.ts +107 -0
- package/src/structure/percent-sum-prose.ts +46 -3
- package/src/structure/percent-sum.ts +16 -2
- package/src/structure/release-list.ts +69 -0
- package/src/structure/share-column.ts +25 -0
- package/src/structure/stated-period.ts +161 -0
- package/src/structure/subject-change.ts +35 -0
- package/src/structure/tax.ts +114 -0
- package/src/structure/time-marks.ts +127 -0
- package/src/structure/time-order.ts +140 -0
- package/src/structure/title-lines.ts +33 -0
- package/src/structure/total.ts +5 -1
- package/src/structure/version-mismatch.ts +67 -13
- package/src/structure/version-order.ts +84 -0
- package/src/table-text.ts +39 -0
- package/src/ui-labels.ts +55 -0
- package/src/undefined-call.ts +65 -0
- package/src/unnamed-speaker.ts +224 -0
- package/src/warning-action.ts +73 -0
- package/styles/koyobun.yaml +7 -4
|
@@ -11,8 +11,15 @@ export type LoneConnective = { readonly offset: number; readonly written: string
|
|
|
11
11
|
|
|
12
12
|
const CONJUNCTION = "CCONJ";
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The word lists the detector reads: the connectives, the phrases that hold one's letters without being one (歯並びに), and
|
|
16
|
+
* the ends of a condition clause (ときは、): an inner-level word is looked for in the outer-level word's own clause only.
|
|
17
|
+
*/
|
|
18
|
+
export type ConnectiveLists = {
|
|
19
|
+
readonly connectives: readonly LexiconEntry[];
|
|
20
|
+
readonly lookalikes: readonly LexiconEntry[];
|
|
21
|
+
readonly clauseEnds: readonly LexiconEntry[];
|
|
22
|
+
};
|
|
16
23
|
|
|
17
24
|
/**
|
|
18
25
|
* The tagger does not always tell a connective from a noun and a particle: it reads 申請書並びに as 並び + に and
|
|
@@ -62,30 +69,51 @@ const standsAsConnective = (reading: Reading, span: Span): boolean => {
|
|
|
62
69
|
return tagged || joinsNouns(previous, reading.byStart.get(span.end));
|
|
63
70
|
};
|
|
64
71
|
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
/**
|
|
73
|
+
* The clause of the text the letter at `at` is in: from the end of the last clause end before it (ときは、) to the end of
|
|
74
|
+
* the first one after it. A list in a condition clause and one in the main clause are not levels of one list. A clause
|
|
75
|
+
* end with a connective right after it (…ときは、又は…場合には) joins two conditions, and does not cut.
|
|
76
|
+
*/
|
|
77
|
+
export const clauseAround = (text: string, at: number, clauseEnds: readonly LexiconEntry[], connectives: readonly LexiconEntry[] = []): string => {
|
|
78
|
+
const joinsNext = (end: number): boolean => connectives.some(({ pattern }) => pattern !== "" && text.startsWith(pattern, end));
|
|
79
|
+
const ends = clauseEnds
|
|
80
|
+
.filter(({ pattern }) => pattern !== "")
|
|
81
|
+
.flatMap(({ pattern }) => placesOf(text, pattern).map((start) => start + pattern.length))
|
|
82
|
+
.filter((end) => !joinsNext(end));
|
|
83
|
+
const start = Math.max(0, ...ends.filter((end) => end <= at));
|
|
84
|
+
const end = Math.min(text.length, ...ends.filter((end) => end > at));
|
|
85
|
+
return text.slice(start, end);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const hasInnerLevel = (clause: string, outer: LexiconEntry, connectives: readonly LexiconEntry[]): boolean =>
|
|
89
|
+
connectives.some((entry) => entry.instead_of === outer.pattern && clause.includes(entry.pattern));
|
|
67
90
|
|
|
68
|
-
/** Where one outer-level word stands as a connective in the sentence. */
|
|
69
|
-
const connectiveSpans = (sentence: Sentence, outer: LexiconEntry, reading: Reading): Span[] =>
|
|
91
|
+
/** Where one outer-level word stands as a connective in the sentence with no inner-level word in its clause. */
|
|
92
|
+
const connectiveSpans = (sentence: Sentence, outer: LexiconEntry, reading: Reading, lists: ConnectiveLists): Span[] =>
|
|
70
93
|
placesOf(sentence.text, outer.pattern)
|
|
71
94
|
.filter((at) => reading.hidden[at] !== true)
|
|
95
|
+
.filter((at) => !hasInnerLevel(clauseAround(sentence.text, at, lists.clauseEnds, lists.connectives), outer, lists.connectives))
|
|
72
96
|
.map((at) => ({ start: sentence.span.start + at, end: sentence.span.start + at + outer.pattern.length }))
|
|
73
97
|
.filter((span) => standsAsConnective(reading, span));
|
|
74
98
|
|
|
75
99
|
/** The outer-level connectives of a sentence that stand over no inner level. */
|
|
76
100
|
export const loneConnectivesIn = (sentence: Sentence, lists: ConnectiveLists): LoneConnective[] => {
|
|
77
|
-
const lone = lists.connectives.filter(
|
|
78
|
-
(entry) => entry.rewrite !== undefined && sentence.text.includes(entry.pattern) && !hasInnerLevel(sentence, entry, lists.connectives),
|
|
79
|
-
);
|
|
101
|
+
const lone = lists.connectives.filter((entry) => entry.rewrite !== undefined && sentence.text.includes(entry.pattern));
|
|
80
102
|
if (lone.length === 0) return [];
|
|
81
103
|
const reading = readingOf(sentence, lists.lookalikes);
|
|
82
104
|
return lone
|
|
83
|
-
.flatMap((entry) =>
|
|
105
|
+
.flatMap((entry) =>
|
|
106
|
+
connectiveSpans(sentence, entry, reading, lists).map((span) => ({ offset: span.start, written: entry.pattern, usual: entry.rewrite ?? "" })),
|
|
107
|
+
)
|
|
84
108
|
.sort((a, b) => a.offset - b.offset);
|
|
85
109
|
};
|
|
86
110
|
|
|
87
111
|
export const connectiveHierarchy: Detector = (doc, options): Finding[] => {
|
|
88
|
-
const lists = {
|
|
112
|
+
const lists = {
|
|
113
|
+
connectives: options.lexicon ?? [],
|
|
114
|
+
lookalikes: doc.lexicons["connective-lookalike"] ?? [],
|
|
115
|
+
clauseEnds: doc.lexicons["connective-clause-end"] ?? [],
|
|
116
|
+
};
|
|
89
117
|
return doc.sentences.flatMap((sentence) =>
|
|
90
118
|
loneConnectivesIn(sentence, lists).map((lone) => ({
|
|
91
119
|
rule: "",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
2
|
import { escapeRegExp } from "../orthography.ts";
|
|
3
3
|
import { formMinority } from "./form-minority.ts";
|
|
4
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
4
5
|
import { quoteAround } from "./quote-around.ts";
|
|
5
6
|
|
|
6
7
|
// 一つの文書で、同じ通貨の金額を二通りに書いた所(1,000円 と ¥1,000、$20 と 20 dollars)。どちらが正しいかは決めず、少ないほうを指す。
|
|
@@ -14,7 +15,7 @@ export type WrittenAmount = { readonly offset: number; readonly written: string;
|
|
|
14
15
|
/** 少ないほうの書き方の金額と、多いほうの書き方の例、その通貨の金額の数。 */
|
|
15
16
|
export type CurrencyMinority = { readonly odd: WrittenAmount; readonly usual: string; readonly count: number; readonly of: number };
|
|
16
17
|
|
|
17
|
-
const AMOUNT = "[0-90-9]+(?:[,,][0-90-9]{3})*(?:[..][0-90-9]+)?";
|
|
18
|
+
export const AMOUNT = "[0-90-9]+(?:[,,][0-90-9]{3})*(?:[..][0-90-9]+)?";
|
|
18
19
|
|
|
19
20
|
const alternation = (words: readonly string[]): string => words.map(escapeRegExp).join("|");
|
|
20
21
|
|
|
@@ -71,13 +72,13 @@ export const currencyMinorities = (amounts: readonly WrittenAmount[], limit: num
|
|
|
71
72
|
)
|
|
72
73
|
.toSorted((left, right) => left.odd.offset - right.odd.offset);
|
|
73
74
|
|
|
74
|
-
const formsOf = (doc: ProseDocument): CurrencyForm[] =>
|
|
75
|
+
export const formsOf = (doc: ProseDocument): CurrencyForm[] =>
|
|
75
76
|
(doc.lexicons["currency-notation"] ?? []).flatMap((entry) =>
|
|
76
77
|
entry.position === undefined || entry.group === undefined ? [] : [{ pattern: entry.pattern, position: entry.position, currency: entry.group }],
|
|
77
78
|
);
|
|
78
79
|
|
|
79
80
|
export const currencyNotation: Detector = (doc, options): Finding[] => {
|
|
80
|
-
const text = doc
|
|
81
|
+
const text = proseAndTablesOf(doc);
|
|
81
82
|
const multipliers = (doc.lexicons["amount-multiplier"] ?? []).map((entry) => entry.pattern);
|
|
82
83
|
return currencyMinorities(amountsIn(text, formsOf(doc), multipliers), options.limit).map(({ odd, usual, count, of }) => ({
|
|
83
84
|
rule: "",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
|
+
import { inDocumentOrder } from "../structure/issues.ts";
|
|
3
|
+
import { datesOutsidePeriod, type OutsideWords } from "../structure/date-outside-period.ts";
|
|
4
|
+
import { rangeFrameOf } from "../structure/date-range.ts";
|
|
5
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
6
|
+
|
|
7
|
+
const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
|
|
8
|
+
|
|
9
|
+
/** 期間の語、期間の外に置く語、範囲の記号(range-connector、range-opener、range-frame の間の語)、月と曜日の名は語彙表から取る。 */
|
|
10
|
+
const wordsOf = (doc: ProseDocument): OutsideWords => ({
|
|
11
|
+
labels: patternsOf(doc, "period-label"),
|
|
12
|
+
asides: patternsOf(doc, "period-aside"),
|
|
13
|
+
connectors: [
|
|
14
|
+
...patternsOf(doc, "range-connector"),
|
|
15
|
+
...patternsOf(doc, "range-opener"),
|
|
16
|
+
...patternsOf(doc, "range-frame").flatMap((pattern) => rangeFrameOf(pattern)?.joint ?? []),
|
|
17
|
+
],
|
|
18
|
+
months: patternsOf(doc, "month-name"),
|
|
19
|
+
weekdays: patternsOf(doc, "weekday"),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/** 書いた期間(旅行期間:…)の外の日付を持つ、その後ろの日程の項目、表の行、見出し。 */
|
|
23
|
+
export const dateOutsidePeriod: Detector = (doc): Finding[] => {
|
|
24
|
+
if (doc.structure === undefined) return [];
|
|
25
|
+
const dates = inDocumentOrder(doc.structure).flatMap((node) =>
|
|
26
|
+
node.kind === "date" ? [{ offset: node.span.start, end: node.span.end, value: String(node.attrs["value"]) }] : [],
|
|
27
|
+
);
|
|
28
|
+
const headings = doc.markup?.headings ?? [];
|
|
29
|
+
const sentences = doc.sentences.map((sentence) => sentence.span);
|
|
30
|
+
return datesOutsidePeriod(doc.source, dates, headings, sentences, wordsOf(doc)).map((issue) => ({
|
|
31
|
+
rule: "date-outside-period",
|
|
32
|
+
severity: "warning",
|
|
33
|
+
line: 0,
|
|
34
|
+
column: 0,
|
|
35
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
36
|
+
values: { ...issue.values, offset: issue.offset },
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// default-value-mismatch: one parameter's default stated two ways on a page (default-values.ts). The header words of a
|
|
2
|
+
// default column and the phrases that state a default in prose come from the default-header and default-phrase lexicons.
|
|
3
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
4
|
+
import { defaultSlips } from "../default-values.ts";
|
|
5
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
6
|
+
|
|
7
|
+
const lowercase = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern.toLowerCase());
|
|
8
|
+
|
|
9
|
+
export const defaultValues: Detector = (doc): Finding[] =>
|
|
10
|
+
defaultSlips(doc.source, { headers: lowercase(doc, "default-header"), phrases: lowercase(doc, "default-phrase") }).map((slip) => ({
|
|
11
|
+
rule: "default-value-mismatch",
|
|
12
|
+
severity: "warning",
|
|
13
|
+
line: 0,
|
|
14
|
+
column: 0,
|
|
15
|
+
quote: quoteAt(doc.source, slip.offset),
|
|
16
|
+
values: { name: slip.name, value: slip.value, expected: slip.expected, offset: slip.offset },
|
|
17
|
+
}));
|
|
@@ -5,6 +5,8 @@ import { definedTerms, usesOf, type BodyText, type DefinedTerm } from "../struct
|
|
|
5
5
|
import { escapeRegExp } from "../orthography.ts";
|
|
6
6
|
import { prefixGroupsOf, prefixVariants, variantUses } from "../structure/term-prefix.ts";
|
|
7
7
|
import { quoteAt } from "./structure-tree.ts";
|
|
8
|
+
import { isPartOfAddress } from "./address-word.ts";
|
|
9
|
+
import { exactOffsets, extendedAfter, extendedBefore } from "./term-extension.ts";
|
|
8
10
|
import type { Detector, Finding, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
9
11
|
|
|
10
12
|
const bodyOf = (doc: ProseDocument): BodyText[] => doc.sentences.map((sentence) => ({ start: sentence.span.start, text: sentence.text }));
|
|
@@ -50,17 +52,32 @@ export const quotedUses = (source: string, term: string, uses: readonly number[]
|
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
const UPPER_START = /^\p{Lu}/u;
|
|
55
|
+
/** The capital that starts each later word of a term (the O of Records Officer). */
|
|
56
|
+
const INNER_CAPITAL = /(?<=\s)\p{Lu}/gu;
|
|
57
|
+
|
|
58
|
+
const innerCapitals = (term: string): number[] => [...term.matchAll(INNER_CAPITAL)].map((match) => match.index);
|
|
59
|
+
|
|
60
|
+
/** Whether the letter at position at of the term is written in lower case at this use. */
|
|
61
|
+
const isLowered = (source: string, term: string, offset: number, at: number): boolean => source.charAt(offset + at) === term.charAt(at).toLowerCase();
|
|
62
|
+
|
|
63
|
+
/** The term with the capitals of its later words in lower case (Records officer), whose uses the term's own form does not find. */
|
|
64
|
+
export const innerLowered = (term: string): string => term.replace(INNER_CAPITAL, (capital) => capital.toLowerCase());
|
|
53
65
|
|
|
54
66
|
/**
|
|
55
|
-
* The uses of a capitalised term written in lower case ("services" where "Services" is defined
|
|
56
|
-
*
|
|
67
|
+
* The uses of a capitalised term written in lower case ("services" where "Services" is defined, "records officer" where
|
|
68
|
+
* "Records Officer" is), when they are no more than the capitalised uses and at most limit: a document that writes it in
|
|
69
|
+
* lower case more often uses the word in its ordinary sense on purpose. One of each is a slip to point at (the Software,
|
|
70
|
+
* then the software).
|
|
57
71
|
*/
|
|
58
72
|
export const lowerCaseUses = (source: string, term: string, uses: readonly number[], definedAt: number, limit: number): number[] => {
|
|
59
73
|
if (!UPPER_START.test(term) || term.toLowerCase() === term) return [];
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
74
|
+
const inner = innerCapitals(term);
|
|
75
|
+
// An address (support@pinecone.example) spells the name as the address must be, in either case; it is not a use.
|
|
76
|
+
const later = uses.filter((offset) => offset > definedAt && !isPartOfAddress(source, offset, offset + term.length));
|
|
77
|
+
const innerLower = (offset: number): boolean => inner.some((at) => isLowered(source, term, offset, at));
|
|
78
|
+
const lower = later.filter((offset) => (isLowered(source, term, offset, 0) && !isSentenceStart(source, offset)) || innerLower(offset));
|
|
79
|
+
const capital = later.filter((offset) => source.charAt(offset) === term.charAt(0) && !innerLower(offset));
|
|
80
|
+
return lower.length > 0 && lower.length <= capital.length && lower.length <= limit ? lower : [];
|
|
64
81
|
};
|
|
65
82
|
|
|
66
83
|
/** How far back a sentence's start is looked for: past a few spaces to the mark before them. */
|
|
@@ -74,16 +91,22 @@ const isSentenceStart = (source: string, offset: number): boolean => {
|
|
|
74
91
|
return (offset < LOOK_BACK && text === "") || before.slice(text.length).includes("\n") || SENTENCE_END.has(text.at(-1) ?? "");
|
|
75
92
|
};
|
|
76
93
|
|
|
94
|
+
const definingSentence = (doc: ProseDocument, definition: Span): Sentence | undefined =>
|
|
95
|
+
doc.sentences.find((sentence) => sentence.span.start <= definition.start && definition.start < sentence.span.end);
|
|
96
|
+
|
|
77
97
|
/** Where the sentence holding the definition ends: a use inside it ("Customer" means the party named "Customer") belongs to the definition. */
|
|
78
|
-
const definingSentenceEnd = (doc: ProseDocument, definition: Span): number =>
|
|
79
|
-
doc.sentences.find((sentence) => sentence.span.start <= definition.start && definition.start < sentence.span.end)?.span.end ?? definition.end;
|
|
98
|
+
const definingSentenceEnd = (doc: ProseDocument, definition: Span): number => definingSentence(doc, definition)?.span.end ?? definition.end;
|
|
80
99
|
|
|
81
100
|
const VERBAL = new Set(["VERB", "AUX"]);
|
|
82
101
|
|
|
102
|
+
const tokensAt = (doc: ProseDocument, offset: number): { readonly tokens: readonly Token[]; readonly at: number } => {
|
|
103
|
+
const tokens = doc.sentences.find((candidate) => candidate.span.start <= offset && offset < candidate.span.end)?.tokens ?? [];
|
|
104
|
+
return { tokens, at: tokens.findIndex((candidate) => candidate.span.start <= offset && offset < candidate.span.end) };
|
|
105
|
+
};
|
|
106
|
+
|
|
83
107
|
/** A word used as a verb ("you input"), not the defined thing ("the Input"): a different word that shares the spelling. */
|
|
84
108
|
const isVerbAt = (doc: ProseDocument, offset: number): boolean => {
|
|
85
|
-
const tokens = doc
|
|
86
|
-
const at = tokens.findIndex((candidate) => candidate.span.start <= offset && offset < candidate.span.end);
|
|
109
|
+
const { tokens, at } = tokensAt(doc, offset);
|
|
87
110
|
const token = tokens[at];
|
|
88
111
|
if (token === undefined) return false;
|
|
89
112
|
// After a subject pronoun the word is its verb (you input), whatever the tagger says; after a possessive (your input) it is a noun.
|
|
@@ -92,6 +115,26 @@ const isVerbAt = (doc: ProseDocument, offset: number): boolean => {
|
|
|
92
115
|
return VERBAL.has(token.pos) || afterSubject;
|
|
93
116
|
};
|
|
94
117
|
|
|
118
|
+
const NAMING = new Set(["NOUN", "PROPN"]);
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* A lower-case phrase that starts with a noun and has no adjective before it (the records officer) names the defined thing.
|
|
122
|
+
* One that starts with an adjective or a possessive (its own confidential information, your content), or that an
|
|
123
|
+
* adjective narrows (additional terms of service), is the ordinary phrase.
|
|
124
|
+
*/
|
|
125
|
+
const isNamingAt = (doc: ProseDocument, offset: number): boolean => {
|
|
126
|
+
const { tokens, at } = tokensAt(doc, offset);
|
|
127
|
+
return NAMING.has(tokens[at]?.pos ?? "") && tokens[at - 1]?.pos !== "ADJ";
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/** The uses of the term, with those that write its later words in lower case (records officer for Records Officer), in order. */
|
|
131
|
+
const withLoweredWords = (doc: ProseDocument, term: string, texts: readonly BodyText[], spans: readonly Span[], uses: readonly number[]): number[] => {
|
|
132
|
+
const lowered = innerLowered(term);
|
|
133
|
+
if (lowered === term) return [...uses];
|
|
134
|
+
const more = usesOf(lowered, texts, spans, "loose").filter((offset) => !uses.includes(offset) && isNamingAt(doc, offset));
|
|
135
|
+
return [...uses, ...more].toSorted((left, right) => left - right);
|
|
136
|
+
};
|
|
137
|
+
|
|
95
138
|
/** The term written with another prefix of its group (本件業務 where 本業務 is defined), after the sentence that defines it. */
|
|
96
139
|
const prefixFindings = (doc: ProseDocument, texts: readonly BodyText[], term: DefinedTerm, definingEnd: number, defined: readonly string[]): Finding[] =>
|
|
97
140
|
prefixVariants(term.term, prefixGroupsOf(doc.lexicons["defined-term-prefix"] ?? [])).flatMap((variant) =>
|
|
@@ -102,6 +145,33 @@ const prefixFindings = (doc: ProseDocument, texts: readonly BodyText[], term: De
|
|
|
102
145
|
),
|
|
103
146
|
);
|
|
104
147
|
|
|
148
|
+
/** The term set in quotes again, unless the document's profile says a quoted term is the term mentioned (「株主」とあるのは). */
|
|
149
|
+
const quotedFindings = (doc: ProseDocument, term: DefinedTerm, uses: readonly number[], definingEnd: number): Finding[] =>
|
|
150
|
+
doc.profile?.quoteMentionsTerm === true
|
|
151
|
+
? []
|
|
152
|
+
: quotedUses(doc.source, term.term, uses, definingEnd).map((offset) =>
|
|
153
|
+
finding(doc, "defined-term-form", offset, "quoted", { term: term.term, line: term.line }),
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
/** The term written longer with a word of its definition (文書管理責任者, the Application), after the sentence that defines it. */
|
|
157
|
+
const extendedFindings = (doc: ProseDocument, texts: readonly BodyText[], term: DefinedTerm, spans: readonly Span[], defined: readonly string[]): Finding[] => {
|
|
158
|
+
const definition = definingSentence(doc, term.span)?.text ?? "";
|
|
159
|
+
const pointers = (doc.lexicons["defined-term-pointer"] ?? []).map((entry) => entry.pattern);
|
|
160
|
+
// Every sentence that defines the term (a second definition too) holds the long words it is defined from.
|
|
161
|
+
const defining = spans.map((span) => definingSentence(doc, span)?.span ?? span);
|
|
162
|
+
const definingEnd = definingSentenceEnd(doc, term.span);
|
|
163
|
+
return texts
|
|
164
|
+
.flatMap((text) => exactOffsets(text.text, text.start, term.term))
|
|
165
|
+
.filter((offset) => offset > definingEnd && !defining.some((span) => span.start <= offset && offset < span.end))
|
|
166
|
+
.flatMap((offset) => {
|
|
167
|
+
const before = extendedBefore(doc.source, offset, term.term, definition, pointers);
|
|
168
|
+
const written = before ?? (isSentenceStart(doc.source, offset) ? undefined : extendedAfter(doc.source, offset, term.term, definition));
|
|
169
|
+
if (written === undefined || defined.includes(written)) return [];
|
|
170
|
+
const start = before === undefined ? offset : offset + term.term.length - written.length;
|
|
171
|
+
return [finding(doc, "defined-term-form", start, "extended", { term: term.term, written, line: term.line })];
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
|
|
105
175
|
export const definedTermForm: Detector = (doc, options): Finding[] => {
|
|
106
176
|
if (doc.structure === undefined) return [];
|
|
107
177
|
const texts = bodyOf(doc);
|
|
@@ -110,14 +180,13 @@ export const definedTermForm: Detector = (doc, options): Finding[] => {
|
|
|
110
180
|
return firstDefinitions(terms).flatMap(({ term, spans }) => {
|
|
111
181
|
const uses = usesOf(term.term, texts, spans, "loose");
|
|
112
182
|
const definingEnd = definingSentenceEnd(doc, term.span);
|
|
113
|
-
const quoted =
|
|
114
|
-
|
|
115
|
-
);
|
|
116
|
-
const nounUses = uses.filter((offset) => !isVerbAt(doc, offset));
|
|
183
|
+
const quoted = quotedFindings(doc, term, uses, definingEnd);
|
|
184
|
+
const caseUses = withLoweredWords(doc, term.term, texts, spans, uses);
|
|
185
|
+
const nounUses = caseUses.filter((offset) => !isVerbAt(doc, offset));
|
|
117
186
|
const lower = lowerCaseUses(doc.source, term.term, nounUses, definingEnd, options.limit).map((offset) =>
|
|
118
187
|
finding(doc, "defined-term-form", offset, "case", { term: term.term, line: term.line }),
|
|
119
188
|
);
|
|
120
|
-
return [...quoted, ...lower, ...prefixFindings(doc, texts, term, definingEnd, defined)];
|
|
189
|
+
return [...quoted, ...lower, ...prefixFindings(doc, texts, term, definingEnd, defined), ...extendedFindings(doc, texts, term, spans, defined)];
|
|
121
190
|
});
|
|
122
191
|
};
|
|
123
192
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
|
-
import { definedTerms, unusedDefinitions, usesBeforeDefinition, type BodyText, type Mentioned } from "../structure/definition-use.ts";
|
|
2
|
+
import { definedTerms, unusedDefinitions, usesBeforeDefinition, type BodyText, type IsTitle, type Mentioned } from "../structure/definition-use.ts";
|
|
3
|
+
import { titleLineNumbers } from "../structure/title-lines.ts";
|
|
3
4
|
import { expansionConflicts, expansionsIn } from "../acronym-expansions.ts";
|
|
4
5
|
import { linesOf, lineNumberAt } from "../structure/lines.ts";
|
|
5
6
|
import { isQuotedAlone } from "../quoted-span.ts";
|
|
@@ -29,11 +30,18 @@ export const unusedDefinition: Detector = (doc): Finding[] =>
|
|
|
29
30
|
findingAt(doc, defined.span.start, { term: defined.term }),
|
|
30
31
|
);
|
|
31
32
|
|
|
33
|
+
/** 題・見出し(Markdown の見出し、章・節の行、条の前の見出しの行)の上の位置か。 */
|
|
34
|
+
const titleIn = (doc: ProseDocument): IsTitle => {
|
|
35
|
+
const lines = linesOf(doc.source);
|
|
36
|
+
const numbers = titleLineNumbers(doc.structure, lines, doc.markup?.headings ?? []);
|
|
37
|
+
return (offset) => numbers.has(lineNumberAt(lines, offset) ?? 0);
|
|
38
|
+
};
|
|
39
|
+
|
|
32
40
|
/** 文の途中で括弧に入れて定義した語を、定義より前で使っている所。 */
|
|
33
41
|
export const useBeforeDefinition: Detector = (doc): Finding[] =>
|
|
34
42
|
doc.structure === undefined
|
|
35
43
|
? []
|
|
36
|
-
: usesBeforeDefinition(definedTerms(doc.structure), bodyOf(doc), mentionedIn(doc)).map((use) =>
|
|
44
|
+
: usesBeforeDefinition(definedTerms(doc.structure), bodyOf(doc), mentionedIn(doc), titleIn(doc)).map((use) =>
|
|
37
45
|
findingAt(doc, use.offset, { term: use.term.term, defined: use.term.line }),
|
|
38
46
|
);
|
|
39
47
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// deprecated-option-used: a name the document calls deprecated, still used in one of its code examples
|
|
2
|
+
// (deprecated-use.ts). The words come from the deprecation-word and deprecation-negated lexicons.
|
|
3
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
4
|
+
import { deprecatedUses } from "../deprecated-use.ts";
|
|
5
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
6
|
+
|
|
7
|
+
const lowercase = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern.toLowerCase());
|
|
8
|
+
|
|
9
|
+
export const deprecatedUse: Detector = (doc): Finding[] =>
|
|
10
|
+
deprecatedUses(doc.source, { words: lowercase(doc, "deprecation-word"), negated: lowercase(doc, "deprecation-negated") }).map((use) => ({
|
|
11
|
+
rule: "deprecated-option-used",
|
|
12
|
+
severity: "warning",
|
|
13
|
+
line: 0,
|
|
14
|
+
column: 0,
|
|
15
|
+
quote: quoteAt(doc.source, use.offset),
|
|
16
|
+
values: { name: use.name, offset: use.offset },
|
|
17
|
+
}));
|
|
@@ -5,6 +5,18 @@ import { overlapsAny, spanIndex } from "../compare/spans.ts";
|
|
|
5
5
|
import { yearOf, type DurationUnit } from "../derived/date-arithmetic.ts";
|
|
6
6
|
import { durationMismatches, type DatedValue, type Duration } from "../derived/durations.ts";
|
|
7
7
|
import { elapsedMismatches, type Elapsed, type OriginWord, type Year } from "../derived/elapsed.ts";
|
|
8
|
+
import { numberWordCounts } from "../derived/number-word-counts.ts";
|
|
9
|
+
import {
|
|
10
|
+
nightsDaysMismatches,
|
|
11
|
+
nightsDaysPairs,
|
|
12
|
+
stayNightsMismatches,
|
|
13
|
+
tableNightsMismatches,
|
|
14
|
+
type Count,
|
|
15
|
+
type NightsMismatch,
|
|
16
|
+
type StayColumnWords,
|
|
17
|
+
} from "../derived/stays.ts";
|
|
18
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
19
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
8
20
|
import { quoteAt } from "./structure-tree.ts";
|
|
9
21
|
|
|
10
22
|
/** 期間の単位の語彙表。木の数量の単位がどれかに入れば、その単位の期間。 */
|
|
@@ -28,11 +40,28 @@ const endWithUnit = (source: string, end: number, unit: string): number => {
|
|
|
28
40
|
return unit !== "" && source.startsWith(unit, end + gap) ? end + gap + unit.length : end;
|
|
29
41
|
};
|
|
30
42
|
|
|
43
|
+
const OPEN_BRACKET = " (";
|
|
44
|
+
const WORD_LETTER = /[\p{L}-]/u;
|
|
45
|
+
|
|
46
|
+
/** Where the word before " (" starts ("six (" in "six (6) months"), or undefined when no word stands there. */
|
|
47
|
+
const wordStartBeforeBracket = (source: string, at: number): number | undefined => {
|
|
48
|
+
if (source.slice(Math.max(0, at - OPEN_BRACKET.length), at) !== OPEN_BRACKET) return undefined;
|
|
49
|
+
let start = at - OPEN_BRACKET.length;
|
|
50
|
+
while (start > 0 && WORD_LETTER.test(source.charAt(start - 1))) start -= 1;
|
|
51
|
+
return start < at - OPEN_BRACKET.length ? start : undefined;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** 「six (6) months」は語の数から単位まで。括弧の中の数だけでは、指摘に引いたとき何の期間か読めない。 */
|
|
55
|
+
const withWordsAround = (source: string, start: number, end: number, unit: string): Span => {
|
|
56
|
+
const wordStart = source.charAt(end) === ")" ? wordStartBeforeBracket(source, start) : undefined;
|
|
57
|
+
return wordStart === undefined ? { start, end: endWithUnit(source, end, unit) } : { start: wordStart, end: endWithUnit(source, end + 1, unit) };
|
|
58
|
+
};
|
|
59
|
+
|
|
31
60
|
const quantitiesOf = (tree: StructureNode, source: string): Quantity[] =>
|
|
32
61
|
inDocumentOrder(tree).flatMap((node): Quantity[] => {
|
|
33
62
|
if (node.kind !== "quantity") return [];
|
|
34
63
|
const unit = String(node.attrs["unit"] ?? "");
|
|
35
|
-
return [{
|
|
64
|
+
return [{ ...withWordsAround(source, node.span.start, node.span.end, unit), amount: Number(node.attrs["value"]), unit: unit.normalize("NFKC") }];
|
|
36
65
|
});
|
|
37
66
|
|
|
38
67
|
const datesOf = (tree: StructureNode): DatedValue[] =>
|
|
@@ -64,24 +93,87 @@ const durationsOf = (doc: ProseDocument, quantities: readonly Quantity[]): Durat
|
|
|
64
93
|
|
|
65
94
|
const sentencesOf = (doc: ProseDocument): Span[] => doc.sentences.map((sentence) => sentence.span);
|
|
66
95
|
|
|
67
|
-
|
|
96
|
+
const LATIN_UNIT = /^[a-z]+$/iu;
|
|
97
|
+
|
|
98
|
+
/** 数字と泊数の単位(3泊、3 nights)。英字の単位は語の切れ目まで。 */
|
|
99
|
+
const digitNights = (text: string, units: readonly string[]): Count[] =>
|
|
100
|
+
units.flatMap((unit) => {
|
|
101
|
+
const tail = LATIN_UNIT.test(unit) ? "(?![\\p{L}\\p{N}])" : "";
|
|
102
|
+
const pattern = new RegExp(`(?<![\\p{N}.,])(\\p{Nd}+)\\s?${escapeRegExp(unit)}${tail}`, "giu");
|
|
103
|
+
return [...text.matchAll(pattern)].map((match) => ({
|
|
104
|
+
start: match.index,
|
|
105
|
+
end: match.index + match[0].length,
|
|
106
|
+
amount: Number((match[1] ?? "").normalize("NFKC")),
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
/** 泊数(3泊、3 nights、three nights)。text は地の文と表(リンク先や code は読まない)。目安の泊数(最大3泊)は除く。 */
|
|
111
|
+
const nightsOf = (doc: ProseDocument, text: string): Count[] => {
|
|
112
|
+
const units = patternsOf(doc, "stay-night");
|
|
113
|
+
const digits = digitNights(text, units);
|
|
114
|
+
const taken = spanIndex(digits);
|
|
115
|
+
const worded = numberWordCounts(text, patternsOf(doc, "count-number"), units).filter((count) => !overlapsAny(taken, count));
|
|
116
|
+
return [...digits, ...worded].filter((count) => !isApproximate(doc, count)).toSorted((left, right) => left.start - right.start);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const finding = (doc: ProseDocument, offset: number, values: Record<string, string | number>, variant?: string): Finding => ({
|
|
120
|
+
rule: "duration-mismatch",
|
|
121
|
+
severity: "warning",
|
|
122
|
+
line: 0,
|
|
123
|
+
column: 0,
|
|
124
|
+
quote: quoteAt(doc.source, offset),
|
|
125
|
+
...(variant === undefined ? {} : { variant }),
|
|
126
|
+
values: { ...values, offset },
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const written = (doc: ProseDocument, span: Span): string => doc.source.slice(span.start, span.end);
|
|
130
|
+
|
|
131
|
+
const nightsFinding = (doc: ProseDocument, mismatch: NightsMismatch): Finding =>
|
|
132
|
+
finding(
|
|
133
|
+
doc,
|
|
134
|
+
mismatch.nights.start,
|
|
135
|
+
{ start: written(doc, mismatch.start), end: written(doc, mismatch.end), nights: written(doc, mismatch.nights).trim(), expected: mismatch.expected },
|
|
136
|
+
"nights",
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
const stayColumnWords = (doc: ProseDocument): StayColumnWords => ({
|
|
140
|
+
checkIn: patternsOf(doc, "stay-check-in-column"),
|
|
141
|
+
checkOut: patternsOf(doc, "stay-check-out-column"),
|
|
142
|
+
nights: patternsOf(doc, "stay-nights-column"),
|
|
143
|
+
units: patternsOf(doc, "stay-night"),
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
/** 始まり + 期間 ≠ 終わり。泊数が二つの日付の差と合わない。「2泊3日」の日数が泊数より一つ多くない。 */
|
|
68
147
|
export const durationMismatch: Detector = (doc): Finding[] => {
|
|
69
148
|
if (doc.structure === undefined) return [];
|
|
149
|
+
const dates = datesOf(doc.structure);
|
|
70
150
|
const durations = durationsOf(doc, quantitiesOf(doc.structure, doc.source));
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
151
|
+
const proseAndTables = proseAndTablesOf(doc);
|
|
152
|
+
const nights = nightsOf(doc, proseAndTables);
|
|
153
|
+
const pairs = nightsDaysPairs(
|
|
154
|
+
doc.source,
|
|
155
|
+
nights,
|
|
156
|
+
durations.filter((duration) => duration.unit === "day"),
|
|
157
|
+
patternsOf(doc, "stay-pair-joiner"),
|
|
158
|
+
);
|
|
159
|
+
const pairedDays = spanIndex(pairs.map((pair) => pair.days));
|
|
160
|
+
const lengths = durationMismatches(
|
|
161
|
+
sentencesOf(doc),
|
|
162
|
+
dates,
|
|
163
|
+
durations.filter((duration) => !overlapsAny(pairedDays, duration)),
|
|
164
|
+
).map((mismatch) =>
|
|
165
|
+
finding(doc, mismatch.end.start, {
|
|
166
|
+
start: written(doc, mismatch.start),
|
|
167
|
+
duration: written(doc, mismatch.duration),
|
|
168
|
+
end: written(doc, mismatch.end),
|
|
81
169
|
expected: mismatch.expected,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
170
|
+
}),
|
|
171
|
+
);
|
|
172
|
+
const stays = [...stayNightsMismatches(sentencesOf(doc), dates, nights), ...tableNightsMismatches(proseAndTables, dates, stayColumnWords(doc))];
|
|
173
|
+
const nightsDays = nightsDaysMismatches(pairs).map((mismatch) =>
|
|
174
|
+
finding(doc, mismatch.days.start, { nights: written(doc, mismatch.nights), days: written(doc, mismatch.days), expected: mismatch.expected }, "nights-days"),
|
|
175
|
+
);
|
|
176
|
+
return [...lengths, ...stays.map((mismatch) => nightsFinding(doc, mismatch)), ...nightsDays];
|
|
85
177
|
};
|
|
86
178
|
|
|
87
179
|
/** 四桁の年。木が日付と読まなかった英語の年(founded in 2015、born 1980)もここで読む。 */
|
|
@@ -122,8 +214,14 @@ const isAge = (doc: ProseDocument, quantity: Quantity): boolean =>
|
|
|
122
214
|
positioned(doc, "age-marker", "before").some((word) => textBefore(doc, quantity).endsWith(word)) ||
|
|
123
215
|
positioned(doc, "age-marker", "after").some((word) => textAfter(doc, quantity).startsWith(word));
|
|
124
216
|
|
|
125
|
-
|
|
126
|
-
|
|
217
|
+
/** 年数: 単位が年数の語の数量(10 years、創業10年)と、木が読まない語で書いた数(ten years)。 */
|
|
218
|
+
const elapsedOf = (doc: ProseDocument, quantities: readonly Quantity[]): Elapsed[] => {
|
|
219
|
+
const units = patternsOf(doc, "elapsed-unit");
|
|
220
|
+
const counted = quantities.filter((quantity) => !isAge(doc, quantity) && units.some((unit) => unit.normalize("NFKC") === quantity.unit));
|
|
221
|
+
const taken = spanIndex(quantities);
|
|
222
|
+
const worded = numberWordCounts(doc.source, patternsOf(doc, "count-number"), units).filter((count) => !overlapsAny(taken, count));
|
|
223
|
+
return [...counted, ...worded].toSorted((left, right) => left.start - right.start);
|
|
224
|
+
};
|
|
127
225
|
|
|
128
226
|
/** 「aged 45」の 45: 英語の木は単位の無い数を読まないので、年齢の印のすぐ後ろの数を読む。 */
|
|
129
227
|
const AGE_NUMBER = /^\s*(\d{1,3})(?!\d)/u;
|
|
@@ -86,6 +86,11 @@ const SENTENCES_INSIDE = /[。.!?](?=\s*\S)|\p{Ll}{2}[.!?]["'”’)]?\s+[
|
|
|
86
86
|
|
|
87
87
|
export const isParagraphHeading = (heading: string): boolean => SENTENCES_INSIDE.test(heading.trim());
|
|
88
88
|
|
|
89
|
+
/** A heading that asks a question: its length is the reader's question, not a name to shorten (FAQ, "Will this … increase …?"). */
|
|
90
|
+
const QUESTION_END = /[??]["'”’))」』]*$/u;
|
|
91
|
+
|
|
92
|
+
export const isQuestionHeading = (heading: string): boolean => QUESTION_END.test(heading.trim());
|
|
93
|
+
|
|
89
94
|
/** The heading's words without a number label at its head (Chapter 2, 1.), from the section the heading opens. */
|
|
90
95
|
const unlabeledOf = (doc: ProseDocument, heading: MarkupHeading): string =>
|
|
91
96
|
doc.sections.find((section) => section.span.start === heading.end)?.unlabeledHeading ?? heading.text;
|
|
@@ -96,7 +101,7 @@ export const titleLength: Detector = (doc, options): Finding[] => {
|
|
|
96
101
|
const title = headings.find((heading) => heading.depth === 1);
|
|
97
102
|
return headings
|
|
98
103
|
.map((heading) => ({ heading, words: unlabeledOf(doc, heading) }))
|
|
99
|
-
.filter(({ words }) => !isParagraphHeading(words))
|
|
104
|
+
.filter(({ words }) => !isParagraphHeading(words) && !isQuestionHeading(words))
|
|
100
105
|
.map(({ heading, words }) => ({ heading, count: headingLength(words, doc.lengthUnit) }))
|
|
101
106
|
.filter(({ count }) => count > options.limit)
|
|
102
107
|
.map(({ heading, count }) => ({
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// due-before-issue: the reading half. The issue-date and due-date words come from the language's lexicons
|
|
2
|
+
// (issue-date-label, due-date-label, deadline-passed-word), and so do the words of minutes (minutes-title-word, meeting-date-label,
|
|
3
|
+
// action-section-heading, earlier-section-word, action-due-label, item-done-word); the dates are the structure tree's, and the
|
|
4
|
+
// lines are read with code masked.
|
|
5
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
6
|
+
import { actionDueBeforeMeeting, type ActionWords } from "../structure/action-due.ts";
|
|
7
|
+
import { dueBeforeIssue, type DueWords } from "../structure/due-date.ts";
|
|
8
|
+
import type { StructureIssue } from "../structure/issues.ts";
|
|
9
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
10
|
+
import { datedPoints, quoteAt } from "./structure-tree.ts";
|
|
11
|
+
|
|
12
|
+
const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
|
|
13
|
+
|
|
14
|
+
const wordsOf = (doc: ProseDocument): DueWords => ({
|
|
15
|
+
issue: patternsOf(doc, "issue-date-label"),
|
|
16
|
+
due: patternsOf(doc, "due-date-label"),
|
|
17
|
+
passed: patternsOf(doc, "deadline-passed-word"),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const actionWordsOf = (doc: ProseDocument): ActionWords => ({
|
|
21
|
+
meeting: patternsOf(doc, "meeting-date-label"),
|
|
22
|
+
section: patternsOf(doc, "action-section-heading"),
|
|
23
|
+
earlier: patternsOf(doc, "earlier-section-word"),
|
|
24
|
+
due: patternsOf(doc, "action-due-label"),
|
|
25
|
+
done: patternsOf(doc, "item-done-word"),
|
|
26
|
+
minutes: patternsOf(doc, "minutes-title-word"),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const findingOf = (doc: ProseDocument, issue: StructureIssue, variant?: string): Finding => ({
|
|
30
|
+
rule: "due-before-issue",
|
|
31
|
+
severity: "error",
|
|
32
|
+
line: 0,
|
|
33
|
+
column: 0,
|
|
34
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
35
|
+
values: { ...issue.values, offset: issue.offset },
|
|
36
|
+
...(variant === undefined ? {} : { variant }),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const dueDate: Detector = (doc): Finding[] => {
|
|
40
|
+
if (doc.structure === undefined) return [];
|
|
41
|
+
const text = proseAndTablesOf(doc);
|
|
42
|
+
const dates = datedPoints(doc.structure);
|
|
43
|
+
return [
|
|
44
|
+
...dueBeforeIssue(text, dates, wordsOf(doc)).map((issue) => findingOf(doc, issue)),
|
|
45
|
+
...actionDueBeforeMeeting(text, dates, doc.markup?.headings ?? [], actionWordsOf(doc)).map((issue) => findingOf(doc, issue, "meeting")),
|
|
46
|
+
];
|
|
47
|
+
};
|