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,17 @@
|
|
|
1
|
+
// parameter-table-mismatch: a parameter table that names a parameter the signature above it does not take, or leaves out
|
|
2
|
+
// one it does (parameter-table.ts). The header words of a parameter table come from the parameter-header lexicon.
|
|
3
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
4
|
+
import { parameterSlips } from "../parameter-table.ts";
|
|
5
|
+
import type { Detector, Finding } from "../plugin.ts";
|
|
6
|
+
|
|
7
|
+
export const parameterTable: Detector = (doc): Finding[] => {
|
|
8
|
+
const headers = new Set((doc.lexicons["parameter-header"] ?? []).map((entry) => entry.pattern.toLowerCase()));
|
|
9
|
+
return parameterSlips(doc.source, headers).map((slip) => ({
|
|
10
|
+
rule: "parameter-table-mismatch",
|
|
11
|
+
severity: "warning",
|
|
12
|
+
line: 0,
|
|
13
|
+
column: 0,
|
|
14
|
+
quote: quoteAt(doc.source, slip.offset),
|
|
15
|
+
values: { name: slip.name, function: slip.fn, side: slip.side, offset: slip.offset },
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// phone-number-variant: one phone number written with two neighbouring digits swapped somewhere else in the document,
|
|
2
|
+
// after a label of the same kind (phone-numbers.ts).
|
|
3
|
+
import { labelledPhoneNumbers, phoneVariants } from "../phone-numbers.ts";
|
|
4
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
5
|
+
import type { Detector, Finding } from "../plugin.ts";
|
|
6
|
+
|
|
7
|
+
export const phoneNumberVariant: Detector = (doc, options): Finding[] => {
|
|
8
|
+
const labels = options.lexicon ?? [];
|
|
9
|
+
if (labels.length === 0) return [];
|
|
10
|
+
return phoneVariants(labelledPhoneNumbers(doc.prose ?? doc.source, labels)).map(({ number, other }) => ({
|
|
11
|
+
rule: "",
|
|
12
|
+
severity: "info",
|
|
13
|
+
line: 0,
|
|
14
|
+
column: 0,
|
|
15
|
+
quote: quoteAt(doc.source, number.offset),
|
|
16
|
+
values: { written: number.written, other: other.written, offset: number.offset },
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// prerequisite-after-step: a sentence opening with a prerequisite (Before you begin, 作業を始める前に) after the numbered
|
|
2
|
+
// steps of its own section (prerequisite-order.ts).
|
|
3
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
4
|
+
import { latePrerequisites } from "../prerequisite-order.ts";
|
|
5
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
6
|
+
|
|
7
|
+
const ORDERED_ITEM = /^\s*\d{1,3}[.)]\s/u;
|
|
8
|
+
/** A numbered list needs this many steps to be a procedure. */
|
|
9
|
+
const MIN_STEPS = 3;
|
|
10
|
+
|
|
11
|
+
const QUOTED_LINE = /^[ \t]*>/u;
|
|
12
|
+
|
|
13
|
+
/** Whether a list stands in a block quote: a quoted procedure is someone else's, not the document's steps. */
|
|
14
|
+
const isQuoted = (source: string, start: number): boolean => QUOTED_LINE.test(source.slice(source.lastIndexOf("\n", start - 1) + 1, start + 1));
|
|
15
|
+
|
|
16
|
+
const proceduresOf = (doc: ProseDocument): { start: number; end: number }[] =>
|
|
17
|
+
doc.lists
|
|
18
|
+
.filter((list) => list.itemSpans.length >= MIN_STEPS && ORDERED_ITEM.test(doc.source.slice(list.span.start, list.span.end)))
|
|
19
|
+
.filter((list) => !isQuoted(doc.source, list.span.start))
|
|
20
|
+
.map((list) => ({ start: list.span.start, end: list.span.end }));
|
|
21
|
+
|
|
22
|
+
export const prerequisiteOrder: Detector = (doc): Finding[] => {
|
|
23
|
+
const openers = (doc.lexicons["prerequisite-opener"] ?? []).map((entry) => entry.pattern);
|
|
24
|
+
if (openers.length === 0) return [];
|
|
25
|
+
const sections = doc.sections.map((section) => ({ start: section.span.start, end: section.span.end }));
|
|
26
|
+
const sentences = doc.sentences.map((sentence) => ({ start: sentence.span.start, end: sentence.span.end, text: sentence.text }));
|
|
27
|
+
return latePrerequisites(sections, proceduresOf(doc), sentences, openers).map((sentence) => ({
|
|
28
|
+
rule: "prerequisite-after-step",
|
|
29
|
+
severity: "info",
|
|
30
|
+
line: 0,
|
|
31
|
+
column: 0,
|
|
32
|
+
quote: quoteAt(doc.source, sentence.start),
|
|
33
|
+
values: { offset: sentence.start },
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// quote-unnamed-speaker: a quotation given to a role with no name (業界のアナリストは「…」と述べた, "…," said an analyst).
|
|
2
|
+
// The decision is in unnamed-speaker.ts.
|
|
3
|
+
import { speakerWords, unnamedSpeakerQuotes } from "../unnamed-speaker.ts";
|
|
4
|
+
import type { Detector, Finding } from "../plugin.ts";
|
|
5
|
+
|
|
6
|
+
export const quoteUnnamedSpeaker: Detector = (doc, options): Finding[] => {
|
|
7
|
+
const words = speakerWords(options.lexicon ?? [], doc.lexicons["quote-attribution"] ?? []);
|
|
8
|
+
return doc.paragraphs
|
|
9
|
+
.flatMap((paragraph) => paragraph.sentences)
|
|
10
|
+
.flatMap((sentence) => unnamedSpeakerQuotes({ start: sentence.span.start, text: sentence.text }, words))
|
|
11
|
+
.map((hit) => ({
|
|
12
|
+
rule: "quote-unnamed-speaker",
|
|
13
|
+
severity: "info",
|
|
14
|
+
line: 0,
|
|
15
|
+
column: 0,
|
|
16
|
+
quote: hit.quote,
|
|
17
|
+
values: { quote: hit.quote, speaker: hit.speaker, offset: hit.offset },
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// A quotation the text gives to someone (「…」と述べている, according to X, "…") in a paragraph that names no source for it:
|
|
2
2
|
// no link, no footnote or numbered citation, no year in brackets. Whether the words are really that person's is for
|
|
3
3
|
// `chaff cite` against the source; this only says that there is nothing to check them against. The words that give a
|
|
4
|
-
// quotation to someone come from the language package's word list quote-attribution.
|
|
4
|
+
// quotation to someone come from the language package's word list quote-attribution. A Markdown block quotation is
|
|
5
|
+
// given to someone by a dash line (> … / — Name) instead. Pure.
|
|
5
6
|
import { QUOTATION_MARKS, quotedSpans } from "../quoted-span.ts";
|
|
7
|
+
import { readMarkdown } from "../markdown-read.ts";
|
|
8
|
+
import { blockQuotations, type BlockQuotation } from "./block-quotation.ts";
|
|
6
9
|
import type { Detector, Finding, LexiconEntry, ProseDocument } from "../plugin.ts";
|
|
7
10
|
|
|
8
11
|
export type QuoteText = { readonly start: number; readonly text: string };
|
|
@@ -53,34 +56,78 @@ const cueStarts = (text: string, cue: string): number[] => {
|
|
|
53
56
|
|
|
54
57
|
type Quoted = { readonly start: number; readonly end: number };
|
|
55
58
|
|
|
59
|
+
/** The word lists the rule reads: quote-attribution, and quote-advice (「…」と述べる方が: a wording suggested, not quoted). */
|
|
60
|
+
export type QuoteWords = { readonly cues: readonly LexiconEntry[]; readonly advice?: readonly LexiconEntry[] };
|
|
61
|
+
|
|
62
|
+
const patternsIn = (entries: readonly LexiconEntry[], group: string): string[] =>
|
|
63
|
+
entries.filter((entry) => entry.group === group && entry.pattern !== "").map((entry) => entry.pattern);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Whether the words right after the closing mark suggest saying it that way: a say word, then an advice word (「…」と書く方が適切です).
|
|
67
|
+
* A say word alone is not enough: 「…」と述べる方が多い reports what people say.
|
|
68
|
+
*/
|
|
69
|
+
const isAdvice = (text: string, quoted: Quoted, advice: readonly LexiconEntry[]): boolean => {
|
|
70
|
+
const after = quoted.end + 1;
|
|
71
|
+
const tails = patternsIn(advice, "advice");
|
|
72
|
+
return patternsIn(advice, "say").some((say) => text.startsWith(say, after) && tails.some((tail) => text.startsWith(tail, after + say.length)));
|
|
73
|
+
};
|
|
74
|
+
|
|
56
75
|
/** A cue just before the quotation's opening mark, or just after its closing mark. position says which side it may stand on. */
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
/** Advice after the quotation silences only the cue after it: 山田氏によれば「…」と言う方が適切だ still gives the words to someone. */
|
|
77
|
+
const isAttributed = (text: string, quoted: Quoted, { cues, advice = [] }: QuoteWords): boolean => {
|
|
78
|
+
const advised = isAdvice(text, quoted, advice);
|
|
79
|
+
return cues.some((cue) =>
|
|
59
80
|
cueStarts(text, cue.pattern).some((at) => {
|
|
60
81
|
const before = cue.position !== "after" && at + cue.pattern.length <= quoted.start - 1 && at + cue.pattern.length >= quoted.start - 1 - CUE_REACH_BEFORE;
|
|
61
|
-
const after = cue.position !== "before" && at >= quoted.end + 1 && at <= quoted.end + 1 + CUE_REACH_AFTER;
|
|
82
|
+
const after = !advised && cue.position !== "before" && at >= quoted.end + 1 && at <= quoted.end + 1 + CUE_REACH_AFTER;
|
|
62
83
|
return before || after;
|
|
63
84
|
}),
|
|
64
85
|
);
|
|
86
|
+
};
|
|
65
87
|
|
|
66
|
-
const quotesIn = (sentence: QuoteText,
|
|
88
|
+
const quotesIn = (sentence: QuoteText, words: QuoteWords): UnsourcedQuote[] => {
|
|
67
89
|
return quotedSpans(sentence.text, QUOTATION_MARKS)
|
|
68
|
-
.filter((span) => [...sentence.text.slice(span.start, span.end).trim()].length >= MIN_QUOTE_CHARS && isAttributed(sentence.text, span,
|
|
90
|
+
.filter((span) => [...sentence.text.slice(span.start, span.end).trim()].length >= MIN_QUOTE_CHARS && isAttributed(sentence.text, span, words))
|
|
69
91
|
.map((span) => ({ offset: sentence.start + span.start, quote: sentence.text.slice(span.start, span.end).trim() }));
|
|
70
92
|
};
|
|
71
93
|
|
|
72
94
|
/** Each quotation given to someone, in a paragraph that names no source. cues: the word list quote-attribution. */
|
|
73
|
-
export const unsourcedQuotes = (paragraphs: readonly QuoteParagraph[], cues: readonly LexiconEntry[]): UnsourcedQuote[] =>
|
|
74
|
-
paragraphs
|
|
95
|
+
export const unsourcedQuotes = (paragraphs: readonly QuoteParagraph[], cues: readonly LexiconEntry[], advice: readonly LexiconEntry[] = []): UnsourcedQuote[] =>
|
|
96
|
+
paragraphs
|
|
97
|
+
.filter((paragraph) => !namesSource(paragraph.source))
|
|
98
|
+
.flatMap((paragraph) => paragraph.sentences.flatMap((sentence) => quotesIn(sentence, { cues, advice })));
|
|
75
99
|
|
|
76
|
-
|
|
100
|
+
/** Each block quotation given to someone by a dash line (— Name) with no source in it or on that line. */
|
|
101
|
+
export const unsourcedBlockQuotes = (quotations: readonly BlockQuotation[]): UnsourcedQuote[] =>
|
|
102
|
+
quotations
|
|
103
|
+
.filter((quotation) => [...quotation.quote].length >= MIN_QUOTE_CHARS && !namesSource(quotation.passage))
|
|
104
|
+
.map(({ offset, quote }) => ({ offset, quote }));
|
|
105
|
+
|
|
106
|
+
/** A dash and a `>` must both be there before the Markdown is read again. */
|
|
107
|
+
const MAY_HOLD_BLOCK_QUOTE = /^[ \t]*>/mu;
|
|
108
|
+
const MAY_HOLD_DASH = /[—―–]|--/u;
|
|
109
|
+
|
|
110
|
+
const blockQuotesOf = (doc: ProseDocument): UnsourcedQuote[] => {
|
|
111
|
+
if (!MAY_HOLD_BLOCK_QUOTE.test(doc.source) || !MAY_HOLD_DASH.test(doc.source) || doc.markup?.markdown !== true) return [];
|
|
112
|
+
return unsourcedBlockQuotes(blockQuotations(readMarkdown(doc.source).root, doc.source));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const paragraphQuotesOf = (doc: ProseDocument): UnsourcedQuote[] =>
|
|
77
116
|
unsourcedQuotes(
|
|
78
117
|
doc.paragraphs.map((paragraph) => ({
|
|
79
118
|
source: doc.source.slice(paragraph.span.start, paragraph.span.end),
|
|
80
119
|
sentences: paragraph.sentences.map((sentence) => ({ start: sentence.span.start, text: sentence.text })),
|
|
81
120
|
})),
|
|
82
121
|
doc.lexicons["quote-attribution"] ?? [],
|
|
83
|
-
|
|
122
|
+
doc.lexicons["quote-advice"] ?? [],
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
/** Every quotation in the document given to someone with no source, in document order: what the rule and `cite --scaffold` list. */
|
|
126
|
+
export const documentQuotesWithoutSource = (doc: ProseDocument): UnsourcedQuote[] =>
|
|
127
|
+
[...paragraphQuotesOf(doc), ...blockQuotesOf(doc)].toSorted((left, right) => left.offset - right.offset);
|
|
128
|
+
|
|
129
|
+
export const quoteWithoutSource: Detector = (doc: ProseDocument): Finding[] =>
|
|
130
|
+
documentQuotesWithoutSource(doc).map((hit) => ({
|
|
84
131
|
rule: "quote-without-source",
|
|
85
132
|
severity: "info",
|
|
86
133
|
line: 0,
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import type { Detector, Finding, Lexicon, LexiconEntry, ProseDocument, Sentence } from "../plugin.ts";
|
|
2
2
|
import { entryCloses, entryIn, entryRanges } from "./lexicon-match.ts";
|
|
3
|
+
import { openEndAt, openEndNames, type OpenEndNames } from "./open-end-names.ts";
|
|
3
4
|
|
|
4
5
|
// Requirements smells (Femmer et al. 2017; Berry et al. 2003; ISO/IEC/IEEE 29148): a loophole, an open-ended list and
|
|
5
6
|
// "and/or", in a sentence that states a requirement. What makes a sentence a requirement, and each smell's words, come
|
|
6
7
|
// from the language's lexicons; this file knows neither language.
|
|
7
8
|
|
|
9
|
+
const OPEN_END = "requirement-open-end";
|
|
10
|
+
|
|
8
11
|
/** Each smell: the lexicon of its words, and the finding's variant (the rule's messages). */
|
|
9
12
|
const SMELLS = [
|
|
10
13
|
{ lexicon: "requirement-loophole", variant: "loophole" },
|
|
11
|
-
{ lexicon:
|
|
14
|
+
{ lexicon: OPEN_END, variant: "open-end" },
|
|
12
15
|
{ lexicon: "requirement-either", variant: "either" },
|
|
13
16
|
] as const;
|
|
14
17
|
|
|
15
18
|
const MARKERS = "requirement-marker";
|
|
16
19
|
/** Sentence ends that look like a marker and are not one (「…のこと。」 defines a term). The language may have none. */
|
|
17
20
|
const NOT_MARKERS = "requirement-not-marker";
|
|
21
|
+
/** The language's words of a definition (をいう, means): a name defined with them closes its own list (銀行等(…をいう。)). */
|
|
22
|
+
const STATEMENTS = "definition-statement";
|
|
18
23
|
|
|
19
24
|
/** A marker with position: after counts only at the end of the sentence (「…できること。」); any other, anywhere in it. */
|
|
20
25
|
const isMarkedBy = (sentence: Sentence, entry: LexiconEntry): boolean => (entry.position === "after" ? entryCloses(sentence, entry) : entryIn(sentence, entry));
|
|
@@ -28,25 +33,40 @@ const offsetOf = (sentence: Sentence, entry: LexiconEntry): number => {
|
|
|
28
33
|
return range === undefined ? sentence.span.start : (sentence.tokens?.[range.start]?.span.start ?? sentence.span.start);
|
|
29
34
|
};
|
|
30
35
|
|
|
31
|
-
const findingOf = (sentence: Sentence, entry: LexiconEntry, variant: string): Finding => ({
|
|
36
|
+
const findingOf = (sentence: Sentence, entry: LexiconEntry, variant: string, offset: number): Finding => ({
|
|
32
37
|
rule: "",
|
|
33
38
|
severity: "warning",
|
|
34
39
|
line: 0,
|
|
35
40
|
column: 0,
|
|
36
41
|
quote: sentence.text.trim(),
|
|
37
42
|
variant,
|
|
38
|
-
values: { matched: entry.pattern, offset
|
|
43
|
+
values: { matched: entry.pattern, offset },
|
|
39
44
|
});
|
|
40
45
|
|
|
46
|
+
/** Where the word stands as a smell. An open-end word inside a name the document gives (業務執行取締役等) is none; without tokens it cannot be told apart. */
|
|
47
|
+
const smellAt = (doc: ProseDocument, sentence: Sentence, entry: LexiconEntry, lexicon: string, names: () => OpenEndNames): number | undefined => {
|
|
48
|
+
if (!entryIn(sentence, entry)) return undefined;
|
|
49
|
+
const tokenized = sentence.tokens !== undefined && (entry.tokens?.length ?? 0) > 0;
|
|
50
|
+
return lexicon === OPEN_END && tokenized ? openEndAt(doc, sentence, entry, names()) : offsetOf(sentence, entry);
|
|
51
|
+
};
|
|
52
|
+
|
|
41
53
|
/** The first word of each smell in one requirement sentence: one finding per smell, not per word. */
|
|
42
|
-
const smellsIn = (sentence: Sentence,
|
|
43
|
-
SMELLS.flatMap(({ lexicon, variant }) =>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
const smellsIn = (doc: ProseDocument, sentence: Sentence, names: () => OpenEndNames): Finding[] =>
|
|
55
|
+
SMELLS.flatMap(({ lexicon, variant }) =>
|
|
56
|
+
(doc.lexicons[lexicon] ?? [])
|
|
57
|
+
.flatMap((entry) => {
|
|
58
|
+
const offset = smellAt(doc, sentence, entry, lexicon, names);
|
|
59
|
+
return offset === undefined ? [] : [findingOf(sentence, entry, variant, offset)];
|
|
60
|
+
})
|
|
61
|
+
.slice(0, 1),
|
|
62
|
+
);
|
|
47
63
|
|
|
48
64
|
export const requirementSmell: Detector = (doc): Finding[] => {
|
|
49
65
|
const markers = doc.lexicons[MARKERS] ?? [];
|
|
50
66
|
const notMarkers = doc.lexicons[NOT_MARKERS] ?? [];
|
|
51
|
-
|
|
67
|
+
const statements = (doc.lexicons[STATEMENTS] ?? []).map((entry) => entry.pattern);
|
|
68
|
+
// Read once, and only when a requirement has an open-end word to tell apart from a name.
|
|
69
|
+
const cache: { names?: OpenEndNames } = {};
|
|
70
|
+
const names = (): OpenEndNames => (cache.names ??= openEndNames(doc, doc.lexicons[OPEN_END] ?? [], statements));
|
|
71
|
+
return doc.sentences.filter((sentence) => isRequirement(sentence, markers, notMarkers)).flatMap((sentence) => smellsIn(doc, sentence, names));
|
|
52
72
|
};
|
|
@@ -7,10 +7,12 @@ import { documentDateOf } from "./document-date.ts";
|
|
|
7
7
|
import { dateOrderBreaks } from "../structure/date-order.ts";
|
|
8
8
|
import { totalMismatches, type Amount } from "../structure/total.ts";
|
|
9
9
|
import { proseTotalMismatches } from "../structure/prose-total.ts";
|
|
10
|
+
import { countedAmounts, type SummedCounter } from "../structure/counted-amounts.ts";
|
|
10
11
|
import { rangeFrameOf, reversedRanges, type DatedSpan, type RangeWords } from "../structure/date-range.ts";
|
|
11
12
|
import { percentSumMismatches, type ShareWords } from "../structure/percent-sum.ts";
|
|
12
13
|
import { proseShareMismatches } from "../structure/percent-sum-prose.ts";
|
|
13
14
|
import { isQuotedAlone } from "../quoted-span.ts";
|
|
15
|
+
import { ordinalRunGaps } from "./ordinal-run-gaps.ts";
|
|
14
16
|
|
|
15
17
|
const QUOTE_LENGTH = 80;
|
|
16
18
|
|
|
@@ -48,28 +50,34 @@ const QUOTED_LINE = /^[ \t]*>/u;
|
|
|
48
50
|
/** 引用の中の箇条書きは、ほかの文書の例で、この文書の番号ではない。 */
|
|
49
51
|
const isQuotedList = (source: string, start: number): boolean => QUOTED_LINE.test(source.slice(lineStartAt(source, start), start));
|
|
50
52
|
|
|
51
|
-
const listNumberingGaps = (doc: ProseDocument):
|
|
52
|
-
doc.lists
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}));
|
|
53
|
+
const listNumberingGaps = (doc: ProseDocument): StructureIssue[] =>
|
|
54
|
+
doc.lists.filter((list) => !isQuotedList(doc.source, list.span.start)).flatMap((list) => listNumberBreaks(writtenNumbers(doc.source, list.itemSpans) ?? []));
|
|
55
|
+
|
|
56
|
+
const lineFindingOf = (doc: ProseDocument, issue: StructureIssue): Finding => ({
|
|
57
|
+
rule: "numbering-gap",
|
|
58
|
+
severity: "error",
|
|
59
|
+
line: 0,
|
|
60
|
+
column: 0,
|
|
61
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
62
|
+
values: { ...issue.values, offset: issue.offset },
|
|
63
|
+
});
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
|
-
* 番号の抜けと重なり:
|
|
66
|
-
*
|
|
66
|
+
* 番号の抜けと重なり: 番地の木の並び(条、項、号)、Markdown の番号付きの箇条書きに書いた番号、日程の第N回・Week N の並び
|
|
67
|
+
* (detectors/ordinal-run-gaps.ts)。一つの行が二つ以上に読まれる(条の中の「1.」、「1. Week 1」)ので、先に指した行は重ねて言わない。
|
|
67
68
|
*/
|
|
68
69
|
export const numberingGap: Detector = (doc, options): Finding[] => {
|
|
69
70
|
const fromTree = structureNumberingGap(doc, options);
|
|
70
71
|
const reported = new Set(fromTree.map((finding) => lineStartAt(doc.source, Number(finding.values["offset"]))));
|
|
71
|
-
const
|
|
72
|
-
|
|
72
|
+
const fromLines = [...listNumberingGaps(doc), ...ordinalRunGaps(doc)].filter((issue) => {
|
|
73
|
+
const line = lineStartAt(doc.source, issue.offset);
|
|
74
|
+
if (reported.has(line)) return false;
|
|
75
|
+
reported.add(line);
|
|
76
|
+
return true;
|
|
77
|
+
});
|
|
78
|
+
return [...fromTree, ...fromLines.map((issue) => lineFindingOf(doc, issue))].toSorted(
|
|
79
|
+
(left, right) => Number(left.values["offset"]) - Number(right.values["offset"]),
|
|
80
|
+
);
|
|
73
81
|
};
|
|
74
82
|
export const duplicateDefinition: Detector = findingsOf("duplicate-definition", duplicateDefinitions);
|
|
75
83
|
|
|
@@ -141,33 +149,43 @@ export const dateWeekdayMismatch: Detector = (doc): Finding[] => {
|
|
|
141
149
|
};
|
|
142
150
|
|
|
143
151
|
/** 木の日付を、原文の位置と一緒に並べる。 */
|
|
144
|
-
const datedPoints = (tree: NonNullable<ProseDocument["structure"]>): { offset: number; value: string }[] =>
|
|
152
|
+
export const datedPoints = (tree: NonNullable<ProseDocument["structure"]>): { offset: number; value: string }[] =>
|
|
145
153
|
inDocumentOrder(tree).flatMap((node) => (node.kind === "date" ? [{ offset: node.span.start, value: String(node.attrs["value"]) }] : []));
|
|
146
154
|
|
|
147
|
-
/**
|
|
155
|
+
/** 日程の並びに逆らう日付。並びの読み方は原文の行と見出しを見るので、木と原文と見出しを渡す。 */
|
|
148
156
|
export const dateOrder: Detector = (doc): Finding[] =>
|
|
149
157
|
doc.structure === undefined
|
|
150
158
|
? []
|
|
151
|
-
: dateOrderBreaks(doc.source, datedPoints(doc.structure)).map((issue) => ({
|
|
159
|
+
: dateOrderBreaks(doc.source, datedPoints(doc.structure), doc.markup?.headings ?? []).map((issue) => ({
|
|
152
160
|
rule: "date-order",
|
|
153
161
|
severity: "warning",
|
|
154
162
|
line: 0,
|
|
155
163
|
column: 0,
|
|
156
164
|
quote: quoteAt(doc.source, issue.offset),
|
|
157
165
|
values: { ...issue.values, offset: issue.offset },
|
|
166
|
+
...("next" in issue.values ? { variant: "first" } : {}),
|
|
158
167
|
}));
|
|
159
168
|
|
|
160
169
|
/** 木の数量を、原文の位置と一緒に並べる。 */
|
|
161
|
-
const amountsOf = (tree: NonNullable<ProseDocument["structure"]>): Amount[] =>
|
|
170
|
+
export const amountsOf = (tree: NonNullable<ProseDocument["structure"]>): Amount[] =>
|
|
162
171
|
inDocumentOrder(tree).flatMap((node) =>
|
|
163
172
|
node.kind === "quantity" ? [{ offset: node.span.start, end: node.span.end, value: Number(node.attrs["value"]), unit: String(node.attrs["unit"]) }] : [],
|
|
164
173
|
);
|
|
165
174
|
|
|
166
175
|
const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
|
|
167
176
|
|
|
177
|
+
const summedCountersOf = (doc: ProseDocument): SummedCounter[] =>
|
|
178
|
+
(doc.lexicons["summed-counter"] ?? []).map((entry) => ({ pattern: entry.pattern, unit: entry.group ?? entry.pattern }));
|
|
179
|
+
|
|
180
|
+
/** 木の数量に、解析器が助数詞と読まない足せる助数詞(16単位、3 credits)の付いた数を加えて、書いた順に並べる。 */
|
|
181
|
+
const summableAmountsOf = (doc: ProseDocument, tree: NonNullable<ProseDocument["structure"]>): Amount[] => {
|
|
182
|
+
const known = amountsOf(tree);
|
|
183
|
+
return [...known, ...countedAmounts(doc.source, summedCountersOf(doc), known)].toSorted((left, right) => left.offset - right.offset);
|
|
184
|
+
};
|
|
185
|
+
|
|
168
186
|
/** 合計の行と内訳の行、文の中の合計と内訳。同じ金額は一度だけ言う。 */
|
|
169
187
|
const totalIssues = (doc: ProseDocument, tree: NonNullable<ProseDocument["structure"]>): StructureIssue[] => {
|
|
170
|
-
const amounts =
|
|
188
|
+
const amounts = summableAmountsOf(doc, tree);
|
|
171
189
|
const lines = totalMismatches(doc.source, amounts, patternsOf(doc, "total-label"));
|
|
172
190
|
const words = {
|
|
173
191
|
totals: patternsOf(doc, "total-phrase"),
|
|
@@ -230,7 +248,11 @@ export const dateRangeReversed: Detector = (doc): Finding[] => {
|
|
|
230
248
|
|
|
231
249
|
const shareWordsOf = (doc: ProseDocument): ShareWords => ({
|
|
232
250
|
labels: (doc.lexicons["share-label"] ?? []).map((entry) => entry.pattern),
|
|
251
|
+
columnLabels: (doc.lexicons["share-column"] ?? []).map((entry) => entry.pattern),
|
|
252
|
+
rates: (doc.lexicons["share-column-rate"] ?? []).map((entry) => entry.pattern),
|
|
233
253
|
exceptions: (doc.lexicons["share-exception"] ?? []).map((entry) => entry.pattern),
|
|
254
|
+
rests: (doc.lexicons["share-rest"] ?? []).map((entry) => entry.pattern),
|
|
255
|
+
changes: (doc.lexicons["change-direction"] ?? []).map((entry) => entry.pattern),
|
|
234
256
|
units: (doc.lexicons["percent-unit"] ?? []).map((entry) => entry.pattern),
|
|
235
257
|
totalLabels: (doc.lexicons["total-label"] ?? []).map((entry) => entry.pattern),
|
|
236
258
|
});
|
|
@@ -42,6 +42,18 @@ const compound = (tokens: readonly Token[], range: TokenRange): boolean => {
|
|
|
42
42
|
return before !== undefined && first !== undefined && NOMINAL.has(before.pos) && before.span.end === first.span.start;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
+
const CLAUSE_END = new Set(["VERB", "AUX"]);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 連体修飾の節が空白を挟まずに付いた最上級(バグを検出できる唯一の・社員が選んだ最高の)。節が何の中で最もなのかを言う。
|
|
49
|
+
* 節の終わりは原形の動詞か助動詞。「首都であり最大の」の「あり」と「大切な最大の」の「な」は原形でないので節の終わりと読まない。
|
|
50
|
+
*/
|
|
51
|
+
const clauseBefore = (tokens: readonly Token[], range: TokenRange): boolean => {
|
|
52
|
+
const before = tokens[range.start - 1];
|
|
53
|
+
const first = tokens[range.start];
|
|
54
|
+
return before !== undefined && first !== undefined && CLAUSE_END.has(before.pos) && before.surface === before.lemma && before.span.end === first.span.start;
|
|
55
|
+
};
|
|
56
|
+
|
|
45
57
|
/** 名前 + 範囲の語 + 最上級(日本で最も・トヨタで最も・東京都で最大)。「費用で最大の効果」の「費用」は名前ではないので範囲にしない。 */
|
|
46
58
|
const namedBefore = (tokens: readonly Token[], range: TokenRange, markers: Lexicon): boolean =>
|
|
47
59
|
isMarker(tokens[range.start - 1], markers) && isNamed(tokens[range.start - 2]);
|
|
@@ -68,4 +80,4 @@ const phraseAfter = (tokens: readonly Token[], range: TokenRange, markers: Lexic
|
|
|
68
80
|
};
|
|
69
81
|
|
|
70
82
|
export const scoped = (tokens: readonly Token[], range: TokenRange, markers: ScopeMarkers): boolean =>
|
|
71
|
-
compound(tokens, range) || namedBefore(tokens, range, markers.before) || phraseAfter(tokens, range, markers.after);
|
|
83
|
+
compound(tokens, range) || clauseBefore(tokens, range) || namedBefore(tokens, range, markers.before) || phraseAfter(tokens, range, markers.after);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// tax-mismatch: the reading half. The words of a tax row, a total row and an included tax come from the language's
|
|
2
|
+
// lexicons (tax-label, total-label, tax-included-word); the amounts are the structure tree's.
|
|
3
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
4
|
+
import { taxMismatches, type TaxWords } from "../structure/tax.ts";
|
|
5
|
+
import { amountsOf, quoteAt } from "./structure-tree.ts";
|
|
6
|
+
|
|
7
|
+
const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
|
|
8
|
+
|
|
9
|
+
const wordsOf = (doc: ProseDocument): TaxWords => ({
|
|
10
|
+
labels: patternsOf(doc, "tax-label"),
|
|
11
|
+
totals: patternsOf(doc, "total-label"),
|
|
12
|
+
included: patternsOf(doc, "tax-included-word"),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const taxAmount: Detector = (doc): Finding[] =>
|
|
16
|
+
doc.structure === undefined
|
|
17
|
+
? []
|
|
18
|
+
: taxMismatches(doc.source, amountsOf(doc.structure), wordsOf(doc)).map((issue) => ({
|
|
19
|
+
rule: "tax-mismatch",
|
|
20
|
+
severity: "error",
|
|
21
|
+
line: 0,
|
|
22
|
+
column: 0,
|
|
23
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
24
|
+
values: { ...issue.values, offset: issue.offset },
|
|
25
|
+
}));
|
|
@@ -190,6 +190,11 @@ const MIN_STEPS = 3;
|
|
|
190
190
|
const isInflected = (token: Token): boolean =>
|
|
191
191
|
token.lemma !== undefined && token.lemma !== "" && token.surface.toLowerCase() !== token.lemma && token.features?.["VerbForm"] !== "Part";
|
|
192
192
|
|
|
193
|
+
const NOMINAL = new Set(["NOUN", "PROPN"]);
|
|
194
|
+
|
|
195
|
+
/** A determiner right after a noun opens a clause inside the phrase (a buffer that is big): the verb after it is the clause's, not a subject's. */
|
|
196
|
+
const opensClause = (words: readonly Token[]): boolean => words.some((token, at) => at > 0 && token.pos === "DET" && NOMINAL.has(words[at - 1]?.pos ?? ""));
|
|
197
|
+
|
|
193
198
|
/**
|
|
194
199
|
* A step written as a statement: a subject, then its verb. The subject opens with an article or a pronoun (The installer
|
|
195
200
|
* asks, You click), or it is a name or a noun whose verb is inflected (Docker builds). A noun before a base-form verb is
|
|
@@ -201,7 +206,8 @@ export const isStatement = (tokens: readonly Token[]): boolean => {
|
|
|
201
206
|
if (head === undefined || words.length < MIN_STEP_TOKENS || !SUBJECT_HEAD.has(head.pos)) return false;
|
|
202
207
|
const verbAt = rest.findIndex((token) => PREDICATE.has(token.pos));
|
|
203
208
|
const verb = rest[verbAt];
|
|
204
|
-
|
|
209
|
+
const subject = [head, ...rest.slice(0, verbAt)];
|
|
210
|
+
if (verb === undefined || !rest.slice(0, verbAt).every((token) => SUBJECT_PART.has(token.pos)) || opensClause(subject)) return false;
|
|
205
211
|
// Punctuation before the verb is no subject: a label (Guests: the users who …) or an opening phrase (On the left bar, select …).
|
|
206
212
|
const interrupted = tokens.some((token) => token.pos === "PUNCT" && token.span.start > head.span.start && token.span.start < verb.span.start);
|
|
207
213
|
return !interrupted && (SUBJECT_OPENER.has(head.pos) || isInflected(verb));
|