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
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { StructureIssue } from "./issues.ts";
|
|
2
|
-
import {
|
|
2
|
+
import { siblingHeadingRunsOf } from "./heading-runs.ts";
|
|
3
|
+
import { runsOf } from "./runs.ts";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
6
|
+
* 日程として並べた日付の順番。箇条書きの続いた項目、表の続いた行、同じ親の下で同じ深さに並ぶ見出しで、
|
|
7
|
+
* 日付をちょうど一つ持つものを並びとして読む。
|
|
8
|
+
* 並びの向き(古い順か新しい順か)は多いほうで決め、それに逆らう一歩ごとに、その前後のうち並びから外れた日付を言う。新しい順に並べた履歴は正しい並び。
|
|
7
9
|
* 向きが決まらない並び(上がりと下がりが同じ数)は何も言わない。逆らう一歩を言えるのは、日付が 4 つ以上の並びだけになる。
|
|
8
10
|
* 向きに沿って並ぶ日付が半分以下の並びは、日付でなく別のもの(名前、版)で並べた一覧として何も言わない。
|
|
9
11
|
*/
|
|
@@ -12,13 +14,41 @@ export type DatedPoint = { readonly offset: number; readonly value: string };
|
|
|
12
14
|
/** 並びとして比べられる日付の書き方。年月日、年月、月日は、同じ書き方どうしでしか比べない。 */
|
|
13
15
|
const PRECISIONS = [/^\d{4}-\d{2}-\d{2}$/u, /^\d{4}-\d{2}$/u, /^\d{2}-\d{2}$/u];
|
|
14
16
|
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
+
/** 並びの一行(箇条書きの項目、表の行、見出し)の原文の範囲。 */
|
|
18
|
+
type Span = { readonly start: number; readonly end: number };
|
|
19
|
+
|
|
20
|
+
/** 見出しの深さと原文の範囲。 */
|
|
21
|
+
export type HeadingSpan = Span & { readonly depth: number };
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 同じ親の下で同じ深さに並ぶ見出し(変更履歴の版ごとの見出し)。浅い見出しが来たら、それより深い並びは閉じる。
|
|
25
|
+
* 深い見出し(### 追加)は並びを切らず、親ごとに別の並びになる。
|
|
26
|
+
*/
|
|
27
|
+
export const siblingHeadingRuns = (headings: readonly HeadingSpan[]): HeadingSpan[][] => siblingHeadingRunsOf(headings, (heading) => heading);
|
|
28
|
+
|
|
29
|
+
/** 一行のただ一つの日付。二つある行(期間)はどちらを並べたのか決められないので、並びに入れない。 */
|
|
30
|
+
const onlyDateIn = (line: Span, points: readonly DatedPoint[]): DatedPoint | undefined => {
|
|
31
|
+
const inside = points.filter((point) => point.offset >= line.start && point.offset <= line.end);
|
|
32
|
+
return inside.length === 1 ? inside[0] : undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const datedLines = (run: readonly Span[], points: readonly DatedPoint[]): DatedPoint[] =>
|
|
17
36
|
run.flatMap((line) => {
|
|
18
|
-
const
|
|
19
|
-
return
|
|
37
|
+
const date = onlyDateIn(line, points);
|
|
38
|
+
return date === undefined ? [] : [date];
|
|
20
39
|
});
|
|
21
40
|
|
|
41
|
+
/** 見出しの並びは、日付を一つ持つ見出しが続くあいだだけ。日付の無い見出しが混じる並び(問いに更新日を添えた FAQ)は、日付で並べたものではない。 */
|
|
42
|
+
const datedStretches = (run: readonly Span[], points: readonly DatedPoint[]): DatedPoint[][] =>
|
|
43
|
+
run.reduce<DatedPoint[][]>(
|
|
44
|
+
(stretches, heading) => {
|
|
45
|
+
const date = onlyDateIn(heading, points);
|
|
46
|
+
if (date === undefined) return [...stretches, []];
|
|
47
|
+
return [...stretches.slice(0, -1), [...(stretches.at(-1) ?? []), date]];
|
|
48
|
+
},
|
|
49
|
+
[[]],
|
|
50
|
+
);
|
|
51
|
+
|
|
22
52
|
const samePrecision = (dated: readonly DatedPoint[]): boolean => PRECISIONS.some((pattern) => dated.every((point) => pattern.test(point.value)));
|
|
23
53
|
|
|
24
54
|
/** 上がりが多ければ 1、下がりが多ければ -1、同じ数なら 0(向きを決めない)。 */
|
|
@@ -37,23 +67,43 @@ export const longestInOrder = (values: readonly string[], direction: number): nu
|
|
|
37
67
|
/** 日付のうち向きに沿うものが過半を占める。ひとつふたつの書き間違いなら残りが揃うが、名前順の一覧は揃わない。 */
|
|
38
68
|
const mostlyInOrder = (values: readonly string[], direction: number): boolean => longestInOrder(values, direction) * 2 > values.length;
|
|
39
69
|
|
|
40
|
-
|
|
70
|
+
const without = (values: readonly string[], index: number): string[] => values.filter((_, at) => at !== index);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 向きに逆らう一歩(at - 1 から at)のうち、並びから外れているほう。取り除いたとき残りが長く揃うほうを指す。
|
|
74
|
+
* 前を取っても後ろを取っても同じだけ揃う(隣どうしの入れ替わり)なら、どちらとも決められないので後ろを指す。
|
|
75
|
+
*/
|
|
76
|
+
export const outOfPlace = (values: readonly string[], at: number, direction: number): number =>
|
|
77
|
+
longestInOrder(without(values, at - 1), direction) > longestInOrder(without(values, at), direction) ? at - 1 : at;
|
|
78
|
+
|
|
79
|
+
/** 外れた日付に、前の日付を添える。先頭の日付には前が無いので、次の日付を添える。 */
|
|
80
|
+
const issueAt = (dated: readonly DatedPoint[], at: number): StructureIssue[] => {
|
|
81
|
+
const point = dated[at];
|
|
82
|
+
if (point === undefined) return [];
|
|
83
|
+
const neighbour = at === 0 ? { next: dated[1]?.value ?? "" } : { previous: dated[at - 1]?.value ?? "" };
|
|
84
|
+
return [{ offset: point.offset, values: { date: point.value, ...neighbour } }];
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** 多いほうの向きに逆らう一歩ごとに、並びから外れた日付を指す。 */
|
|
41
88
|
const againstMajority = (dated: readonly DatedPoint[]): StructureIssue[] => {
|
|
42
|
-
const steps = dated
|
|
43
|
-
.slice(1)
|
|
44
|
-
.map((point, index) => ({ point, previous: dated[index], sign: Math.sign(point.value.localeCompare(dated[index]?.value ?? "")) }));
|
|
45
|
-
const up = steps.filter((step) => step.sign > 0).length;
|
|
46
|
-
const down = steps.filter((step) => step.sign < 0).length;
|
|
47
|
-
const majority = majorityOf(up, down);
|
|
48
89
|
const values = dated.map((point) => point.value);
|
|
90
|
+
const signs = values.slice(1).map((value, index) => Math.sign(value.localeCompare(values[index] ?? "")));
|
|
91
|
+
const majority = majorityOf(signs.filter((sign) => sign > 0).length, signs.filter((sign) => sign < 0).length);
|
|
49
92
|
if (majority === 0 || !mostlyInOrder(values, majority)) return [];
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
93
|
+
return signs.flatMap((sign, index) => {
|
|
94
|
+
if (sign !== -majority) return [];
|
|
95
|
+
return issueAt(dated, outOfPlace(values, index + 1, majority));
|
|
96
|
+
});
|
|
53
97
|
};
|
|
54
98
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
99
|
+
const breaksIn = (dated: readonly DatedPoint[]): StructureIssue[] => (samePrecision(dated) ? againstMajority(dated) : []);
|
|
100
|
+
|
|
101
|
+
/** 見出しを箇条書きの中に書けば(「- ## 3.1.0 - 2026-10-02」)、同じ日付が両方の並びに入る。一度だけ言う。 */
|
|
102
|
+
const oncePerOffset = (issues: readonly StructureIssue[]): StructureIssue[] =>
|
|
103
|
+
issues.filter((issue, index) => issues.findIndex((other) => other.offset === issue.offset) === index);
|
|
104
|
+
|
|
105
|
+
export const dateOrderBreaks = (source: string, points: readonly DatedPoint[], headings: readonly HeadingSpan[] = []): StructureIssue[] =>
|
|
106
|
+
oncePerOffset([
|
|
107
|
+
...runsOf(source).flatMap((run) => breaksIn(datedLines(run, points))),
|
|
108
|
+
...siblingHeadingRuns(headings).flatMap((run) => datedStretches(run, points).flatMap(breaksIn)),
|
|
109
|
+
]);
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
2
|
+
import type { StructureIssue } from "./issues.ts";
|
|
3
|
+
import { TABLE_ROW } from "./runs.ts";
|
|
4
|
+
import { statedPeriod, type DateMention, type Period, type PeriodWords } from "./stated-period.ts";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 書いた期間の外の日付。期間の語で始まる一行(旅行期間:…)が期間を書き、その後ろ、同じ節の中の箇条書きの項目、表の行、見出しの日付を比べる。
|
|
8
|
+
* 地の文の日付は、年の無いもの(2月12日(金)の午前は…)だけを比べる。年のある日付は、過去の回や別の年の出来事を挙げることが多い。
|
|
9
|
+
* 期間の前後に置く予定(前泊、follow-up)、締め切りや予約の日、過去の回を言う語(period-aside)が、その行、文、節の見出しにあれば比べない。
|
|
10
|
+
* 年の無い期間(12月28日〜1月4日)は年をまたいで読む。
|
|
11
|
+
*/
|
|
12
|
+
export type HeadingSpan = { readonly start: number; readonly end: number; readonly depth: number };
|
|
13
|
+
type Span = { readonly start: number; readonly end: number };
|
|
14
|
+
|
|
15
|
+
export type OutsideWords = PeriodWords & { readonly asides: readonly string[] };
|
|
16
|
+
|
|
17
|
+
const LIST_ITEM = /^[ \t]{0,12}(?:[-*+]|\d{1,3}[.)])[ \t]/u;
|
|
18
|
+
const DAY_VALUE = /^(?:\d{4}-)?\d{2}-\d{2}$/u;
|
|
19
|
+
|
|
20
|
+
const hasYear = (value: string): boolean => value.length === "2026-01-01".length;
|
|
21
|
+
const monthDay = (value: string): string => value.slice(-"01-01".length);
|
|
22
|
+
|
|
23
|
+
/** 期間の中か。両方に年があれば年月日で、どちらかに年が無ければ月日で比べ、終わりが始まりより前の月日は年をまたぐ期間と読む。 */
|
|
24
|
+
export const insidePeriod = (value: string, period: Pick<Period, "start" | "end">): boolean => {
|
|
25
|
+
if (hasYear(value) && hasYear(period.start)) return value >= period.start && value <= period.end;
|
|
26
|
+
const [from, to, day] = [monthDay(period.start), monthDay(period.end), monthDay(value)];
|
|
27
|
+
return from <= to ? day >= from && day <= to : day >= from || day <= to;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const linesOf = (source: string): Span[] =>
|
|
31
|
+
source.split("\n").reduce<Span[]>((lines, text) => {
|
|
32
|
+
const start = (lines.at(-1)?.end ?? -1) + 1;
|
|
33
|
+
return [...lines, { start, end: start + text.length }];
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
const containing = <Item extends Span>(spans: readonly Item[], offset: number): Item | undefined =>
|
|
37
|
+
spans.find((span) => span.start <= offset && offset <= span.end);
|
|
38
|
+
|
|
39
|
+
/** 英字の語は語の切れ目で、ほかは含むかで照らす。 */
|
|
40
|
+
export const mentions = (text: string, words: readonly string[]): boolean => {
|
|
41
|
+
const lower = text.toLowerCase();
|
|
42
|
+
return words.some((word) => {
|
|
43
|
+
const target = word.toLowerCase();
|
|
44
|
+
if (!/[a-z]/u.test(target)) return lower.includes(target);
|
|
45
|
+
return new RegExp(`(?<![a-z])${escapeRegExp(target)}(?![a-z])`, "u").test(lower);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
type Stated = Period & { readonly scopeStart: number; readonly scopeEnd: number };
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 期間の及ぶ範囲の始まり: 期間の行の後ろ。期間の行が箇条書きの項目なら、その箇条書きの後ろ。
|
|
53
|
+
* 「- Conference: May 3–5」「- Workshop: May 7」は催しを並べた一覧で、並んだ項目は期間の中の予定ではない。
|
|
54
|
+
*/
|
|
55
|
+
const scopeStart = (source: string, lines: readonly Span[], line: Span): number => {
|
|
56
|
+
const isListLine = (span: Span): boolean => LIST_ITEM.test(source.slice(span.start, span.end));
|
|
57
|
+
if (!isListLine(line)) return line.end;
|
|
58
|
+
const after = lines.filter((span) => span.start > line.start);
|
|
59
|
+
const listEnd = after.findIndex((span) => !isListLine(span));
|
|
60
|
+
return (listEnd === -1 ? (after.at(-1) ?? line) : (after[listEnd - 1] ?? line)).end;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** 期間の行が属する節の深さ。行が見出しならその深さ、そうでなければ前の見出しの深さ(見出しの前なら 0)。 */
|
|
64
|
+
const depthAt = (line: Span, headings: readonly HeadingSpan[]): number =>
|
|
65
|
+
(containing(headings, line.start) ?? headings.filter((heading) => heading.start < line.start).at(-1))?.depth ?? 0;
|
|
66
|
+
|
|
67
|
+
/** 期間の及ぶ範囲の終わり: 同じか浅い深さの次の見出しか、次の期間の行。 */
|
|
68
|
+
const scopeEnd = (line: Span, next: number, headings: readonly HeadingSpan[], length: number): number => {
|
|
69
|
+
const depth = depthAt(line, headings);
|
|
70
|
+
const closing = headings.find((heading) => heading.start > line.end && heading.depth <= depth)?.start ?? length;
|
|
71
|
+
return Math.min(closing, next);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const statedPeriods = (
|
|
75
|
+
source: string,
|
|
76
|
+
lines: readonly Span[],
|
|
77
|
+
dates: readonly DateMention[],
|
|
78
|
+
headings: readonly HeadingSpan[],
|
|
79
|
+
words: OutsideWords,
|
|
80
|
+
): Stated[] => {
|
|
81
|
+
const found = lines.flatMap((line) => {
|
|
82
|
+
const period = statedPeriod(source.slice(line.start, line.end), line.start, dates, words);
|
|
83
|
+
return period === undefined ? [] : [{ period, line }];
|
|
84
|
+
});
|
|
85
|
+
return found.map(({ period, line }, index) => ({
|
|
86
|
+
...period,
|
|
87
|
+
scopeStart: scopeStart(source, lines, line),
|
|
88
|
+
scopeEnd: scopeEnd(line, found[index + 1]?.line.start ?? source.length, headings, source.length),
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const isItem = (text: string, line: Span, headings: readonly HeadingSpan[]): boolean =>
|
|
93
|
+
LIST_ITEM.test(text) || TABLE_ROW.test(text) || containing(headings, line.start) !== undefined;
|
|
94
|
+
|
|
95
|
+
type Context = { readonly source: string; readonly lines: readonly Span[]; readonly headings: readonly HeadingSpan[]; readonly sentences: readonly Span[] };
|
|
96
|
+
|
|
97
|
+
/** 日付を囲む行(項目)か文(地の文)と、その節の見出し。期間の外に置く語を探す所。 */
|
|
98
|
+
const surroundings = (date: DateMention, line: Span, item: boolean, context: Context): string[] => {
|
|
99
|
+
const unit = item ? line : (containing(context.sentences, date.offset) ?? line);
|
|
100
|
+
const heading = context.headings.filter((candidate) => candidate.start <= date.offset).at(-1);
|
|
101
|
+
return [context.source.slice(unit.start, unit.end), heading === undefined ? "" : context.source.slice(heading.start, heading.end)];
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const outsideOne = (date: DateMention, period: Stated, context: Context, asides: readonly string[]): boolean => {
|
|
105
|
+
if (!DAY_VALUE.test(date.value) || insidePeriod(date.value, period)) return false;
|
|
106
|
+
const line = containing(context.lines, date.offset);
|
|
107
|
+
if (line === undefined) return false;
|
|
108
|
+
const item = isItem(context.source.slice(line.start, line.end), line, context.headings);
|
|
109
|
+
if (!item && hasYear(date.value)) return false;
|
|
110
|
+
return !surroundings(date, line, item, context).some((text) => mentions(text, asides));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const datesOutsidePeriod = (
|
|
114
|
+
source: string,
|
|
115
|
+
dates: readonly DateMention[],
|
|
116
|
+
headings: readonly HeadingSpan[],
|
|
117
|
+
sentences: readonly Span[],
|
|
118
|
+
words: OutsideWords,
|
|
119
|
+
): StructureIssue[] => {
|
|
120
|
+
const lines = linesOf(source);
|
|
121
|
+
const context: Context = { source, lines, headings, sentences };
|
|
122
|
+
return statedPeriods(source, lines, dates, headings, words).flatMap((period) =>
|
|
123
|
+
dates
|
|
124
|
+
.filter((date) => date.offset > period.scopeStart && date.offset < period.scopeEnd && outsideOne(date, period, context, words.asides))
|
|
125
|
+
.map((date) => ({ offset: date.offset, values: { date: source.slice(date.offset, date.end), period: period.written } })),
|
|
126
|
+
);
|
|
127
|
+
};
|
|
@@ -135,6 +135,19 @@ const LABEL_SLACK = 3;
|
|
|
135
135
|
const isLabel = (body: BodyText | undefined, term: string): boolean =>
|
|
136
136
|
body !== undefined && (body.text.replaceAll(term, "").match(LETTER) ?? []).length <= LABEL_SLACK;
|
|
137
137
|
|
|
138
|
+
/** 文書の位置が、題・見出し・条の見出しの行にあるか。見出しは節の中身に名前を付けるだけで、語を使った所ではない。 */
|
|
139
|
+
export type IsTitle = (offset: number) => boolean;
|
|
140
|
+
|
|
141
|
+
const NEVER_TITLE: IsTitle = () => false;
|
|
142
|
+
|
|
143
|
+
const HAN = /\p{Script=Han}/u;
|
|
144
|
+
|
|
145
|
+
/** 漢字で終わる語の後ろに漢字が続く現れは、もっと長い語の一部(監査委員会の監査委員、保険金請求権の保険金請求)。 */
|
|
146
|
+
const continuesInHan = (texts: readonly BodyText[], term: string, offset: number): boolean => {
|
|
147
|
+
const body = sentenceAt(texts, offset);
|
|
148
|
+
return body !== undefined && HAN.test(term.at(-1) ?? "") && HAN.test(body.text.charAt(offset - body.start + term.length));
|
|
149
|
+
};
|
|
150
|
+
|
|
138
151
|
const CAPITAL_OR_NON_LATIN = /\p{Lu}|[^\p{Script=Latin}\p{N}\s\p{P}]/u;
|
|
139
152
|
|
|
140
153
|
/**
|
|
@@ -145,18 +158,26 @@ const isDistinctive = (term: string): boolean => CAPITAL_OR_NON_LATIN.test(term)
|
|
|
145
158
|
|
|
146
159
|
/**
|
|
147
160
|
* 文の途中で括弧に入れて定義した語((the "Seller")、以下「甲」という)を、その定義の文より前で使っている所。最初の一つだけ。
|
|
148
|
-
* 定義の文の中の現れ(株式会社GovTech東京(以下「GovTech
|
|
161
|
+
* 定義の文の中の現れ(株式会社GovTech東京(以下「GovTech東京」という。))は、定義する名前そのものなので数えない。札の文も、
|
|
162
|
+
* isTitle が言う題・見出しの行も、漢字で終わる語にさらに漢字が続く長い語の一部も数えない。
|
|
149
163
|
* 定義の条("Seller" means、「甲」とは)は条の並びの頭にも終わりにも置く書き方があるので、前で使っても言わない。
|
|
150
164
|
* 定義の語の無い括弧の引用(("The key point is"))は例の引用と同じ形なので、その語を引用符で挙げただけの現れ
|
|
151
165
|
* (Its sentences open with "The key point is")は使用ではない。定義の語のある定義((the "Seller")、以下「買主」という)は、
|
|
152
166
|
* 引用符に入れた現れ(The "Seller" ships)も使用。
|
|
153
167
|
*/
|
|
154
|
-
export const usesBeforeDefinition = (
|
|
168
|
+
export const usesBeforeDefinition = (
|
|
169
|
+
terms: readonly DefinedTerm[],
|
|
170
|
+
texts: readonly BodyText[],
|
|
171
|
+
mentioned: Mentioned = NEVER_MENTIONED,
|
|
172
|
+
isTitle: IsTitle = NEVER_TITLE,
|
|
173
|
+
): TermUse[] =>
|
|
155
174
|
groupsOf(terms)
|
|
156
175
|
.filter((group) => group.first.inline && isDistinctive(group.first.term))
|
|
157
176
|
.flatMap(({ first: defined, spans }) => {
|
|
158
177
|
const defining = sentenceAt(texts, defined.span.start)?.start ?? defined.span.start;
|
|
159
178
|
const uses = usesOf(defined.term, texts, spans, "exact", defined.bare === true ? mentioned : NEVER_MENTIONED);
|
|
160
|
-
const first = uses.find(
|
|
179
|
+
const first = uses.find(
|
|
180
|
+
(offset) => !isLabel(sentenceAt(texts, offset), defined.term) && !isTitle(offset) && !continuesInHan(texts, defined.term, offset),
|
|
181
|
+
);
|
|
161
182
|
return first !== undefined && first < defining ? [{ term: defined, offset: first }] : [];
|
|
162
183
|
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { StructureIssue } from "./issues.ts";
|
|
2
|
+
import { linesOf } from "./lines.ts";
|
|
3
|
+
import { isTotalLabel } from "./total.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A due date before the issue date. A line (or a list item, or a table's first column) starting with an issue-date word
|
|
7
|
+
* (発行日, Issued) and one starting with a due-date word (お支払期限, Payment due), each with a full date on it: a due date
|
|
8
|
+
* earlier than the first issue date, and written near it (the header block of an invoice or a quote), is reported. A due
|
|
9
|
+
* line that says its deadline has passed (期限切れ, overdue) reports on a deadline rather than setting one. Pure.
|
|
10
|
+
*/
|
|
11
|
+
export type DueWords = { readonly issue: readonly string[]; readonly due: readonly string[]; readonly passed: readonly string[] };
|
|
12
|
+
|
|
13
|
+
/** How many lines from the issue date a due date may be and still be read as the same document's deadline. */
|
|
14
|
+
const MAX_LINE_GAP = 8;
|
|
15
|
+
|
|
16
|
+
/** A date of the structure tree: where it starts and its value (2026-11-25). */
|
|
17
|
+
export type DatedPoint = { readonly offset: number; readonly value: string };
|
|
18
|
+
|
|
19
|
+
const FULL_DATE = /^\d{4}-\d{2}-\d{2}$/u;
|
|
20
|
+
|
|
21
|
+
type Labelled = { readonly kind: "issue" | "due"; readonly date: DatedPoint; readonly line: number };
|
|
22
|
+
|
|
23
|
+
const kindOf = (text: string, words: DueWords): Labelled["kind"] | undefined => {
|
|
24
|
+
if (isTotalLabel(text, words.issue)) return "issue";
|
|
25
|
+
return isTotalLabel(text, words.due) ? "due" : undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const labelledDates = (source: string, dates: readonly DatedPoint[], words: DueWords): Labelled[] =>
|
|
29
|
+
linesOf(source).flatMap((line) => {
|
|
30
|
+
const passed = words.passed.some((word) => line.text.toLowerCase().includes(word.toLowerCase()));
|
|
31
|
+
const kind = passed ? undefined : kindOf(line.text, words);
|
|
32
|
+
const end = line.start + line.text.length;
|
|
33
|
+
const onLine = dates.filter((date) => date.offset >= line.start && date.offset <= end && FULL_DATE.test(date.value));
|
|
34
|
+
const [date] = onLine;
|
|
35
|
+
return kind === undefined || date === undefined || onLine.length > 1 ? [] : [{ kind, date, line: line.number }];
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const dueBeforeIssue = (source: string, dates: readonly DatedPoint[], words: DueWords): StructureIssue[] => {
|
|
39
|
+
if (words.issue.length === 0 || words.due.length === 0) return [];
|
|
40
|
+
const labelled = labelledDates(source, dates, words);
|
|
41
|
+
const issued = labelled.find((entry) => entry.kind === "issue");
|
|
42
|
+
if (issued === undefined) return [];
|
|
43
|
+
return labelled
|
|
44
|
+
.filter((entry) => entry.kind === "due" && entry.date.value < issued.date.value && Math.abs(entry.line - issued.line) < MAX_LINE_GAP)
|
|
45
|
+
.map((entry) => ({ offset: entry.date.offset, values: { due: entry.date.value, issued: issued.date.value } }));
|
|
46
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headings at one depth under one parent heading, as a changelog's version or dated headings stand. A shallower heading
|
|
3
|
+
* closes the runs deeper than it; a deeper heading (### Added) ends none. A heading pointOf turns down still closes the
|
|
4
|
+
* deeper runs but joins no run and opens none, so "## Install" between two version headings does not split them.
|
|
5
|
+
*/
|
|
6
|
+
export const siblingHeadingRunsOf = <Heading extends { readonly depth: number }, Point>(
|
|
7
|
+
headings: readonly Heading[],
|
|
8
|
+
pointOf: (heading: Heading) => Point | undefined,
|
|
9
|
+
): Point[][] => {
|
|
10
|
+
const runs: Point[][] = [];
|
|
11
|
+
const open = new Map<number, Point[]>();
|
|
12
|
+
headings.forEach((heading) => {
|
|
13
|
+
[...open.keys()].filter((depth) => depth > heading.depth).forEach((depth) => open.delete(depth));
|
|
14
|
+
const point = pointOf(heading);
|
|
15
|
+
if (point === undefined) return;
|
|
16
|
+
const run = open.get(heading.depth) ?? [];
|
|
17
|
+
if (!open.has(heading.depth)) {
|
|
18
|
+
open.set(heading.depth, run);
|
|
19
|
+
runs.push(run);
|
|
20
|
+
}
|
|
21
|
+
run.push(point);
|
|
22
|
+
});
|
|
23
|
+
return runs;
|
|
24
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// An install command that pins the document's own package (npm install wrapkit@3.1.0) to a version other than the one its
|
|
2
|
+
// release list says is current. Pure: reads the source, the releases the document lists, and the install command shapes.
|
|
3
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
4
|
+
|
|
5
|
+
/** One release the document lists: a version heading with its section, or a list item that starts with a version. */
|
|
6
|
+
export type Release = { readonly version: string; readonly start: number; readonly end: number };
|
|
7
|
+
|
|
8
|
+
/** A package pinned to one exact version by an install command. */
|
|
9
|
+
export type Pin = { readonly offset: number; readonly name: string; readonly version: string };
|
|
10
|
+
|
|
11
|
+
/** Where the document names itself: its title, and the paragraph that opens it. */
|
|
12
|
+
export type OwnText = { readonly title: string; readonly opening: string };
|
|
13
|
+
|
|
14
|
+
export type PinIssue = {
|
|
15
|
+
readonly offset: number;
|
|
16
|
+
readonly variant: "newest" | "section";
|
|
17
|
+
readonly values: { readonly pinned: string; readonly release: string };
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const NAME = "(@?[A-Za-z0-9][\\w.\\/-]*)";
|
|
21
|
+
/**
|
|
22
|
+
* Exactly one version: not a range (^3.0.0, >=3.0.0), not a prerelease or build (3.0.0-beta.1), not a tag (latest). A
|
|
23
|
+
* sentence's period may follow (install wrapkit@3.1.0.), a fourth part may not (3.1.0.1).
|
|
24
|
+
*/
|
|
25
|
+
const EXACT_VERSION = "(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4})(?![\\w+-]|\\.\\w)";
|
|
26
|
+
/** The rest of a command: on its line, up to a ; && | or a closing backtick. */
|
|
27
|
+
const COMMAND_REST = "[^\\n;&|`]*";
|
|
28
|
+
|
|
29
|
+
/** A lexicon shape ("npm install {name}@{version}") as the command and the pin it takes. */
|
|
30
|
+
export type InstallShape = { readonly command: RegExp; readonly pin: RegExp };
|
|
31
|
+
|
|
32
|
+
/** A shape read from the lexicon; undefined when it does not name a command, then both parts in that order. */
|
|
33
|
+
export const installShape = (shape: string): InstallShape | undefined => {
|
|
34
|
+
const [command = "", rest = ""] = shape.split("{name}");
|
|
35
|
+
const [separator, tail] = rest.split("{version}");
|
|
36
|
+
if (command.trim() === "" || separator === undefined || tail === undefined) return undefined;
|
|
37
|
+
const words = command.trim().split(/\s+/u).map(escapeRegExp).join("[ \\t]+");
|
|
38
|
+
const pin = escapeRegExp(separator).replaceAll(" ", "[ \\t]+");
|
|
39
|
+
return {
|
|
40
|
+
command: new RegExp(`(?<![\\w.-])${words}(?=[ \\t])${COMMAND_REST}`, "gu"),
|
|
41
|
+
pin: new RegExp(`(?<=[ \\t])${NAME}${pin}${EXACT_VERSION}`, "gu"),
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const pinsAfter = (command: RegExpExecArray, shape: InstallShape): Pin[] =>
|
|
46
|
+
[...command[0].matchAll(shape.pin)].flatMap((match) => {
|
|
47
|
+
const [whole, name, version] = match;
|
|
48
|
+
if (name === undefined || version === undefined) return [];
|
|
49
|
+
return [{ offset: command.index + match.index + whole.length - version.length, name, version }];
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/** Each pin an install command makes, read with the lexicon's command shapes. Flags and other packages may come first. */
|
|
53
|
+
export const pinsIn = (source: string, shapes: readonly string[]): Pin[] =>
|
|
54
|
+
shapes
|
|
55
|
+
.flatMap((text) => {
|
|
56
|
+
const shape = installShape(text);
|
|
57
|
+
return shape === undefined ? [] : [...source.matchAll(shape.command)].flatMap((command) => pinsAfter(command, shape));
|
|
58
|
+
})
|
|
59
|
+
.filter((pin, index, pins) => pins.findIndex((other) => other.offset === pin.offset) === index);
|
|
60
|
+
|
|
61
|
+
/** The whole name, scope included: a page about react does not own @types/react. */
|
|
62
|
+
const names = (text: string, name: string): boolean => new RegExp(`(?<![\\w@/.-])${escapeRegExp(name)}(?![\\w/-])`, "iu").test(text);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The pins of the document's own package: those its title names, or, when the title names none (a changelog titled
|
|
66
|
+
* "Changelog"), those its opening paragraph names. Another package pinned in the same document is a dependency.
|
|
67
|
+
*/
|
|
68
|
+
const ownPins = (pins: readonly Pin[], own: OwnText): Pin[] => {
|
|
69
|
+
const titled = pins.filter((pin) => names(own.title, pin.name));
|
|
70
|
+
return titled.length > 0 ? titled : pins.filter((pin) => names(own.opening, pin.name));
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const PARAGRAPH_BREAK = /\n[ \t]*\n/u;
|
|
74
|
+
|
|
75
|
+
/** The document's title, its first top-level heading, and the paragraph that opens the text after it. */
|
|
76
|
+
export const ownTextOf = (source: string, headings: readonly { readonly depth: number; readonly text: string; readonly end: number }[]): OwnText => {
|
|
77
|
+
const title = headings.find((heading) => heading.depth === 1);
|
|
78
|
+
const rest = source.slice(title?.end ?? 0).trimStart();
|
|
79
|
+
const opening = rest.startsWith("#") ? "" : (rest.split(PARAGRAPH_BREAK)[0] ?? "");
|
|
80
|
+
return { title: title?.text ?? "", opening };
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const partsOf = (version: string): number[] => version.split(".").map(Number);
|
|
84
|
+
|
|
85
|
+
const isNewer = (left: string, right: string): boolean => {
|
|
86
|
+
const [a, b] = [partsOf(left), partsOf(right)];
|
|
87
|
+
const differing = a.findIndex((part, index) => part !== b[index]);
|
|
88
|
+
return differing !== -1 && (a[differing] ?? 0) > (b[differing] ?? 0);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** The newest release by version order; a prerelease (4.0.0-beta.1) is not the one a reader is told to install. */
|
|
92
|
+
const newestOf = (releases: readonly Release[]): string | undefined =>
|
|
93
|
+
releases
|
|
94
|
+
.map((release) => release.version)
|
|
95
|
+
.filter((version) => !version.includes("-"))
|
|
96
|
+
.reduce<string | undefined>((newest, version) => (newest === undefined || isNewer(version, newest) ? version : newest), undefined);
|
|
97
|
+
|
|
98
|
+
/** The release whose section holds a position, innermost first: a pin under "## 3.2.0" belongs to 3.2.0. */
|
|
99
|
+
const sectionAt = (releases: readonly Release[], offset: number): Release | undefined =>
|
|
100
|
+
releases.filter((release) => release.start <= offset && offset < release.end).at(-1);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Each pin of the document's own package that differs from its release: the release whose section it is in, or else the
|
|
104
|
+
* newest the document lists. A document that lists no release says nothing to compare.
|
|
105
|
+
*/
|
|
106
|
+
export const installPinMismatches = (pins: readonly Pin[], releases: readonly Release[], own: OwnText): PinIssue[] => {
|
|
107
|
+
const newest = newestOf(releases);
|
|
108
|
+
if (newest === undefined) return [];
|
|
109
|
+
return ownPins(pins, own).flatMap((pin) => {
|
|
110
|
+
const section = sectionAt(releases, pin.offset);
|
|
111
|
+
const release = section?.version ?? newest;
|
|
112
|
+
if (release === pin.version) return [];
|
|
113
|
+
return [{ offset: pin.offset, variant: section === undefined ? "newest" : "section", values: { pinned: pin.version, release } }];
|
|
114
|
+
});
|
|
115
|
+
};
|