chaffjs 0.28.0 → 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/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 +38 -16
- 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/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 +6 -1
- package/dist/detectors/amount-scale.d.ts.map +1 -1
- package/dist/detectors/amount-scale.js +33 -9
- package/dist/detectors/amount-scale.js.map +1 -1
- 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/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.map +1 -1
- package/dist/detectors/currency-notation.js +2 -1
- 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 +70 -15
- 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 +76 -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 +82 -8
- 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/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/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 +23 -1
- package/dist/name-variants.d.ts.map +1 -1
- package/dist/name-variants.js +39 -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 +6 -0
- package/dist/structure/amount-scale.d.ts.map +1 -1
- package/dist/structure/amount-scale.js +13 -0
- package/dist/structure/amount-scale.js.map +1 -1
- 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/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 +4 -4
- package/rules/announced-count-mismatch.yaml +9 -4
- package/rules/arrival-before-departure.yaml +48 -0
- 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/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 +14 -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 +38 -16
- 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/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 +50 -17
- 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/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 +2 -1
- 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 +106 -15
- 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 +95 -3
- 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 +106 -13
- 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/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/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 +57 -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 +18 -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/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,248 @@
|
|
|
1
|
+
import { isNearWord, nameKey } from "./name-variants.ts";
|
|
2
|
+
import { escapeRegExp } from "./orthography.ts";
|
|
3
|
+
import { toKatakana } from "./kana-spelling.ts";
|
|
4
|
+
|
|
5
|
+
// 場所の名前を、文書の中で二通りに書いた所(八重洲中央口 と 八重州中央口、11th Street と 11th St.、King's Cross と Kings Cross)。
|
|
6
|
+
// 場所の名前は、場所を言う語(口、駅、センター、Street、Station)で終わる名前。場所の語は語彙表 place-word が言い、group が同じ語は
|
|
7
|
+
// 同じ語の別の書き方(Street と St.、Center と Centre)。名前の部分は、場所の語のすぐ前の、名前に使う字の連なり。
|
|
8
|
+
|
|
9
|
+
type Span = { readonly start: number; readonly end: number };
|
|
10
|
+
|
|
11
|
+
export type PlaceWord = { readonly pattern: string; readonly group: string };
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* surface は場所の語も含めた書いたまま。base は名前の部分、place は場所の語の組。reading は名前の部分の読み(読めなければ無い)。properAt は
|
|
15
|
+
* base の字のうち、品詞解析が固有名詞と読んだ語に入る字の位置(八重洲中央口 の 八・重・洲)。
|
|
16
|
+
*/
|
|
17
|
+
export type PlaceMention = {
|
|
18
|
+
readonly surface: string;
|
|
19
|
+
readonly offset: number;
|
|
20
|
+
readonly base: string;
|
|
21
|
+
readonly place: string;
|
|
22
|
+
readonly reading?: string | undefined;
|
|
23
|
+
readonly properAt: readonly number[];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 名前の現れの読み方。properWords は範囲に掛かる、品詞解析が固有名詞と読んだ語の範囲、isFunctionWord は名前の頭に立たない語(The、At)、readingOf は範囲の読み、joiners は
|
|
28
|
+
* 英字の名前の中に立つ小さい語(of)。
|
|
29
|
+
*/
|
|
30
|
+
export type PlaceReader = {
|
|
31
|
+
readonly properWords: (start: number, end: number) => readonly Span[];
|
|
32
|
+
readonly joiners: ReadonlySet<string>;
|
|
33
|
+
readonly isFunctionWord: (start: number, end: number) => boolean;
|
|
34
|
+
readonly readingOf: (start: number, end: number) => string | undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** spelling は記号・幅・大小だけ、place-word は場所の語の書き方、reading は読みが同じ、near は名前の一字違い。 */
|
|
38
|
+
export type PlaceRelation = "spelling" | "place-word" | "reading" | "near";
|
|
39
|
+
|
|
40
|
+
export type PlaceVariant = { readonly mention: PlaceMention; readonly usual: string; readonly kind: PlaceRelation };
|
|
41
|
+
|
|
42
|
+
const LATIN = /\p{Script=Latin}/u;
|
|
43
|
+
const LETTER = /\p{L}/u;
|
|
44
|
+
/** 漢字・カタカナの名前に使う字。ひらがなは名前の外(の、で、にて)。 */
|
|
45
|
+
const CJK_NAME = /[\p{Script=Katakana}\p{Script=Han}\p{Script=Latin}\p{N}ー・々]/u;
|
|
46
|
+
const HIRAGANA = /\p{Script=Hiragana}/u;
|
|
47
|
+
const JOINER = "・";
|
|
48
|
+
/** かなだけの名前の前に立つもの。空白、行の頭、開き括弧。読点のあと(、この口)は文の続き。 */
|
|
49
|
+
const KANA_NAME_OPENS = /^$|[\s(「『【([]/u;
|
|
50
|
+
/** 英字の名前の一語。大文字で始まる語か、序数(11th)。 */
|
|
51
|
+
const LATIN_NAME_WORD = /^(?:\p{Lu}[\p{L}'’&-]*|\d+(?:st|nd|rd|th))$/u;
|
|
52
|
+
|
|
53
|
+
/** 場所の語が語の終わりに立つか。続く字が名前の字なら、長い語の一部(口座、Streetcar)。 */
|
|
54
|
+
const endsWord = (source: string, end: number, latin: boolean): boolean => {
|
|
55
|
+
const next = source.charAt(end);
|
|
56
|
+
return latin ? !LETTER.test(next) : !CJK_NAME.test(next) || next === JOINER;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** 名前を探す、場所の語の前の範囲(UTF-16 の単位)。 */
|
|
60
|
+
const LOOKBACK = 40;
|
|
61
|
+
|
|
62
|
+
/** end のすぐ前の、char の字の連なりの始まり。 */
|
|
63
|
+
const runStart = (source: string, end: number, char: RegExp): number => {
|
|
64
|
+
const chars = Array.from(source.slice(Math.max(0, end - LOOKBACK), end));
|
|
65
|
+
return end - chars.slice(chars.findLastIndex((letter) => !char.test(letter)) + 1).join("").length;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 漢字・カタカナの名前: 場所の語の前の、名前に使う字の連なり。それが無く、空白や開き括弧のあとにひらがなだけが続くなら、かなで書いた
|
|
70
|
+
* 名前(博多駅 ちくし口)。語のあとのひらがな(東京駅の北口 の の)は名前の外。
|
|
71
|
+
*/
|
|
72
|
+
const cjkBaseBefore = (source: string, end: number): Span | undefined => {
|
|
73
|
+
const start = runStart(source, end, CJK_NAME);
|
|
74
|
+
const kanaStart = start === end ? runStart(source, end, HIRAGANA) : start;
|
|
75
|
+
const from = kanaStart < start && !KANA_NAME_OPENS.test(source.charAt(kanaStart - 1)) ? start : kanaStart;
|
|
76
|
+
const trimmed = source.startsWith(JOINER, from) ? from + 1 : from;
|
|
77
|
+
return trimmed < end ? { start: trimmed, end } : undefined;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** 英字の名前の一語の前に、空白一つで続く語。 */
|
|
81
|
+
const wordBefore = (source: string, at: number): Span | undefined => {
|
|
82
|
+
if (source.charAt(at - 1) !== " ") return undefined;
|
|
83
|
+
const from = Math.max(0, at - 1 - LOOKBACK);
|
|
84
|
+
const text = source.slice(from, at - 1);
|
|
85
|
+
const parts = text.split(/\s/u);
|
|
86
|
+
const word = parts.at(-1) ?? "";
|
|
87
|
+
if (word === "" || (from > 0 && parts.length === 1)) return undefined;
|
|
88
|
+
const start = from + text.length - word.length;
|
|
89
|
+
return { start, end: start + word.length };
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** 名前の前の、大文字で始まる短い略語(St. George Street の St.)。名前はそこから続くので、どこからが名前か分からない。 */
|
|
93
|
+
const LEADING_ABBREVIATION = /^\p{Lu}\p{L}{0,2}\.$/u;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 英字の名前: 場所の語の前の、空白一つでつながる大文字の語か序数の続き。名前の中の小さい語(University of Tokyo の of)は語彙表
|
|
97
|
+
* place-name-joiner が言う。頭の機能語(The、At)は外す。前に略語(St.)が立てば、名前の始まりが分からないので読まない。
|
|
98
|
+
*/
|
|
99
|
+
const latinBaseBefore = (source: string, end: number, reader: PlaceReader): Span | undefined => {
|
|
100
|
+
const words: Span[] = [];
|
|
101
|
+
const isNameWord = (span: Span | undefined): span is Span => span !== undefined && LATIN_NAME_WORD.test(source.slice(span.start, span.end));
|
|
102
|
+
const step = (at: number): Span | undefined => {
|
|
103
|
+
const word = wordBefore(source, at);
|
|
104
|
+
if (word === undefined) return undefined;
|
|
105
|
+
const joined = reader.joiners.has(source.slice(word.start, word.end)) && isNameWord(wordBefore(source, word.start));
|
|
106
|
+
if (!isNameWord(word) && !joined) return word;
|
|
107
|
+
words.unshift(word);
|
|
108
|
+
return step(word.start);
|
|
109
|
+
};
|
|
110
|
+
const stopper = step(end);
|
|
111
|
+
if (stopper !== undefined && LEADING_ABBREVIATION.test(source.slice(stopper.start, stopper.end))) return undefined;
|
|
112
|
+
const name = words.slice(
|
|
113
|
+
Math.max(
|
|
114
|
+
0,
|
|
115
|
+
words.findIndex((word) => !reader.isFunctionWord(word.start, word.end)),
|
|
116
|
+
),
|
|
117
|
+
);
|
|
118
|
+
const [first, last] = [name[0], name.at(-1)];
|
|
119
|
+
return first === undefined || last === undefined || reader.isFunctionWord(first.start, first.end) ? undefined : { start: first.start, end: last.end };
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* base の字のうち、名前の部分の中で閉じる固有名詞の語に入る字の位置。場所の語まで続く固有名詞(北口、日比谷公園)は、名前でなく
|
|
124
|
+
* 出口や施設の呼び名として読まれたものなので数えない。
|
|
125
|
+
*/
|
|
126
|
+
const properIndexes = (source: string, base: Span, properWords: readonly Span[]): number[] => {
|
|
127
|
+
const inside = properWords.filter((word) => word.end <= base.end);
|
|
128
|
+
return Array.from(source.slice(base.start, base.end)).flatMap((_char, index, chars) => {
|
|
129
|
+
const at = base.start + chars.slice(0, index).join("").length;
|
|
130
|
+
return inside.some((word) => word.start <= at && at < word.end) ? [index] : [];
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const mentionAt = (source: string, word: PlaceWord, at: number, reader: PlaceReader): PlaceMention | undefined => {
|
|
135
|
+
const latin = LATIN.test(word.pattern);
|
|
136
|
+
const end = at + word.pattern.length;
|
|
137
|
+
if (!endsWord(source, end, latin) || (latin && LETTER.test(source.charAt(at - 1)))) return undefined;
|
|
138
|
+
const base = latin ? latinBaseBefore(source, at, reader) : cjkBaseBefore(source, at);
|
|
139
|
+
if (base === undefined) return undefined;
|
|
140
|
+
return {
|
|
141
|
+
surface: source.slice(base.start, end),
|
|
142
|
+
offset: base.start,
|
|
143
|
+
base: source.slice(base.start, latin ? at - 1 : at),
|
|
144
|
+
place: word.group,
|
|
145
|
+
reading: latin ? undefined : reader.readingOf(base.start, at),
|
|
146
|
+
properAt: latin ? [] : properIndexes(source, base, reader.properWords(base.start, end)),
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/** 文書の中の場所の名前の現れ。同じ所で終わる場所の語は長いほうを取る(中央口 と 口)。 */
|
|
151
|
+
export const placeMentionsIn = (source: string, words: readonly PlaceWord[], reader: PlaceReader): PlaceMention[] => {
|
|
152
|
+
const ends = new Set<number>();
|
|
153
|
+
return words
|
|
154
|
+
.toSorted((left, right) => right.pattern.length - left.pattern.length)
|
|
155
|
+
.flatMap((word) =>
|
|
156
|
+
[...source.matchAll(new RegExp(escapeRegExp(word.pattern), "gu"))].flatMap((match) => {
|
|
157
|
+
const end = match.index + word.pattern.length;
|
|
158
|
+
if (ends.has(end)) return [];
|
|
159
|
+
const mention = mentionAt(source, word, match.index, reader);
|
|
160
|
+
if (mention !== undefined) ends.add(end);
|
|
161
|
+
return mention === undefined ? [] : [mention];
|
|
162
|
+
}),
|
|
163
|
+
)
|
|
164
|
+
.toSorted((left, right) => left.offset - right.offset);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const DIGIT = /\p{N}/u;
|
|
168
|
+
|
|
169
|
+
/** 漢字・かなの名前の部分が一字だけ違い、その字が、多いほうで固有名詞の語に入る(八重洲 と 八重州)。数字や方角(北口 と 南口)は別の所。 */
|
|
170
|
+
const isCjkSlip = (slip: PlaceMention, usual: PlaceMention): boolean => {
|
|
171
|
+
const [slipChars, usualChars] = [[...slip.base], [...usual.base]];
|
|
172
|
+
if (slipChars.length !== usualChars.length) return false;
|
|
173
|
+
const differ = usualChars.flatMap((char, index) => (char === slipChars[index] ? [] : [index]));
|
|
174
|
+
const [at] = differ;
|
|
175
|
+
return differ.length === 1 && at !== undefined && usual.properAt.includes(at) && !DIGIT.test(usualChars[at] ?? "") && !DIGIT.test(slipChars[at] ?? "");
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const latinWords = (base: string): string[] =>
|
|
179
|
+
base
|
|
180
|
+
.toLowerCase()
|
|
181
|
+
.replaceAll(/['’]/gu, "")
|
|
182
|
+
.split(/[\s-]+/u);
|
|
183
|
+
|
|
184
|
+
/** 英字の名前の部分が、一語だけ一字違い(Union と Unoin)。 */
|
|
185
|
+
const isLatinSlip = (slip: PlaceMention, usual: PlaceMention): boolean => {
|
|
186
|
+
const [slipWords, usualWords] = [latinWords(slip.base), latinWords(usual.base)];
|
|
187
|
+
const differ = usualWords.flatMap((word, index) => (word === slipWords[index] ? [] : [index]));
|
|
188
|
+
const [at] = differ;
|
|
189
|
+
return slipWords.length === usualWords.length && differ.length === 1 && at !== undefined && isNearWord(slipWords[at] ?? "", usualWords[at] ?? "");
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const HIRAGANA_ONLY = /^\p{Script=Hiragana}+$/u;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* ひらがなで書いた名前(ちくし)が、漢字で書いた名前(筑紫)の読みと同じか、一字だけ違う。解析器は地名の読みを一通りしか持たず
|
|
196
|
+
* (筑紫 を ツクシ と読む)、かなで書いた読み(チクシ)と一字ずれることがある。
|
|
197
|
+
*/
|
|
198
|
+
const isKanaSpellingOf = (slip: PlaceMention, usual: PlaceMention): boolean => {
|
|
199
|
+
if (!HIRAGANA_ONLY.test(slip.base) || usual.reading === undefined || HIRAGANA_ONLY.test(usual.base)) return false;
|
|
200
|
+
const [kana, reading] = [[...toKatakana(slip.base)], [...usual.reading]];
|
|
201
|
+
return kana.length === reading.length && kana.filter((char, index) => char !== reading[index]).length <= 1;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/** 一度だけ書いた形と、二度以上書いた形。読みの同じ別の所や一字違いの別の所もあるので、書き損じと見るのはこのときだけ。 */
|
|
205
|
+
type Counted = { readonly mention: PlaceMention; readonly count: number };
|
|
206
|
+
|
|
207
|
+
const isSlipOf = (slip: Counted, usual: Counted): boolean => slip.count === 1 && usual.count >= 2;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* 二つの書き方が、同じ所を二通りに書いたものか。場所の語の組が同じで、名前と語の全体が記号・幅・大小だけ違うか、場所の語の
|
|
211
|
+
* 書き方だけが違う(11th St. と 11th Street)か。名前の部分の読みが同じか、かなで書いた読み(筑紫口 と ちくし口)か、一字違い
|
|
212
|
+
* (八重洲 と 八重州)なのは、
|
|
213
|
+
* 少ないほうが一度だけ、多いほうが二度以上のときに限る。
|
|
214
|
+
*/
|
|
215
|
+
export const placeRelation = (slip: Counted, usual: Counted): PlaceRelation | undefined => {
|
|
216
|
+
const [left, right] = [slip.mention, usual.mention];
|
|
217
|
+
if (left.surface === right.surface || left.place !== right.place) return undefined;
|
|
218
|
+
if (nameKey(left.surface) === nameKey(right.surface)) return "spelling";
|
|
219
|
+
if (nameKey(left.base) === nameKey(right.base)) return "place-word";
|
|
220
|
+
if (!isSlipOf(slip, usual)) return undefined;
|
|
221
|
+
if ((left.reading !== undefined && left.reading === right.reading) || isKanaSpellingOf(left, right)) return "reading";
|
|
222
|
+
const latin = LATIN.test(left.base) && LATIN.test(right.base);
|
|
223
|
+
const slipped = latin ? isLatinSlip(left, right) : isCjkSlip(left, right);
|
|
224
|
+
return slipped ? "near" : undefined;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const talliesOf = (mentions: readonly PlaceMention[]): Counted[] => {
|
|
228
|
+
const tallies = new Map<string, Counted>();
|
|
229
|
+
mentions.forEach((mention) => {
|
|
230
|
+
const tally = tallies.get(mention.surface);
|
|
231
|
+
tallies.set(mention.surface, { mention: tally?.mention ?? mention, count: (tally?.count ?? 0) + 1 });
|
|
232
|
+
});
|
|
233
|
+
return [...tallies.values()];
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/** 多いほうが先。同数なら先に書いたほう。 */
|
|
237
|
+
const byUsage = (left: Counted, right: Counted): number => right.count - left.count || left.mention.offset - right.mention.offset;
|
|
238
|
+
|
|
239
|
+
/** 同じ所の、少ないほうの書き方。同じ所と言える相手のうち一番多いものと比べる。書き方ごとに最初の現れを一つ。 */
|
|
240
|
+
export const placeVariants = (mentions: readonly PlaceMention[]): PlaceVariant[] => {
|
|
241
|
+
const tallies = talliesOf(mentions);
|
|
242
|
+
return tallies.flatMap((tally) => {
|
|
243
|
+
const [usual] = tallies.filter((other) => other !== tally && placeRelation(tally, other) !== undefined).toSorted(byUsage);
|
|
244
|
+
if (usual === undefined || byUsage(usual, tally) > 0) return [];
|
|
245
|
+
const kind = placeRelation(tally, usual);
|
|
246
|
+
return kind === undefined ? [] : [{ mention: tally.mention, usual: usual.mention.surface, kind }];
|
|
247
|
+
});
|
|
248
|
+
};
|
package/src/plugin.ts
CHANGED
|
@@ -275,6 +275,8 @@ export type DocumentProfile = {
|
|
|
275
275
|
* inside の単位の行に、番号の後ろの本文が続くときだけ。
|
|
276
276
|
*/
|
|
277
277
|
readonly unnumbered?: { readonly indent: string; readonly inside: string; readonly depth: number } | undefined;
|
|
278
|
+
/** 定義した語を括弧に入れて、語そのものを指す(「株主」とあるのは、"controller" has the same meaning)。定義し直しでも、括弧の付け忘れでもない。 */
|
|
279
|
+
readonly quoteMentionsTerm?: boolean | undefined;
|
|
278
280
|
};
|
|
279
281
|
|
|
280
282
|
/**
|
|
@@ -497,6 +499,8 @@ export type RuleDefinition = {
|
|
|
497
499
|
/** 動かす言語。未指定は全言語。「ですます調」のように言語に固有の rule が使う。 */
|
|
498
500
|
readonly languages: readonly string[] | undefined;
|
|
499
501
|
readonly use_for: readonly string[];
|
|
502
|
+
/** Off unless chaff.yaml or its style gives the rule a level: a house style's own rule (a 公用文 spelling), wrong for other documents. */
|
|
503
|
+
readonly opt_in?: true;
|
|
500
504
|
readonly severity: Severity;
|
|
501
505
|
/** Options beyond the level (the direction and length for katakana-long-vowel). Most rules have none. */
|
|
502
506
|
readonly options?: Readonly<Record<string, RuleOption>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// A prerequisite ("Before you begin, stop the service", 「作業を始める前に、」) written after the numbered steps of its own
|
|
2
|
+
// section: the reader has done the steps by the time they read it. Pure; the openers come from the language's
|
|
3
|
+
// prerequisite-opener lexicon.
|
|
4
|
+
|
|
5
|
+
/** A span of the source, and the text of a sentence there. */
|
|
6
|
+
export type Placed = { readonly start: number; readonly end: number };
|
|
7
|
+
export type PlacedSentence = Placed & { readonly text: string };
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* What may follow an opener: a comma, or the end of the sentence. "Before you begin step 3" names one step, and
|
|
11
|
+
* 「始める前に戻すには」 is a state to return to, not a prerequisite.
|
|
12
|
+
*/
|
|
13
|
+
const AFTER_OPENER = new Set([",", "、", ",", ""]);
|
|
14
|
+
|
|
15
|
+
/** Whether a sentence opens with one of the openers, as a phrase of its own. */
|
|
16
|
+
export const opensWithPrerequisite = (text: string, openers: readonly string[]): boolean => {
|
|
17
|
+
const lowered = text.trimStart().toLowerCase();
|
|
18
|
+
return openers.some((opener) => {
|
|
19
|
+
const target = opener.toLowerCase();
|
|
20
|
+
return lowered.startsWith(target) && AFTER_OPENER.has(lowered.charAt(target.length));
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The sentences that open with a prerequisite and come after a numbered procedure ending in the same section. A section's
|
|
26
|
+
* prerequisite for a later section's steps comes before those steps, in that section, and is not reported.
|
|
27
|
+
*/
|
|
28
|
+
export const latePrerequisites = (
|
|
29
|
+
sections: readonly Placed[],
|
|
30
|
+
procedures: readonly Placed[],
|
|
31
|
+
sentences: readonly PlacedSentence[],
|
|
32
|
+
openers: readonly string[],
|
|
33
|
+
): PlacedSentence[] =>
|
|
34
|
+
sentences.filter((sentence) => {
|
|
35
|
+
if (!opensWithPrerequisite(sentence.text, openers)) return false;
|
|
36
|
+
const section = sections.findLast((candidate) => candidate.start <= sentence.start && sentence.start < candidate.end);
|
|
37
|
+
if (section === undefined) return false;
|
|
38
|
+
return procedures.some((procedure) => procedure.start >= section.start && procedure.end <= sentence.start);
|
|
39
|
+
});
|
package/src/profile/parse.ts
CHANGED
|
@@ -90,7 +90,16 @@ const languagesOf = (id: string, raw: Record<string, unknown>): Record<string, D
|
|
|
90
90
|
const unnumbered = unnumberedOf(section["unnumbered"]);
|
|
91
91
|
return [
|
|
92
92
|
language,
|
|
93
|
-
{
|
|
93
|
+
{
|
|
94
|
+
id,
|
|
95
|
+
addresses: strings(section["addresses"]),
|
|
96
|
+
connectives: strings(section["connectives"]),
|
|
97
|
+
addressEnd,
|
|
98
|
+
caption,
|
|
99
|
+
relative,
|
|
100
|
+
unnumbered,
|
|
101
|
+
...(section["quote_mentions_term"] === true ? { quoteMentionsTerm: true } : {}),
|
|
102
|
+
},
|
|
94
103
|
];
|
|
95
104
|
}),
|
|
96
105
|
);
|
package/src/reasons.ts
CHANGED
|
@@ -9,6 +9,8 @@ export type Reasons = {
|
|
|
9
9
|
readonly unreadTags: string;
|
|
10
10
|
readonly semantic: string;
|
|
11
11
|
readonly experimental: string;
|
|
12
|
+
/** A rule of one house style: it runs when chaff.yaml names that style, or gives the rule a level. */
|
|
13
|
+
readonly optIn: string;
|
|
12
14
|
readonly turnedOff: string;
|
|
13
15
|
readonly presetOff: (genre: string) => string;
|
|
14
16
|
readonly noStructure: (language: string) => string;
|
|
@@ -41,6 +43,7 @@ export const REASONS: Texts<Reasons> = {
|
|
|
41
43
|
unreadTags: "言語のパッケージがこの文書を読めなかったため(品詞の取れない段落があります)",
|
|
42
44
|
semantic: "意味を読む検査のため(npx chaffjs test で動きます)",
|
|
43
45
|
experimental: "まだ試験中のため",
|
|
46
|
+
optIn: "決まった書き方(chaff.yaml の style)のための rule で、style か rules で動かすため",
|
|
44
47
|
turnedOff: "設定で止めているため",
|
|
45
48
|
presetOff: (genre) => `ジャンル ${genre} では見ないため`,
|
|
46
49
|
noStructure: (language) => `${language} のパッケージは文書の構造を読めないため`,
|
|
@@ -63,6 +66,7 @@ export const REASONS: Texts<Reasons> = {
|
|
|
63
66
|
unreadTags: "the language package could not read this document (some paragraphs have no parts of speech)",
|
|
64
67
|
semantic: "it reads meaning; npx chaffjs test runs it",
|
|
65
68
|
experimental: "still experimental",
|
|
69
|
+
optIn: "it belongs to a house style, and runs when chaff.yaml names the style or gives it a level",
|
|
66
70
|
turnedOff: "turned off in the settings",
|
|
67
71
|
presetOff: (genre) => `the ${genre} genre does not check it`,
|
|
68
72
|
noStructure: (language) => `the ${language} package cannot read a document's structure`,
|
package/src/render/rules-json.ts
CHANGED
|
@@ -21,6 +21,7 @@ const TEXT: Texts<{
|
|
|
21
21
|
readonly offByGenre: (genre: string) => string;
|
|
22
22
|
readonly offUnsuited: (genre: string) => string;
|
|
23
23
|
readonly offExperimental: string;
|
|
24
|
+
readonly offOptIn: string;
|
|
24
25
|
readonly valuesNote: string;
|
|
25
26
|
readonly reason: string;
|
|
26
27
|
readonly byFile: string;
|
|
@@ -32,6 +33,7 @@ const TEXT: Texts<{
|
|
|
32
33
|
offByGenre: (genre) => `ジャンル ${genre} では見ない`,
|
|
33
34
|
offUnsuited: (genre) => `ジャンル ${genre} の文書には向かない rule(use_for)`,
|
|
34
35
|
offExperimental: "experimental な rule は既定で動かさない",
|
|
36
|
+
offOptIn: "決まった書き方(style)のための rule で、chaff.yaml の style か rules で動かす",
|
|
35
37
|
valuesNote: "この 4 語のかわりに数字を直接書いてもよい。4 語のほうを勧める。",
|
|
36
38
|
reason: "<理由>",
|
|
37
39
|
byFile: "chaff.yaml の rules に <rule-id>: <level> を足す。既定のままのものは書かない。",
|
|
@@ -49,6 +51,7 @@ const TEXT: Texts<{
|
|
|
49
51
|
offByGenre: (genre) => `the ${genre} genre does not check it`,
|
|
50
52
|
offUnsuited: (genre) => `not a rule for ${genre} documents (use_for)`,
|
|
51
53
|
offExperimental: "experimental rules do not run by default",
|
|
54
|
+
offOptIn: "a house style's rule: it runs when chaff.yaml names the style or gives it a level",
|
|
52
55
|
valuesNote: "A number may be written instead of these four words. The words are recommended.",
|
|
53
56
|
reason: "<reason>",
|
|
54
57
|
byFile: "Add <rule-id>: <level> under rules in chaff.yaml. Leave out anything at its default.",
|
|
@@ -76,6 +79,7 @@ const now = (rule: RuleDefinition, config: Config, limits: Limits, genre: string
|
|
|
76
79
|
const limit = rule.level_sets === "severity" ? undefined : limits[rule.id];
|
|
77
80
|
if (limit !== undefined) return { level: "normal", limit, set_as: "number" };
|
|
78
81
|
if (explicit !== undefined) return { level: explicit, ...effectAt(rule, explicit, genre) };
|
|
82
|
+
if (rule.opt_in === true) return { level: "off", why_off: text.offOptIn };
|
|
79
83
|
if (rule.status === "experimental" && !config.experimental) {
|
|
80
84
|
const alone = offOnlyAsExperimental(rule, config, genre, preset, language);
|
|
81
85
|
return { level: "off", why_off: text.offExperimental, ...(alone ? { turn_on_with: `npx chaffjs enable ${rule.id}` } : {}) };
|
|
@@ -7,7 +7,7 @@ import { nowFor } from "./rules-json.ts";
|
|
|
7
7
|
// `chaff rules`: every rule, grouped the way the reference groups them, with the level it runs at now.
|
|
8
8
|
// `chaff rules --json` carries the same and more, for an AI to read.
|
|
9
9
|
|
|
10
|
-
type RunsWhen = "default" | "experimental" | "team" | "test";
|
|
10
|
+
type RunsWhen = "default" | "experimental" | "style" | "team" | "test";
|
|
11
11
|
|
|
12
12
|
const TEXT: Texts<{
|
|
13
13
|
readonly heading: (genre: string, count: number) => string;
|
|
@@ -17,11 +17,12 @@ const TEXT: Texts<{
|
|
|
17
17
|
}> = {
|
|
18
18
|
ja: {
|
|
19
19
|
heading: (genre, count) => `chaff のルール ${count} 本(ジャンル ${genre})`,
|
|
20
|
-
runsWhen: { default: "既定", experimental: "試験中", team: "要設定", test: "AI" },
|
|
20
|
+
runsWhen: { default: "既定", experimental: "試験中", style: "style", team: "要設定", test: "AI" },
|
|
21
21
|
ungrouped: "(グループ未設定)",
|
|
22
22
|
footer: [
|
|
23
23
|
"既定: 何も書かなくても動く 試験中: --experimental か chaff.yaml で動く",
|
|
24
24
|
"要設定: chaff.yaml に語や見出しを書いたときだけ AI: npx chaffjs test で動く",
|
|
25
|
+
"style: chaff.yaml の style(koyobun など)か rules で動く",
|
|
25
26
|
"",
|
|
26
27
|
"詳しく: npx chaffjs explain <rule>",
|
|
27
28
|
"AI に渡す: npx chaffjs rules --json",
|
|
@@ -29,11 +30,12 @@ const TEXT: Texts<{
|
|
|
29
30
|
},
|
|
30
31
|
en: {
|
|
31
32
|
heading: (genre, count) => `chaff's ${count} rules (genre ${genre})`,
|
|
32
|
-
runsWhen: { default: "default", experimental: "experimental", team: "needs list", test: "AI" },
|
|
33
|
+
runsWhen: { default: "default", experimental: "experimental", style: "style", team: "needs list", test: "AI" },
|
|
33
34
|
ungrouped: "(no group yet)",
|
|
34
35
|
footer: [
|
|
35
36
|
"default: runs with no settings experimental: runs with --experimental or a level in chaff.yaml",
|
|
36
37
|
"needs list: runs only on words or headings listed in chaff.yaml AI: runs with npx chaffjs test",
|
|
38
|
+
"style: runs with a style in chaff.yaml (koyobun and others) or a level under rules",
|
|
37
39
|
"",
|
|
38
40
|
"More on one rule: npx chaffjs explain <rule>",
|
|
39
41
|
"For an AI: npx chaffjs rules --json",
|
|
@@ -44,6 +46,7 @@ const TEXT: Texts<{
|
|
|
44
46
|
const runsWhenOf = (rule: RuleDefinition): RunsWhen => {
|
|
45
47
|
if (rule.layer === "L4") return "test";
|
|
46
48
|
if (rule.guide?.group === "team") return "team";
|
|
49
|
+
if (rule.opt_in === true) return "style";
|
|
47
50
|
return rule.status === "experimental" ? "experimental" : "default";
|
|
48
51
|
};
|
|
49
52
|
|
package/src/rule-genres.ts
CHANGED
|
@@ -2,24 +2,27 @@ import type { Level, RuleDefinition } from "./plugin.ts";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* How a rule stands in one genre, with no chaff.yaml: the same order of precedence as a run (use_for, then the genre's
|
|
5
|
-
* preset, then the rule's status).
|
|
5
|
+
* preset, then opt_in, then the rule's status).
|
|
6
6
|
* unsuited: the rule is not for this kind of document (use_for), and does not run
|
|
7
7
|
* genre-off: the genre's preset turns it off
|
|
8
|
+
* opt-in: it runs only where chaff.yaml's style or rules give it a level
|
|
8
9
|
* experimental: it runs only with --experimental or a level in chaff.yaml
|
|
9
10
|
* on: it runs, at this level
|
|
10
11
|
*/
|
|
11
12
|
export type GenreStanding =
|
|
12
13
|
| { readonly kind: "unsuited" }
|
|
13
14
|
| { readonly kind: "genre-off" }
|
|
15
|
+
| { readonly kind: "opt-in" }
|
|
14
16
|
| { readonly kind: "experimental" }
|
|
15
17
|
| { readonly kind: "on"; readonly level: Exclude<Level, "off">; readonly byPreset: boolean };
|
|
16
18
|
|
|
17
|
-
type RuleFacts = Pick<RuleDefinition, "id" | "status" | "use_for">;
|
|
19
|
+
type RuleFacts = Pick<RuleDefinition, "id" | "status" | "use_for" | "opt_in">;
|
|
18
20
|
|
|
19
21
|
export const standingIn = (rule: RuleFacts, genre: string, preset: Readonly<Record<string, Level>>): GenreStanding => {
|
|
20
22
|
if (!rule.use_for.some((target) => genre.startsWith(target))) return { kind: "unsuited" };
|
|
21
23
|
const fromPreset = preset[rule.id];
|
|
22
24
|
if (fromPreset === "off") return { kind: "genre-off" };
|
|
23
25
|
if (fromPreset !== undefined) return { kind: "on", level: fromPreset, byPreset: true };
|
|
26
|
+
if (rule.opt_in === true) return { kind: "opt-in" };
|
|
24
27
|
return rule.status === "experimental" ? { kind: "experimental" } : { kind: "on", level: "normal", byPreset: false };
|
|
25
28
|
};
|
package/src/rule-load.ts
CHANGED
|
@@ -105,10 +105,11 @@ const numberFor = (raw: unknown, language: string): number | undefined => {
|
|
|
105
105
|
|
|
106
106
|
const stringList = (value: unknown): string[] | undefined => (Array.isArray(value) ? value.map((entry) => String(entry)) : undefined);
|
|
107
107
|
|
|
108
|
-
/** What only some rules declare: options beyond the level,
|
|
109
|
-
const extrasOf = (raw: Record<string, unknown>, file: string): Pick<RuleDefinition, "options" | "token_features"> => ({
|
|
108
|
+
/** What only some rules declare: options beyond the level, token features the adapter computes on request, and opt_in. */
|
|
109
|
+
const extrasOf = (raw: Record<string, unknown>, file: string): Pick<RuleDefinition, "options" | "token_features" | "opt_in"> => ({
|
|
110
110
|
...(raw["options"] === undefined ? {} : { options: optionsOf(raw["options"], file) }),
|
|
111
111
|
...(raw["token_features"] === undefined ? {} : { token_features: stringList(raw["token_features"]) ?? [] }),
|
|
112
|
+
...(raw["opt_in"] === true ? { opt_in: true } : {}),
|
|
112
113
|
});
|
|
113
114
|
|
|
114
115
|
/** The table flattenLevels reads, before its severities become numbers. */
|
package/src/run.ts
CHANGED
|
@@ -47,14 +47,16 @@ export const levelFor = (rule: RuleDefinition, settings: Settings, experimental:
|
|
|
47
47
|
// ジャンルの既定は chaff.yaml より弱く、status の既定より強い。--experimental でも、ジャンルが止めたものは止めたまま。
|
|
48
48
|
const fromPreset = preset[rule.id];
|
|
49
49
|
if (fromPreset !== undefined) return fromPreset;
|
|
50
|
+
if (rule.opt_in === true) return "off";
|
|
50
51
|
if (rule.status === "experimental" && !experimental) return "off";
|
|
51
52
|
return "normal";
|
|
52
53
|
};
|
|
53
54
|
|
|
54
|
-
/** Why a rule at off did not run: chaff.yaml turned it off, the genre's preset did, or it is experimental. */
|
|
55
|
+
/** Why a rule at off did not run: chaff.yaml turned it off, the genre's preset did, it waits for a style, or it is experimental. */
|
|
55
56
|
const offSkip = (rule: RuleDefinition, settings: Settings, preset: Settings, genre: string, reasons: Reasons): Skipped => {
|
|
56
57
|
if (settings[rule.id] !== undefined) return { rule: rule.id, why: reasons.turnedOff };
|
|
57
58
|
if (preset[rule.id] !== undefined) return { rule: rule.id, why: reasons.presetOff(genre) };
|
|
59
|
+
if (rule.opt_in === true) return { rule: rule.id, why: reasons.optIn };
|
|
58
60
|
return { rule: rule.id, why: reasons.experimental, offUntilExperimental: true };
|
|
59
61
|
};
|
|
60
62
|
|
package/src/spelling.ts
CHANGED
|
@@ -79,3 +79,11 @@ export const wordsToCheck = (text: string, minLength: number, maxLength: number)
|
|
|
79
79
|
)
|
|
80
80
|
.map((match) => ({ offset: match.index, word: match[0] }));
|
|
81
81
|
};
|
|
82
|
+
|
|
83
|
+
/** 頭の字を強調(**G**lobally)や角括弧(引用を変えた [e]xpressions)で分けた語の残りの、直前の形。 */
|
|
84
|
+
const SPLIT_HEAD = /(?:\p{L}[*_~]+|\[\p{L}\])$/u;
|
|
85
|
+
/** 直前を見る字の数。強調の印と頭の字が収まればよい。 */
|
|
86
|
+
const SPLIT_LOOKBACK = 8;
|
|
87
|
+
|
|
88
|
+
/** source(Markdown のままの文書)の offset から始まる語が、頭の字を分けた語の残りか。 */
|
|
89
|
+
export const isSplitWord = (source: string, offset: number): boolean => SPLIT_HEAD.test(source.slice(Math.max(0, offset - SPLIT_LOOKBACK), offset));
|