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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// A defined term written longer, with a word of its own definition added: 文書管理責任者 where 「管理責任者」とは、…文書の
|
|
2
|
+
// 管理の責任者をいう is defined, the Application where the Pinecone Notes application (the "App") is. The reader cannot tell
|
|
3
|
+
// whether the longer word is the defined thing or another one. Pure.
|
|
4
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
5
|
+
|
|
6
|
+
/** The letters a Japanese compound is made of: a word written right before the term joins it into one longer word. */
|
|
7
|
+
const COMPOUND_CHAR = /[\p{Script=Han}\p{Script=Katakana}ー]/u;
|
|
8
|
+
const LATIN_LETTER = /\p{Script=Latin}/u;
|
|
9
|
+
const UPPER_START = /^\p{Lu}/u;
|
|
10
|
+
/** An added part shorter than this (書, the s of Services) is an ending or one character, not a word of the definition. */
|
|
11
|
+
const MIN_ADDED = 2;
|
|
12
|
+
/** A term shorter than this (提供, 登録) is an ordinary word that joins other words freely (情報提供, 利用登録). */
|
|
13
|
+
const MIN_COMPOUND_TERM = 3;
|
|
14
|
+
/** A plural ending (Boxes) is the same word, not a longer one. */
|
|
15
|
+
const PLURAL = /^e?s$/u;
|
|
16
|
+
|
|
17
|
+
/** The whole character that starts at, or ends right before, a position: both halves of 𠮷, not one. */
|
|
18
|
+
const charFrom = (source: string, at: number): string => String.fromCodePoint(source.codePointAt(at) ?? 0);
|
|
19
|
+
const charBefore = (source: string, at: number): string => {
|
|
20
|
+
const low = source.charCodeAt(at - 1);
|
|
21
|
+
const isLowHalf = low >= 0xdc00 && low <= 0xdfff && at >= 2;
|
|
22
|
+
return isLowHalf ? source.slice(at - 2, at) : source.charAt(at - 1);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** Where the run of compound characters that ends at offset starts. */
|
|
26
|
+
const runStart = (source: string, offset: number): number => {
|
|
27
|
+
let start = offset;
|
|
28
|
+
for (let char = charBefore(source, start); start > 0 && COMPOUND_CHAR.test(char); char = charBefore(source, start)) start -= char.length;
|
|
29
|
+
return start;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** The endings of a run, longest first, that are long enough to be a word added to the term. */
|
|
33
|
+
const endingsOf = (run: string): string[] => Array.from({ length: Math.max(0, run.length - MIN_ADDED + 1) }, (_, index) => run.slice(index));
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The term at offset written with more in front of it in one word (文書管理責任者), when what is in front ends with a word of
|
|
37
|
+
* the definition (文書). A word that points at one of the defined things (当該管理責任者) does not lengthen it, and a longer
|
|
38
|
+
* word the definition itself writes (東京都(以下「都」という。)) is the long name, not another form of the term.
|
|
39
|
+
*/
|
|
40
|
+
export const extendedBefore = (source: string, offset: number, term: string, definition: string, pointers: readonly string[] = []): string | undefined => {
|
|
41
|
+
if ([...term].length < MIN_COMPOUND_TERM || COMPOUND_CHAR.test(charFrom(source, offset + term.length))) return undefined;
|
|
42
|
+
const run = source.slice(runStart(source, offset), offset);
|
|
43
|
+
const added = endingsOf(run).find((part) => definition.includes(part) && !pointers.some((pointer) => part.startsWith(pointer)));
|
|
44
|
+
const written = added === undefined ? undefined : `${added}${term}`;
|
|
45
|
+
return written === undefined || definition.includes(written) ? undefined : written;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The capitalised term at offset written with more letters after it in one word (App → Application), when the definition
|
|
50
|
+
* has that longer word (the Pinecone Notes application). A plural or a word joined to letters before it is not one.
|
|
51
|
+
*/
|
|
52
|
+
export const extendedAfter = (source: string, offset: number, term: string, definition: string): string | undefined => {
|
|
53
|
+
if (!UPPER_START.test(term) || LATIN_LETTER.test(source.charAt(offset - 1))) return undefined;
|
|
54
|
+
let end = offset + term.length;
|
|
55
|
+
while (LATIN_LETTER.test(source.charAt(end))) end += 1;
|
|
56
|
+
const added = source.slice(offset + term.length, end);
|
|
57
|
+
if (added.length < MIN_ADDED || PLURAL.test(added)) return undefined;
|
|
58
|
+
const word = source.slice(offset, end);
|
|
59
|
+
return new RegExp(String.raw`(?<!\p{L})${escapeRegExp(word)}(?!\p{L})`, "iu").test(definition) ? word : undefined;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** Each place the term is written exactly, in order. */
|
|
63
|
+
export const exactOffsets = (text: string, start: number, term: string): number[] => {
|
|
64
|
+
const offsets: number[] = [];
|
|
65
|
+
for (let at = text.indexOf(term); at !== -1 && term !== ""; at = text.indexOf(term, at + term.length)) offsets.push(start + at);
|
|
66
|
+
return offsets;
|
|
67
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
|
+
import type { StructureIssue } from "../structure/issues.ts";
|
|
3
|
+
import { inDocumentOrder } from "../structure/issues.ts";
|
|
4
|
+
import { clockTimes } from "../compare/clock-time.ts";
|
|
5
|
+
import { secondsOf, type DateSpan, type Mark, type TimeSpan, type TimeWords } from "../structure/time-marks.ts";
|
|
6
|
+
import { timeOrderBreaks } from "../structure/time-order.ts";
|
|
7
|
+
import { arrivalsBeforeDeparture } from "../structure/leg-times.ts";
|
|
8
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
9
|
+
|
|
10
|
+
// 一日の予定の時刻の順番(time-order)と、発より前の着(arrival-before-departure)。時刻は compare/clock-time.ts が読み、
|
|
11
|
+
// 発着・翌日・時間帯の語は言語パッケージの語彙表(leg-mark、leg-column、day-shift-mark、time-zone、local-time-mark)から取る。
|
|
12
|
+
|
|
13
|
+
const marksOf = (doc: ProseDocument, lexicon: string): Mark[] =>
|
|
14
|
+
(doc.lexicons[lexicon] ?? []).map((entry) => ({ pattern: entry.pattern, position: entry.position, group: entry.group }));
|
|
15
|
+
|
|
16
|
+
const timeWordsOf = (doc: ProseDocument): TimeWords => ({
|
|
17
|
+
legs: marksOf(doc, "leg-mark"),
|
|
18
|
+
columns: marksOf(doc, "leg-column"),
|
|
19
|
+
dayShifts: marksOf(doc, "day-shift-mark"),
|
|
20
|
+
zones: [...marksOf(doc, "time-zone"), ...marksOf(doc, "local-time-mark").map((mark) => ({ ...mark, group: "local" }))],
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const datesOf = (doc: ProseDocument): DateSpan[] =>
|
|
24
|
+
doc.structure === undefined
|
|
25
|
+
? []
|
|
26
|
+
: inDocumentOrder(doc.structure).flatMap((node) =>
|
|
27
|
+
node.kind === "date" ? [{ start: node.span.start, end: node.span.end, value: String(node.attrs["value"]) }] : [],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const timesOf = (text: string): TimeSpan[] => clockTimes(text).map((time) => ({ start: time.start, end: time.end, seconds: secondsOf(time.key) }));
|
|
31
|
+
|
|
32
|
+
type Finder = (source: string, times: readonly TimeSpan[], dates: readonly DateSpan[], words: TimeWords) => StructureIssue[];
|
|
33
|
+
|
|
34
|
+
/** 表と箇条書きを行のまま読むので、原文を渡す(doc.prose は表を覆う)。 */
|
|
35
|
+
const detectorOf =
|
|
36
|
+
(rule: string, find: Finder): Detector =>
|
|
37
|
+
(doc): Finding[] =>
|
|
38
|
+
find(doc.source, timesOf(doc.source), datesOf(doc), timeWordsOf(doc)).map((issue) => ({
|
|
39
|
+
rule,
|
|
40
|
+
severity: "warning",
|
|
41
|
+
line: 0,
|
|
42
|
+
column: 0,
|
|
43
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
44
|
+
values: { ...issue.values, offset: issue.offset },
|
|
45
|
+
...("next" in issue.values ? { variant: "first" } : {}),
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
export const timeOrder: Detector = detectorOf("time-order", timeOrderBreaks);
|
|
49
|
+
export const arrivalBeforeDeparture: Detector = detectorOf("arrival-before-departure", arrivalsBeforeDeparture);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// ui-label-variant: one label on the screen written two ways in a manual (ui-labels.ts). The words a label is written with or
|
|
2
|
+
// without come from the language's label-particle lexicon.
|
|
3
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
4
|
+
import { labelsIn, labelVariants } from "../ui-labels.ts";
|
|
5
|
+
import type { Detector, Finding } from "../plugin.ts";
|
|
6
|
+
|
|
7
|
+
export const uiLabel: Detector = (doc): Finding[] => {
|
|
8
|
+
const particles = (doc.lexicons["label-particle"] ?? []).map((entry) => entry.pattern);
|
|
9
|
+
return labelVariants(labelsIn(doc.source, doc.prose ?? doc.source), particles).map(({ label, usual }) => ({
|
|
10
|
+
rule: "ui-label-variant",
|
|
11
|
+
severity: "info",
|
|
12
|
+
line: 0,
|
|
13
|
+
column: 0,
|
|
14
|
+
quote: quoteAt(doc.source, label.offset),
|
|
15
|
+
values: { written: label.surface, usual, offset: label.offset },
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
@@ -4,6 +4,7 @@ import { escapeRegExp } from "../orthography.ts";
|
|
|
4
4
|
import { quoteAround } from "./quote-around.ts";
|
|
5
5
|
import { mergeSpans } from "../span-merge.ts";
|
|
6
6
|
import { firstEndingAfter } from "../soft-break.ts";
|
|
7
|
+
import { isLabelClose, isLabelInAside } from "./bracket-label.ts";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* 括弧の組。どの言語でも同じ字の決まりなので、語彙表ではなくここに置く。family は形(丸・角)で、全角と半角は同じ形の別の幅。
|
|
@@ -48,31 +49,23 @@ export type BracketProblem = {
|
|
|
48
49
|
type Open = { readonly bracket: Bracket; readonly offset: number };
|
|
49
50
|
type Scan = { readonly open: Open[]; readonly problems: BracketProblem[] };
|
|
50
51
|
|
|
51
|
-
/**
|
|
52
|
-
* 丸括弧の閉じの前の、行の頭か空白・句読点の後ろに書いた短い印(「1)」「a)」「事例)」「※)」)と、数の後ろの閉じ(「事例2)及び事例3)」)。
|
|
53
|
-
* 箇条の番号や見出しの印で、開きを持たない書き方。顔文字の「:)」も同じ形。印に使うのは丸括弧だけ。
|
|
54
|
-
*/
|
|
55
|
-
const LABEL_BEFORE = /(?:^|[\s、。,;::])[^\s()()[\][]「」『』]{1,3}[ \t\u3000]?$|[\d0-9]$/u;
|
|
56
|
-
|
|
57
|
-
const isLabel = (text: string, bracket: Bracket, offset: number): boolean => {
|
|
58
|
-
if (bracket.family !== "round") return false;
|
|
59
|
-
const lineStart = text.lastIndexOf("\n", offset - 1) + 1;
|
|
60
|
-
return LABEL_BEFORE.test(text.slice(lineStart, offset));
|
|
61
|
-
};
|
|
62
|
-
|
|
63
52
|
const unclosedOf = (entry: Open): BracketProblem => ({ kind: "unclosed", offset: entry.offset, mark: entry.bracket.open });
|
|
64
53
|
|
|
65
54
|
const closeWith = (scan: Scan, text: string, bracket: Bracket, offset: number): void => {
|
|
66
55
|
const at = scan.open.findLastIndex((entry) => entry.bracket.family === bracket.family);
|
|
56
|
+
const round = bracket.family === "round";
|
|
67
57
|
if (at === -1) {
|
|
68
|
-
if (!
|
|
58
|
+
if (!(round && isLabelClose(text, offset))) scan.problems.push({ kind: "unopened", offset, mark: bracket.close });
|
|
69
59
|
return;
|
|
70
60
|
}
|
|
61
|
+
if (round && isLabelInAside(text, offset, scan.open.filter((entry) => entry.bracket.family === "round").length)) return;
|
|
71
62
|
const opened = scan.open[at];
|
|
72
|
-
//
|
|
63
|
+
// 間に残った開きは、この閉じより先に閉じるはずだったもの。ただし引用の閉じのすぐ前の開きは、括弧の字そのものを
|
|
64
|
+
// 引いたもの(法令の読替え「取締役(」とあるのは「清算人(」と)で、組を作らない。
|
|
73
65
|
scan.open
|
|
74
66
|
.splice(at)
|
|
75
67
|
.slice(1)
|
|
68
|
+
.filter((inner) => !(QUOTATIONS.has(bracket.family) && inner.offset === offset - 1))
|
|
76
69
|
.forEach((inner) => scan.problems.push(unclosedOf(inner)));
|
|
77
70
|
if (opened !== undefined && opened.bracket !== bracket) scan.problems.push({ kind: "mismatch", offset, mark: bracket.close, partner: opened.bracket.open });
|
|
78
71
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// undefined-function-call: a function called in a code example that the page never defines, where the page documents
|
|
2
|
+
// one whose name it extends (wrapText( on a page about wrap) (undefined-call.ts). The functions a programming language
|
|
3
|
+
// provides come from the code-global lexicon.
|
|
4
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
5
|
+
import { undefinedCalls } from "../undefined-call.ts";
|
|
6
|
+
import type { Detector, Finding } from "../plugin.ts";
|
|
7
|
+
|
|
8
|
+
export const undefinedCall: Detector = (doc): Finding[] => {
|
|
9
|
+
const headings = (doc.markup?.headings ?? []).map((heading) => heading.text);
|
|
10
|
+
const globals = (doc.lexicons["code-global"] ?? []).map((entry) => entry.pattern);
|
|
11
|
+
return undefinedCalls(doc.source, headings, globals).map((call) => ({
|
|
12
|
+
rule: "undefined-function-call",
|
|
13
|
+
severity: "warning",
|
|
14
|
+
line: 0,
|
|
15
|
+
column: 0,
|
|
16
|
+
quote: quoteAt(doc.source, call.offset),
|
|
17
|
+
values: { name: call.name, documented: call.documented, offset: call.offset },
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// A term written as a defined term but defined nowhere: 本成果物 in a contract that defines 本業務 and 本契約 but no
|
|
2
|
+
// 本成果物. The document's own prefix for its defined terms (本, 本件: the language package's defined-term-prefix list)
|
|
3
|
+
// marks a word as one of its terms; a term with that prefix and no definition leaves the reader asking what it is.
|
|
4
|
+
// Only the document's own references (本条, 本契約: self-reference-noun and document-kind) are left. Pure; the parts of
|
|
5
|
+
// speech decide where a prefix is a prefix (本 in 本成果物) and not part of a word (本人, 本日).
|
|
6
|
+
import { definedTerms } from "../structure/definition-use.ts";
|
|
7
|
+
import { prefixGroupsOf, prefixVariants } from "../structure/term-prefix.ts";
|
|
8
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
9
|
+
import type { Detector, Finding, ProseDocument, Token } from "../plugin.ts";
|
|
10
|
+
|
|
11
|
+
export type UndefinedTerm = { readonly offset: number; readonly term: string };
|
|
12
|
+
|
|
13
|
+
const NOUNS = new Set(["NOUN", "PROPN"]);
|
|
14
|
+
const QUOTE_PAIRS = [
|
|
15
|
+
["「", "」"],
|
|
16
|
+
["『", "』"],
|
|
17
|
+
['"', '"'],
|
|
18
|
+
["“", "”"],
|
|
19
|
+
] as const;
|
|
20
|
+
|
|
21
|
+
const isNoun = (token: Token | undefined): token is Token => token !== undefined && NOUNS.has(token.pos);
|
|
22
|
+
|
|
23
|
+
/** A defined term whose rest after the prefix is shorter than this (本人, 本日) is a word, not the document's way of naming terms. */
|
|
24
|
+
const MIN_REST = 2;
|
|
25
|
+
|
|
26
|
+
/** A prefix written right after a noun is inside a longer word, not a prefix. */
|
|
27
|
+
const continuesWord = (before: Token | undefined, token: Token): boolean => isNoun(before) && before.span.end === token.span.start;
|
|
28
|
+
|
|
29
|
+
/** The term a prefix token starts: the prefix and the nouns written right after it (本 成果 物). */
|
|
30
|
+
const termAt = (source: string, tokens: readonly Token[], index: number): { readonly offset: number; readonly term: string } | undefined => {
|
|
31
|
+
const prefix = tokens[index];
|
|
32
|
+
if (prefix === undefined) return undefined;
|
|
33
|
+
const run = tokens.slice(index + 1);
|
|
34
|
+
const length = run.findIndex((token, at) => !isNoun(token) || token.span.start !== (run[at - 1] ?? prefix).span.end);
|
|
35
|
+
const last = run[(length === -1 ? run.length : length) - 1];
|
|
36
|
+
return last === undefined ? undefined : { offset: prefix.span.start, term: source.slice(prefix.span.start, last.span.end) };
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** What the decision needs from the document and its word lists. */
|
|
40
|
+
export type TermWords = {
|
|
41
|
+
readonly prefixes: readonly string[];
|
|
42
|
+
readonly prefixGroups: readonly (readonly string[])[];
|
|
43
|
+
/** What the document calls itself and its parts after a prefix (本条, 本契約, 本利用規約); never one of its terms. */
|
|
44
|
+
readonly selfNouns: readonly string[];
|
|
45
|
+
/** The term is set in quotes somewhere (「本情報」): defined in a form the structure did not read, or named on purpose. */
|
|
46
|
+
readonly isQuoted: (term: string) => boolean;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** The defined terms and their other-prefix forms (本件業務 for 本業務), which defined-term-form reads. */
|
|
50
|
+
const knownForms = (defined: readonly string[], groups: TermWords["prefixGroups"]): string[] => [
|
|
51
|
+
...defined,
|
|
52
|
+
...defined.flatMap((term) => prefixVariants(term, groups)),
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The first use of each term written with the document's prefix and defined nowhere, when the document defines at
|
|
57
|
+
* least one term with that prefix (else the prefix is not its way of naming terms). A use that starts with a known
|
|
58
|
+
* form (本サービス上 where 本サービス is defined) is that term.
|
|
59
|
+
*/
|
|
60
|
+
export const undefinedTerms = (source: string, sentences: readonly (readonly Token[])[], defined: readonly string[], words: TermWords): UndefinedTerm[] => {
|
|
61
|
+
const prefixes = words.prefixes.filter((prefix) => prefix !== "");
|
|
62
|
+
const prefixed = defined.filter((term) => prefixes.some((prefix) => term.startsWith(prefix) && Array.from(term.slice(prefix.length)).length >= MIN_REST));
|
|
63
|
+
if (prefixed.length === 0) return [];
|
|
64
|
+
const known = knownForms(defined, words.prefixGroups);
|
|
65
|
+
const isSelf = (term: string, prefix: string): boolean => {
|
|
66
|
+
const rest = term.slice(prefix.length);
|
|
67
|
+
return words.selfNouns.some((noun) => noun !== "" && (rest.startsWith(noun) || rest.endsWith(noun)));
|
|
68
|
+
};
|
|
69
|
+
const uses = sentences.flatMap((tokens) =>
|
|
70
|
+
tokens.flatMap((token, index) => {
|
|
71
|
+
if (!prefixes.includes(token.surface) || !isNoun(tokens[index + 1]) || continuesWord(tokens[index - 1], token)) return [];
|
|
72
|
+
const use = termAt(source, tokens, index);
|
|
73
|
+
if (use === undefined || isSelf(use.term, token.surface) || words.isQuoted(use.term)) return [];
|
|
74
|
+
if (known.some((form) => use.term.startsWith(form) || form.startsWith(use.term))) return [];
|
|
75
|
+
return [use];
|
|
76
|
+
}),
|
|
77
|
+
);
|
|
78
|
+
return uses.filter((use, index) => uses.findIndex((other) => other.term === use.term) === index);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
|
|
82
|
+
|
|
83
|
+
const findingOf = (doc: ProseDocument, use: UndefinedTerm): Finding => ({
|
|
84
|
+
rule: "undefined-term",
|
|
85
|
+
severity: "info",
|
|
86
|
+
line: 0,
|
|
87
|
+
column: 0,
|
|
88
|
+
quote: quoteAt(doc.source, use.offset),
|
|
89
|
+
values: { term: use.term, offset: use.offset },
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export const undefinedTerm: Detector = (doc): Finding[] => {
|
|
93
|
+
if (doc.structure === undefined) return [];
|
|
94
|
+
const prefixEntries = doc.lexicons["defined-term-prefix"] ?? [];
|
|
95
|
+
const sentences = doc.sentences.map((sentence) => sentence.tokens ?? []);
|
|
96
|
+
const defined = definedTerms(doc.structure).map((term) => term.term);
|
|
97
|
+
return undefinedTerms(doc.source, sentences, defined, {
|
|
98
|
+
prefixes: prefixEntries.map((entry) => entry.pattern),
|
|
99
|
+
prefixGroups: prefixGroupsOf(prefixEntries),
|
|
100
|
+
selfNouns: [...patternsOf(doc, "self-reference-noun"), ...patternsOf(doc, "document-kind")],
|
|
101
|
+
isQuoted: (term) => QUOTE_PAIRS.some(([open, close]) => doc.source.includes(`${open}${term}${close}`)),
|
|
102
|
+
}).map((use) => findingOf(doc, use));
|
|
103
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
|
-
import { isKnownWord, suggestionFor, wordsToCheck, type CheckedWord, type Speller } from "../spelling.ts";
|
|
2
|
+
import { isKnownWord, isSplitWord, suggestionFor, wordsToCheck, type CheckedWord, type Speller } from "../spelling.ts";
|
|
3
3
|
import { quoteAt } from "./structure-tree.ts";
|
|
4
4
|
|
|
5
5
|
/** これより短い語は見ない。短い語は一字違いの語が多すぎて言い直しが決まらず(tost は test か toast か)、略した語(impl)も多い。 */
|
|
@@ -26,13 +26,13 @@ const usedOnce = (words: readonly CheckedWord[]): CheckedWord[] => {
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* 辞書に無い英語の語で、一字違いの辞書の語があるもの(recieve → receive)。辞書は adapter が持ち、無い言語では動かない。
|
|
29
|
-
* 大文字を含む語(固有名詞・略語)、コード・URL
|
|
29
|
+
* 大文字を含む語(固有名詞・略語)、コード・URL の中、頭の字を分けた語の残り、二度以上使う語、言い直しの無い語は言わない。
|
|
30
30
|
*/
|
|
31
31
|
export const unknownWord: Detector = (doc): Finding[] => {
|
|
32
32
|
if (doc.dictionary === undefined) return [];
|
|
33
33
|
const speller = spellerOf(doc, doc.dictionary());
|
|
34
34
|
const known = new Set(patternsOf(doc, "known-misspelling"));
|
|
35
|
-
const words = wordsToCheck(doc.prose ?? doc.source, MIN_LENGTH, MAX_LENGTH);
|
|
35
|
+
const words = wordsToCheck(doc.prose ?? doc.source, MIN_LENGTH, MAX_LENGTH).filter(({ offset }) => !isSplitWord(doc.source, offset));
|
|
36
36
|
const used = new Set(words.map(({ word }) => word).filter((word) => isKnownWord(word, speller)));
|
|
37
37
|
return usedOnce(words).flatMap(({ offset, word }) => {
|
|
38
38
|
if (known.has(word) || isKnownWord(word, speller)) return [];
|
|
@@ -68,12 +68,12 @@ const concreteIn = (lower: string, entry: string): boolean => {
|
|
|
68
68
|
);
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const statesConcrete = (text: Text, concrete: readonly string[]): boolean => {
|
|
71
|
+
export const statesConcrete = (text: Text, concrete: readonly string[]): boolean => {
|
|
72
72
|
const lower = text.text.toLowerCase();
|
|
73
73
|
return concrete.some((entry) => concreteIn(lower, entry));
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
const grantsRight = (text: Text, permissions: readonly LexiconEntry[]): boolean => {
|
|
76
|
+
export const grantsRight = (text: Text, permissions: readonly LexiconEntry[]): boolean => {
|
|
77
77
|
const lower = text.text.toLowerCase();
|
|
78
78
|
const ending = withoutEnding(lower);
|
|
79
79
|
return permissions
|
|
@@ -86,7 +86,7 @@ const isInsideLonger = (hit: Hit, hits: readonly Hit[]): boolean =>
|
|
|
86
86
|
hits.some((other) => other.word.length > hit.word.length && other.at <= hit.at && hit.at + hit.word.length <= other.at + other.word.length);
|
|
87
87
|
|
|
88
88
|
/** The vague limits in one sentence, in order. Matching ignores case. */
|
|
89
|
-
const vagueIn = (text: Text, vague: readonly string[]): VagueDeadline[] => {
|
|
89
|
+
export const vagueIn = (text: Text, vague: readonly string[]): VagueDeadline[] => {
|
|
90
90
|
const lower = text.text.toLowerCase();
|
|
91
91
|
const hits = vague
|
|
92
92
|
.filter((word) => word !== "")
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
// version-mismatch: the version a code block's lead-in names against the one the block shows (structure/version-mismatch.ts)
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
1
|
+
// version-mismatch: the version a code block's lead-in names against the one the block shows (structure/version-mismatch.ts),
|
|
2
|
+
// and an install command that pins the document's own package to a version its release list does not say is current
|
|
3
|
+
// (structure/install-pin.ts). The words that make a version a bound (「から」「以上」, "from", "or later") are the lexicon
|
|
4
|
+
// version-range; the words that lead to the version installed (version, install) are version-lead; the install commands
|
|
5
|
+
// are install-command.
|
|
6
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
5
7
|
import { versionMismatches, type RangeWord, type VersionWords } from "../structure/version-mismatch.ts";
|
|
8
|
+
import { installPinMismatches, ownTextOf, pinsIn } from "../structure/install-pin.ts";
|
|
9
|
+
import { releasesOf } from "../structure/release-list.ts";
|
|
6
10
|
import { codeFences } from "./code-fences.ts";
|
|
7
11
|
import { quoteAt } from "./structure-tree.ts";
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
const leadInFindings = (doc: ProseDocument): Finding[] => {
|
|
10
14
|
const words: VersionWords = {
|
|
11
15
|
ranges: (doc.lexicons["version-range"] ?? []).map((entry): RangeWord => ({ word: entry.pattern, position: entry.position ?? "before" })),
|
|
12
16
|
versionWords: (doc.lexicons["version-lead"] ?? []).map((entry) => entry.pattern),
|
|
@@ -21,3 +25,20 @@ export const versionMismatch: Detector = (doc): Finding[] => {
|
|
|
21
25
|
values: { ...issue.values, offset: issue.offset },
|
|
22
26
|
}));
|
|
23
27
|
};
|
|
28
|
+
|
|
29
|
+
const installPinFindings = (doc: ProseDocument): Finding[] => {
|
|
30
|
+
const shapes = (doc.lexicons["install-command"] ?? []).map((entry) => entry.pattern);
|
|
31
|
+
const headings = doc.markup?.headings ?? [];
|
|
32
|
+
const releases = releasesOf(doc.source, headings, codeFences(doc.source));
|
|
33
|
+
return installPinMismatches(pinsIn(doc.source, shapes), releases, ownTextOf(doc.source, headings)).map((issue) => ({
|
|
34
|
+
rule: "version-mismatch",
|
|
35
|
+
severity: "warning",
|
|
36
|
+
line: 0,
|
|
37
|
+
column: 0,
|
|
38
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
39
|
+
variant: issue.variant,
|
|
40
|
+
values: { ...issue.values, offset: issue.offset },
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const versionMismatch: Detector = (doc): Finding[] => [...leadInFindings(doc), ...installPinFindings(doc)];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// version-order: a changelog's version headings, or a list or table of releases, with one version out of order
|
|
2
|
+
// (structure/version-order.ts).
|
|
3
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
4
|
+
import { codeFences } from "./code-fences.ts";
|
|
5
|
+
import { siblingHeadingRunsOf } from "../structure/heading-runs.ts";
|
|
6
|
+
import { runsOf, type Line } from "../structure/runs.ts";
|
|
7
|
+
import { isVersionHistory, leadingVersion, versionOrderBreaks, type VersionPoint } from "../structure/version-order.ts";
|
|
8
|
+
import type { Detector, Finding, MarkupHeading, ProseDocument } from "../plugin.ts";
|
|
9
|
+
|
|
10
|
+
const headingPoint = (source: string, heading: MarkupHeading): VersionPoint | undefined => {
|
|
11
|
+
const label = leadingVersion(heading.text);
|
|
12
|
+
if (label === undefined) return undefined;
|
|
13
|
+
const at = source.indexOf(label, heading.start);
|
|
14
|
+
return { offset: at === -1 ? heading.start : at, label };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** The marker of a list item or the first pipe of a table row, before the item's text. */
|
|
18
|
+
const ITEM_MARKER = /^[ \t]*(?:[-*+]|\d{1,3}[.)]|\|)[ \t]*/u;
|
|
19
|
+
|
|
20
|
+
const itemVersions = (source: string, run: readonly Line[]): VersionPoint[] =>
|
|
21
|
+
run.flatMap((line) => {
|
|
22
|
+
const text = source.slice(line.start, line.end);
|
|
23
|
+
const marker = ITEM_MARKER.exec(text)?.[0] ?? "";
|
|
24
|
+
const label = leadingVersion(text.slice(marker.length));
|
|
25
|
+
return label === undefined ? [] : [{ offset: line.start + marker.length, label }];
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/** A list in a code fence (an example changelog) is not the document's. */
|
|
29
|
+
const outsideFences = (source: string, run: readonly Line[]): Line[] => {
|
|
30
|
+
const fences = codeFences(source);
|
|
31
|
+
return run.filter((line) => !fences.some((fence) => line.start >= fence.start && line.start < fence.end));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const pointRuns = (doc: ProseDocument): VersionPoint[][] => [
|
|
35
|
+
...siblingHeadingRunsOf(doc.markup?.headings ?? [], (heading) => headingPoint(doc.source, heading)),
|
|
36
|
+
...runsOf(doc.source).map((run) => itemVersions(doc.source, outsideFences(doc.source, run))),
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export const versionOrder: Detector = (doc): Finding[] =>
|
|
40
|
+
pointRuns(doc)
|
|
41
|
+
.filter((run) => isVersionHistory(run.map((point) => point.label)))
|
|
42
|
+
.flatMap(versionOrderBreaks)
|
|
43
|
+
.map((issue) => ({
|
|
44
|
+
rule: "version-order",
|
|
45
|
+
severity: "warning",
|
|
46
|
+
line: 0,
|
|
47
|
+
column: 0,
|
|
48
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
49
|
+
values: { ...issue.values, offset: issue.offset },
|
|
50
|
+
}));
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// warning-without-action: a warning paragraph (Warning:, 注意:, > [!WARNING]) none of whose sentences tells the reader what
|
|
2
|
+
// to do (warning-action.ts). In English a sentence that opens with its verb (Export today's orders first) is an action too.
|
|
3
|
+
// A GitHub alert (> [!WARNING]) is read to the end of its block quote.
|
|
4
|
+
import { isInstruction, isStatement } from "./technical-docs.ts";
|
|
5
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
6
|
+
import { namesAction, quoteBlockEnd, warningTextStart, type WarningWords } from "../warning-action.ts";
|
|
7
|
+
import type { Detector, Finding, Paragraph, ProseDocument, Sentence } from "../plugin.ts";
|
|
8
|
+
|
|
9
|
+
const wordsOf = (doc: ProseDocument): WarningWords => ({
|
|
10
|
+
labels: (doc.lexicons["warning-label"] ?? []).map((entry) => entry.pattern),
|
|
11
|
+
actions: (doc.lexicons["warning-action"] ?? []).map((entry) => entry.pattern),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/** An English sentence that opens with its verb, read from the parts of speech past the label: an instruction. */
|
|
15
|
+
const opensWithVerb = (doc: ProseDocument, sentence: Sentence, from: number): boolean => {
|
|
16
|
+
const tokens = (sentence.tokens ?? []).filter((token) => token.span.start >= from);
|
|
17
|
+
return doc.language === "en" && tokens.length > 0 && isInstruction(tokens) && !isStatement(tokens);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const isAction = (doc: ProseDocument, sentence: Sentence, from: number, words: WarningWords): boolean => {
|
|
21
|
+
const start = Math.max(sentence.span.start, from);
|
|
22
|
+
if (start >= sentence.span.end) return false;
|
|
23
|
+
return namesAction(doc.source.slice(start, sentence.span.end), words.actions) || opensWithVerb(doc, sentence, start);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const warningWithoutAction = (doc: ProseDocument, paragraph: Paragraph, words: WarningWords): Finding[] => {
|
|
27
|
+
const textStart = warningTextStart(doc.source.slice(paragraph.span.start, paragraph.span.end), words.labels);
|
|
28
|
+
if (textStart === undefined) return [];
|
|
29
|
+
const from = paragraph.span.start + textStart;
|
|
30
|
+
const end = quoteBlockEnd(doc.source, paragraph.span.start) ?? paragraph.span.end;
|
|
31
|
+
const said = doc.sentences.filter((sentence) => sentence.span.end > from && sentence.span.start < end);
|
|
32
|
+
if (said.length === 0 || said.some((sentence) => isAction(doc, sentence, from, words))) return [];
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
rule: "warning-without-action",
|
|
36
|
+
severity: "info",
|
|
37
|
+
line: 0,
|
|
38
|
+
column: 0,
|
|
39
|
+
quote: quoteAt(doc.source, paragraph.span.start),
|
|
40
|
+
values: { offset: paragraph.span.start },
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const warningAction: Detector = (doc): Finding[] => {
|
|
46
|
+
const words = wordsOf(doc);
|
|
47
|
+
if (words.labels.length === 0) return [];
|
|
48
|
+
return doc.paragraphs.flatMap((paragraph) => warningWithoutAction(doc, paragraph, words));
|
|
49
|
+
};
|