chaffjs 0.28.0 → 0.30.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/session-hours.d.ts +26 -0
- package/dist/derived/session-hours.d.ts.map +1 -0
- package/dist/derived/session-hours.js +29 -0
- package/dist/derived/session-hours.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/derived/time-lengths.d.ts +37 -0
- package/dist/derived/time-lengths.d.ts.map +1 -0
- package/dist/derived/time-lengths.js +168 -0
- package/dist/derived/time-lengths.js.map +1 -0
- package/dist/derived/unit-counts.d.ts +7 -0
- package/dist/derived/unit-counts.d.ts.map +1 -0
- package/dist/derived/unit-counts.js +13 -0
- package/dist/derived/unit-counts.js.map +1 -0
- package/dist/derived/working-hours.d.ts +36 -0
- package/dist/derived/working-hours.d.ts.map +1 -0
- package/dist/derived/working-hours.js +55 -0
- package/dist/derived/working-hours.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/acronym-expansion.d.ts +1 -1
- package/dist/detectors/acronym-expansion.d.ts.map +1 -1
- package/dist/detectors/acronym-expansion.js +46 -2
- package/dist/detectors/acronym-expansion.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/capitalised-term.d.ts +44 -0
- package/dist/detectors/capitalised-term.d.ts.map +1 -0
- package/dist/detectors/capitalised-term.js +101 -0
- package/dist/detectors/capitalised-term.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 +37 -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 +3 -1
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +119 -10
- 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 +129 -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/party-order.d.ts +3 -0
- package/dist/detectors/party-order.d.ts.map +1 -0
- package/dist/detectors/party-order.js +46 -0
- package/dist/detectors/party-order.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/connection-time-short.d.ts +3 -0
- package/dist/detectors/registry/connection-time-short.d.ts.map +1 -0
- package/dist/detectors/registry/connection-time-short.js +3 -0
- package/dist/detectors/registry/connection-time-short.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/duration-product-mismatch.d.ts +3 -0
- package/dist/detectors/registry/duration-product-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/duration-product-mismatch.js +3 -0
- package/dist/detectors/registry/duration-product-mismatch.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/party-order.d.ts +3 -0
- package/dist/detectors/registry/party-order.d.ts.map +1 -0
- package/dist/detectors/registry/party-order.js +3 -0
- package/dist/detectors/registry/party-order.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/requirement-lists.d.ts +3 -0
- package/dist/detectors/registry/requirement-lists.d.ts.map +1 -0
- package/dist/detectors/registry/requirement-lists.js +3 -0
- package/dist/detectors/registry/requirement-lists.js.map +1 -0
- package/dist/detectors/registry/return-type.d.ts +3 -0
- package/dist/detectors/registry/return-type.d.ts.map +1 -0
- package/dist/detectors/registry/return-type.js +3 -0
- package/dist/detectors/registry/return-type.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-lists.d.ts +3 -0
- package/dist/detectors/requirement-lists.d.ts.map +1 -0
- package/dist/detectors/requirement-lists.js +46 -0
- package/dist/detectors/requirement-lists.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/return-type.d.ts +3 -0
- package/dist/detectors/return-type.d.ts.map +1 -0
- package/dist/detectors/return-type.js +24 -0
- package/dist/detectors/return-type.js.map +1 -0
- 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 +40 -15
- 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 +5 -0
- package/dist/detectors/time-order.d.ts.map +1 -0
- package/dist/detectors/time-order.js +58 -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 +101 -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/document.d.ts.map +1 -1
- package/dist/document.js +4 -1
- package/dist/document.js.map +1 -1
- 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 +18 -0
- package/dist/facts/table-facts.d.ts.map +1 -1
- package/dist/facts/table-facts.js +4 -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 +29 -2
- package/dist/name-variants.d.ts.map +1 -1
- package/dist/name-variants.js +107 -8
- package/dist/name-variants.js.map +1 -1
- package/dist/name-word-order.d.ts +49 -0
- package/dist/name-word-order.d.ts.map +1 -0
- package/dist/name-word-order.js +114 -0
- package/dist/name-word-order.js.map +1 -0
- 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 +11 -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/return-type.d.ts +33 -0
- package/dist/return-type.d.ts.map +1 -0
- package/dist/return-type.js +302 -0
- package/dist/return-type.js.map +1 -0
- 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/connection-times.d.ts +56 -0
- package/dist/structure/connection-times.d.ts.map +1 -0
- package/dist/structure/connection-times.js +165 -0
- package/dist/structure/connection-times.js.map +1 -0
- 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-tie.d.ts +13 -0
- package/dist/structure/date-order-tie.d.ts.map +1 -0
- package/dist/structure/date-order-tie.js +61 -0
- package/dist/structure/date-order-tie.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 +66 -17
- package/dist/structure/date-order.js.map +1 -1
- package/dist/structure/date-outside-period.d.ts +33 -0
- package/dist/structure/date-outside-period.d.ts.map +1 -0
- package/dist/structure/date-outside-period.js +132 -0
- package/dist/structure/date-outside-period.js.map +1 -0
- package/dist/structure/date-range.d.ts +5 -2
- package/dist/structure/date-range.d.ts.map +1 -1
- package/dist/structure/date-range.js +37 -9
- package/dist/structure/date-range.js.map +1 -1
- 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 +36 -0
- package/dist/structure/leg-times.d.ts.map +1 -0
- package/dist/structure/leg-times.js +148 -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/party-order.d.ts +33 -0
- package/dist/structure/party-order.d.ts.map +1 -0
- package/dist/structure/party-order.js +79 -0
- package/dist/structure/party-order.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/requirement-lists.d.ts +37 -0
- package/dist/structure/requirement-lists.d.ts.map +1 -0
- package/dist/structure/requirement-lists.js +89 -0
- package/dist/structure/requirement-lists.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 +42 -0
- package/dist/structure/time-order.d.ts.map +1 -0
- package/dist/structure/time-order.js +107 -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 +25 -0
- package/dist/structure/version-order.d.ts.map +1 -0
- package/dist/structure/version-order.js +77 -0
- package/dist/structure/version-order.js.map +1 -0
- package/dist/surname-near.d.ts +6 -0
- package/dist/surname-near.d.ts.map +1 -0
- package/dist/surname-near.js +31 -0
- package/dist/surname-near.js.map +1 -0
- package/dist/table-cells.d.ts +13 -0
- package/dist/table-cells.d.ts.map +1 -0
- package/dist/table-cells.js +36 -0
- package/dist/table-cells.js.map +1 -0
- package/dist/table-names.d.ts +42 -0
- package/dist/table-names.d.ts.map +1 -0
- package/dist/table-names.js +94 -0
- package/dist/table-names.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/connection-time-short.yaml +52 -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 +15 -4
- package/rules/duration-product-mismatch.yaml +73 -0
- 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 +20 -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/party-order.yaml +84 -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/required-listed-as-preferred.yaml +102 -0
- package/rules/requirement-smell.yaml +3 -3
- package/rules/return-type-mismatch.yaml +79 -0
- 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 +86 -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/session-hours.ts +62 -0
- package/src/derived/stays.ts +145 -0
- package/src/derived/time-lengths.ts +226 -0
- package/src/derived/unit-counts.ts +18 -0
- package/src/derived/working-hours.ts +97 -0
- package/src/detectors/acronym-context.ts +10 -2
- package/src/detectors/acronym-expansion.ts +57 -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/capitalised-term.ts +147 -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 +41 -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 +174 -10
- 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 +164 -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/party-order.ts +50 -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/connection-time-short.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/duration-product-mismatch.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/party-order.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/requirement-lists.ts +4 -0
- package/src/detectors/registry/return-type.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-lists.ts +65 -0
- package/src/detectors/requirement-smell.ts +29 -9
- package/src/detectors/return-type.ts +30 -0
- package/src/detectors/structure-tree.ts +55 -22
- 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 +84 -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 +120 -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/document.ts +4 -1
- 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 +6 -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 +133 -12
- package/src/name-word-order.ts +149 -0
- 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 +9 -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/return-type.ts +361 -0
- 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/connection-times.ts +226 -0
- package/src/structure/counted-amounts.ts +42 -0
- package/src/structure/date-order-tie.ts +86 -0
- package/src/structure/date-order.ts +100 -23
- package/src/structure/date-outside-period.ts +192 -0
- package/src/structure/date-range.ts +45 -9
- 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 +213 -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/party-order.ts +115 -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/requirement-lists.ts +145 -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 +141 -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 +94 -0
- package/src/surname-near.ts +31 -0
- package/src/table-cells.ts +41 -0
- package/src/table-names.ts +113 -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
package/dist/spelling.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spelling.js","sourceRoot":"","sources":["../src/spelling.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAWzD,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,OAAgB,EAAW,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1G,mDAAmD;AACnD,MAAM,QAAQ,GAAG,CAAC,CAAC;AAEnB,iEAAiE;AACjE,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,QAA2B,EAAY,EAAE,CACtE,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE;IAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,QAAQ;QAAE,OAAO,EAAE,CAAC;IAChF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACjG,OAAO,CAAC,GAAG,IAAI,GAAG,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEL,MAAM,QAAQ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EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,SAAS,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CACxJ;SACA,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAC;AAEF,oEAAoE;AACpE,MAAM,UAAU,GAAG,6BAA6B,CAAC;AACjD,gCAAgC;AAChC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,4DAA4D;AAC5D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,MAAc,EAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MarkupHeading } from "../plugin.ts";
|
|
2
|
+
import type { DatedPoint } from "./due-date.ts";
|
|
3
|
+
import type { StructureIssue } from "./issues.ts";
|
|
4
|
+
/**
|
|
5
|
+
* An action item due before the meeting it was set in. Only minutes are read (a title with 議事録 or Minutes). The meeting
|
|
6
|
+
* date is the first date on a line starting with a meeting-date word (日時, Date) near the top; the deadlines are those of the action sections (a heading with 宿題 or
|
|
7
|
+
* Action items): the cell under a due column (期限, Due) of a table, or a date right after a due word in a list item
|
|
8
|
+
* ((期限 11月2日), (due Oct 3)). An item marked done, and a section on earlier items (前回の宿題), are not read. Pure.
|
|
9
|
+
*/
|
|
10
|
+
export type ActionWords = {
|
|
11
|
+
readonly meeting: readonly string[];
|
|
12
|
+
readonly section: readonly string[];
|
|
13
|
+
readonly earlier: readonly string[];
|
|
14
|
+
readonly due: readonly string[];
|
|
15
|
+
readonly done: readonly string[];
|
|
16
|
+
readonly minutes: readonly string[];
|
|
17
|
+
};
|
|
18
|
+
/** Whether a deadline is before the meeting. Without a year on one of them, a deadline early in the next year is not. */
|
|
19
|
+
export declare const isBeforeMeeting: (due: string, meeting: string) => boolean;
|
|
20
|
+
export declare const actionDueBeforeMeeting: (source: string, dates: readonly DatedPoint[], headings: readonly MarkupHeading[], words: ActionWords) => StructureIssue[];
|
|
21
|
+
//# sourceMappingURL=action-due.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-due.d.ts","sourceRoot":"","sources":["../../src/structure/action-due.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;AAqIF,yHAAyH;AACzH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,KAAG,OAO9D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,MAAM,EACd,OAAO,SAAS,UAAU,EAAE,EAC5B,UAAU,SAAS,aAAa,EAAE,EAClC,OAAO,WAAW,KACjB,cAAc,EAShB,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { CELL_SEPARATOR } from "./bare-numbers.js";
|
|
2
|
+
import { linesOf } from "./lines.js";
|
|
3
|
+
import { TABLE_RULE } from "./runs.js";
|
|
4
|
+
import { isTotalLabel } from "./total.js";
|
|
5
|
+
/** How far from the top the meeting date may be and still be the date of the meeting the minutes record. */
|
|
6
|
+
const MEETING_HEAD_LINES = 12;
|
|
7
|
+
/** A deadline without a year this many days or fewer after the meeting, read in the next year, is taken as next year's. */
|
|
8
|
+
const MAX_WRAP_DAYS = 92;
|
|
9
|
+
const MS_PER_DAY = 86_400_000;
|
|
10
|
+
const FULL_DATE = /^\d{4}-\d{2}-\d{2}$/u;
|
|
11
|
+
const MONTH_DAY = /^(?:\d{4}-)?(\d{2})-(\d{2})$/u;
|
|
12
|
+
const LIST_ITEM = /^[ \t]*(?:[-*+]|\d{1,3}[.)])[ \t]/u;
|
|
13
|
+
const LATIN_WORD = /^[A-Za-z ]+$/u;
|
|
14
|
+
const escaped = (text) => text.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
15
|
+
const hasWord = (text, word) => (LATIN_WORD.test(word) ? new RegExp(`\\b${escaped(word)}\\b`, "iu").test(text) : text.includes(word));
|
|
16
|
+
const hasAny = (text, words) => words.some((word) => hasWord(text, word));
|
|
17
|
+
const CHECKED_BOX = /^[ \t]*(?:[-*+]|\d{1,3}[.)])[ \t]+\[[xX]\]/u;
|
|
18
|
+
const BRACKETED = /[((【[][^()()【】[\]]*[))】\]]/gu;
|
|
19
|
+
const TRAIL_SEPARATOR = /[ \t—–::、,]/u;
|
|
20
|
+
const LINE_CLOSERS = new Set(["|", "。", ".", " ", "\t"]);
|
|
21
|
+
/** The last word of a line, without a closing table bar or a full stop. */
|
|
22
|
+
const lastWord = (text) => (text
|
|
23
|
+
.slice(0, text.split("").findLastIndex((unit) => !LINE_CLOSERS.has(unit)) + 1)
|
|
24
|
+
.split(TRAIL_SEPARATOR)
|
|
25
|
+
.at(-1) ?? "").toLowerCase();
|
|
26
|
+
const cellTexts = (text) => text.split(CELL_SEPARATOR).map((cell) => cell
|
|
27
|
+
.replace(/[*_✔✓]/gu, "")
|
|
28
|
+
.trim()
|
|
29
|
+
.toLowerCase());
|
|
30
|
+
/**
|
|
31
|
+
* An item marked done: a checked box, a cell that is a done word alone, a done word in brackets ((済), (done, June 3)),
|
|
32
|
+
* or one ending the line. A done word inside the task (Complete the review) does not mark it.
|
|
33
|
+
*/
|
|
34
|
+
const isMarkedDone = (text, words) => {
|
|
35
|
+
if (CHECKED_BOX.test(text))
|
|
36
|
+
return true;
|
|
37
|
+
const alone = new Set(words.map((word) => word.toLowerCase()));
|
|
38
|
+
return cellTexts(text).some((cell) => alone.has(cell)) || alone.has(lastWord(text)) || [...text.matchAll(BRACKETED)].some((match) => hasAny(match[0], words));
|
|
39
|
+
};
|
|
40
|
+
/** Whether the title (the first top-level heading, or else the first line with text) names minutes. */
|
|
41
|
+
const isMinutes = (lines, headings, words) => hasAny(headings.find((heading) => heading.depth === 1)?.text ?? lines.find((line) => line.text.trim() !== "")?.text ?? "", words);
|
|
42
|
+
const datesIn = (dates, start, end) => dates.filter((date) => date.offset >= start && date.offset <= end);
|
|
43
|
+
const meetingDate = (lines, dates, words) => lines
|
|
44
|
+
.slice(0, MEETING_HEAD_LINES)
|
|
45
|
+
.filter((line) => isTotalLabel(line.text, words))
|
|
46
|
+
.map((line) => datesIn(dates, line.start, line.start + line.text.length)[0])
|
|
47
|
+
.find((date) => date !== undefined);
|
|
48
|
+
/** Where a heading's section ends: the next heading at its depth or above. */
|
|
49
|
+
const sectionOf = (headings, index, end) => {
|
|
50
|
+
const heading = headings[index];
|
|
51
|
+
const next = headings.slice(index + 1).find((later) => heading !== undefined && later.depth <= heading.depth);
|
|
52
|
+
return { start: heading?.start ?? end, end: next?.start ?? end };
|
|
53
|
+
};
|
|
54
|
+
/** The action sections, without the parts under a heading on earlier items. */
|
|
55
|
+
const actionRanges = (headings, length, words) => {
|
|
56
|
+
const ranges = headings.map((heading, index) => ({ heading, range: sectionOf(headings, index, length) }));
|
|
57
|
+
return {
|
|
58
|
+
take: ranges.filter(({ heading }) => hasAny(heading.text, words.section)).map(({ range }) => range),
|
|
59
|
+
skip: ranges.filter(({ heading }) => hasAny(heading.text, words.earlier)).map(({ range }) => range),
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const inside = (offset, ranges) => ranges.some((range) => offset >= range.start && offset < range.end);
|
|
63
|
+
/** The column of a table header that is a due word alone, if the line is a header (the next line is the table's rule). */
|
|
64
|
+
const dueColumn = (line, next, words) => {
|
|
65
|
+
if (next === undefined || !TABLE_RULE.test(next.text) || !line.text.includes("|"))
|
|
66
|
+
return undefined;
|
|
67
|
+
const labels = new Set(words.map((word) => word.toLowerCase()));
|
|
68
|
+
const column = cellTexts(line.text).findIndex((cell) => labels.has(cell));
|
|
69
|
+
return column < 0 ? undefined : column;
|
|
70
|
+
};
|
|
71
|
+
const lineEnd = (line) => line.start + line.text.length;
|
|
72
|
+
const columnAt = (line, offset) => line.text.slice(0, offset - line.start).split(CELL_SEPARATOR).length - 1;
|
|
73
|
+
/** The deadline in a table row: the one date in the due column. */
|
|
74
|
+
const rowDeadline = (line, column, dates) => {
|
|
75
|
+
const inColumn = datesIn(dates, line.start, lineEnd(line)).filter((date) => columnAt(line, date.offset) === column);
|
|
76
|
+
return inColumn.length === 1 ? inColumn : [];
|
|
77
|
+
};
|
|
78
|
+
/** A due word right before a date, with at most one word between (due Monday, November 2; 期限:11月2日). */
|
|
79
|
+
const dueWordBefore = (words) => new RegExp(`(?:^|[\\s((、,;::])(?:${words.map(escaped).join("|")})[ \\t\\u3000::]*(?:\\p{L}+,?[ \\t]+)?$`, "iu");
|
|
80
|
+
/** The deadlines of a list item: the dates right after a due word. */
|
|
81
|
+
const listDeadlines = (line, dates, dueBefore) => LIST_ITEM.test(line.text) ? datesIn(dates, line.start, lineEnd(line)).filter((date) => dueBefore.test(line.text.slice(0, date.offset - line.start))) : [];
|
|
82
|
+
/** The deadlines of the tables with a due column and of the list items, outside items marked done. */
|
|
83
|
+
const deadlinesOf = (lines, dates, words) => {
|
|
84
|
+
const found = [];
|
|
85
|
+
const dueBefore = dueWordBefore(words.due);
|
|
86
|
+
lines.reduce((column, line, index) => {
|
|
87
|
+
const header = dueColumn(line, lines[index + 1], words.due);
|
|
88
|
+
if (header !== undefined)
|
|
89
|
+
return header;
|
|
90
|
+
const inTable = line.text.includes("|") ? column : undefined;
|
|
91
|
+
if (isMarkedDone(line.text, words.done))
|
|
92
|
+
return inTable;
|
|
93
|
+
found.push(...(inTable === undefined ? listDeadlines(line, dates, dueBefore) : rowDeadline(line, inTable, dates)));
|
|
94
|
+
return inTable;
|
|
95
|
+
}, undefined);
|
|
96
|
+
return found;
|
|
97
|
+
};
|
|
98
|
+
const REFERENCE_YEAR = 2001;
|
|
99
|
+
const dayNumber = (value, year) => {
|
|
100
|
+
const match = MONTH_DAY.exec(value);
|
|
101
|
+
return match === null ? undefined : Date.UTC(year, Number(match[1]) - 1, Number(match[2])) / MS_PER_DAY;
|
|
102
|
+
};
|
|
103
|
+
/** Whether a deadline is before the meeting. Without a year on one of them, a deadline early in the next year is not. */
|
|
104
|
+
export const isBeforeMeeting = (due, meeting) => {
|
|
105
|
+
if (FULL_DATE.test(due) && FULL_DATE.test(meeting))
|
|
106
|
+
return due < meeting;
|
|
107
|
+
const meetingDay = dayNumber(meeting, REFERENCE_YEAR);
|
|
108
|
+
const dueDay = dayNumber(due, REFERENCE_YEAR);
|
|
109
|
+
const dueNextYear = dayNumber(due, REFERENCE_YEAR + 1);
|
|
110
|
+
if (meetingDay === undefined || dueDay === undefined || dueNextYear === undefined)
|
|
111
|
+
return false;
|
|
112
|
+
return dueDay < meetingDay && dueNextYear - meetingDay > MAX_WRAP_DAYS;
|
|
113
|
+
};
|
|
114
|
+
export const actionDueBeforeMeeting = (source, dates, headings, words) => {
|
|
115
|
+
if (words.meeting.length === 0 || words.due.length === 0 || words.section.length === 0)
|
|
116
|
+
return [];
|
|
117
|
+
const lines = linesOf(source);
|
|
118
|
+
const meeting = meetingDate(lines, dates, words.meeting);
|
|
119
|
+
const ranges = actionRanges(headings, source.length, words);
|
|
120
|
+
if (meeting === undefined || ranges.take.length === 0 || !isMinutes(lines, headings, words.minutes))
|
|
121
|
+
return [];
|
|
122
|
+
return deadlinesOf(lines, dates, words)
|
|
123
|
+
.filter((due) => inside(due.offset, ranges.take) && !inside(due.offset, ranges.skip) && isBeforeMeeting(due.value, meeting.value))
|
|
124
|
+
.map((due) => ({ offset: due.offset, values: { due: due.value, meeting: meeting.value } }));
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=action-due.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-due.js","sourceRoot":"","sources":["../../src/structure/action-due.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,OAAO,EAAa,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAiB1C,4GAA4G;AAC5G,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,2HAA2H;AAC3H,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,SAAS,GAAG,sBAAsB,CAAC;AACzC,MAAM,SAAS,GAAG,+BAA+B,CAAC;AAClD,MAAM,SAAS,GAAG,oCAAoC,CAAC;AACvD,MAAM,UAAU,GAAG,eAAe,CAAC;AAEnC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,OAAO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,EAAE,CAAC,CAAC,CAAC;AAChG,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ScaleWord } from "./amount-scale.ts";
|
|
2
|
+
import type { StructureIssue } from "./issues.ts";
|
|
3
|
+
/** One amount written with its currency. scale is the value of the word of scale written in it (万, million), if any. */
|
|
4
|
+
export type RangeAmount = {
|
|
5
|
+
readonly offset: number;
|
|
6
|
+
readonly end: number;
|
|
7
|
+
readonly currency: string;
|
|
8
|
+
readonly value: number;
|
|
9
|
+
readonly scale: number | undefined;
|
|
10
|
+
readonly position: "before" | "after";
|
|
11
|
+
};
|
|
12
|
+
export type AmountRangeWords = {
|
|
13
|
+
/** The marks and words that make a range on their own (〜, –, to). */
|
|
14
|
+
readonly connectors: readonly string[];
|
|
15
|
+
/** Words that make a range only when a closer follows the second amount (から … まで). */
|
|
16
|
+
readonly openers: readonly string[];
|
|
17
|
+
readonly closers: readonly string[];
|
|
18
|
+
/** Words that, in the same sentence, make a descending pair a change of price and not a range (値下げ, reduced). */
|
|
19
|
+
readonly changes: readonly string[];
|
|
20
|
+
/** Labels of the lower and upper bound (下限, min; 上限, max) and the particles that may follow a label (は, of). */
|
|
21
|
+
readonly lowers: readonly string[];
|
|
22
|
+
readonly uppers: readonly string[];
|
|
23
|
+
readonly links: readonly string[];
|
|
24
|
+
/** The words of scale (万, million, k) and the digits of a number (the currency reader's pattern). */
|
|
25
|
+
readonly scales: readonly ScaleWord[];
|
|
26
|
+
readonly number: string;
|
|
27
|
+
};
|
|
28
|
+
/** The ranges of amounts, written or labelled, whose upper end is below the lower one, once per place, in document order. */
|
|
29
|
+
export declare const reversedAmountRanges: (text: string, amounts: readonly RangeAmount[], words: AmountRangeWords) => StructureIssue[];
|
|
30
|
+
//# sourceMappingURL=amount-range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amount-range.d.ts","sourceRoot":"","sources":["../../src/structure/amount-range.ts"],"names":[],"mappings":"AAIA,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// amount-range-reversed: a range of amounts whose upper end is below its lower end (月給30万円〜25万円, $90,000–$70,000,
|
|
2
|
+
// 下限30万円・上限25万円). The amounts come read (currency, value, the word of scale they carry); the words that join a range,
|
|
3
|
+
// change a price, and label a bound come from the lexicons. Pure.
|
|
4
|
+
import { escapeRegExp } from "../orthography.js";
|
|
5
|
+
import { amountValue } from "./amount-scale.js";
|
|
6
|
+
/** An end that took its word of scale from the other end (30〜25万円) is believed reversed only this close to the other. */
|
|
7
|
+
const MAX_INHERITED_RATIO = 10;
|
|
8
|
+
const SEPARATORS = /[\s・、,,;;//||::==()()「」..]/gu;
|
|
9
|
+
const LATIN = /^[A-Za-z]/u;
|
|
10
|
+
/** A Latin word is matched at word edges (cut does not match cutting); other scripts as written. */
|
|
11
|
+
const wordPattern = (word) => {
|
|
12
|
+
const escaped = escapeRegExp(word.toLowerCase());
|
|
13
|
+
return LATIN.test(word) ? `(?<![a-z])${escaped}(?![a-z])` : escaped;
|
|
14
|
+
};
|
|
15
|
+
const hasWord = (text, words) => words.some((word) => new RegExp(wordPattern(word), "u").test(text.toLowerCase()));
|
|
16
|
+
const isOneOf = (text, words) => words.some((word) => word.toLowerCase() === text.toLowerCase());
|
|
17
|
+
const lineBounds = (text, offset) => {
|
|
18
|
+
const end = text.indexOf("\n", offset);
|
|
19
|
+
return { start: text.lastIndexOf("\n", offset - 1) + 1, end: end === -1 ? text.length : end };
|
|
20
|
+
};
|
|
21
|
+
/** A sentence ends at 。, or at a full stop followed by a capital or the line end (e.g. does not end one). */
|
|
22
|
+
const SENTENCE_END = /[。!?]|[.!?](?=\s+[A-Z]|\s*$)/gu;
|
|
23
|
+
/** The sentence holding the range, within its line. */
|
|
24
|
+
const sentenceAround = (text, start, end) => {
|
|
25
|
+
const line = lineBounds(text, start);
|
|
26
|
+
const ends = [...text.slice(line.start, line.end).matchAll(SENTENCE_END)].map((match) => line.start + match.index);
|
|
27
|
+
const from = ends.filter((at) => at < start).at(-1) ?? line.start;
|
|
28
|
+
const to = ends.find((at) => at >= end) ?? line.end;
|
|
29
|
+
return text.slice(from, to);
|
|
30
|
+
};
|
|
31
|
+
/** What follows the second amount, on its line, without leading spaces. */
|
|
32
|
+
const restOfLine = (text, end) => text.slice(end, lineBounds(text, end).end).trimStart();
|
|
33
|
+
const ARITHMETIC = /[==]/u;
|
|
34
|
+
/** Whether the joint between two ends makes them a range: a connector, or an opener with a closer after the second end. */
|
|
35
|
+
const joinsRange = (joint, after, words) => {
|
|
36
|
+
if (joint.includes("\n"))
|
|
37
|
+
return false;
|
|
38
|
+
const bare = joint.trim();
|
|
39
|
+
return isOneOf(bare, words.connectors) || (isOneOf(bare, words.openers) && words.closers.some((closer) => after.startsWith(closer)));
|
|
40
|
+
};
|
|
41
|
+
const pairOf = (low, high) => [low, high];
|
|
42
|
+
const scaleOf = (word, words) => word === undefined ? undefined : words.scales.find((scale) => scale.word.toLowerCase() === word.toLowerCase())?.value;
|
|
43
|
+
const alternation = (patterns) => patterns.toSorted((left, right) => right.length - left.length).join("|");
|
|
44
|
+
const scalePart = (words) => {
|
|
45
|
+
const scales = alternation(words.scales.map((scale) => escapeRegExp(scale.word)));
|
|
46
|
+
return scales === "" ? "" : `(?:\\s?(${scales}))?`;
|
|
47
|
+
};
|
|
48
|
+
const jointPart = (words) => `(\\s?(?:${alternation([...words.connectors, ...words.openers].map(wordPattern))})\\s?)`;
|
|
49
|
+
/** A bare number (no currency) and its word of scale, if any. */
|
|
50
|
+
const bareReading = (span, digits, scaleWord, words) => {
|
|
51
|
+
const value = amountValue(digits, []);
|
|
52
|
+
if (value === undefined)
|
|
53
|
+
return undefined;
|
|
54
|
+
const scale = scaleOf(scaleWord, words);
|
|
55
|
+
return { ...span, value: scale === undefined ? value : value * scale, scale };
|
|
56
|
+
};
|
|
57
|
+
/** One end of a range written with the word of scale only once: the end without one reads it from the other (30〜25万円, $90–70k). */
|
|
58
|
+
const sharing = (own, other) => own.scale === undefined && other.scale !== undefined
|
|
59
|
+
? { offset: own.offset, end: own.end, value: own.value * other.scale, inherited: true }
|
|
60
|
+
: { offset: own.offset, end: own.end, value: own.value, inherited: false };
|
|
61
|
+
const sharedPair = (first, second) => pairOf(sharing(first, second), sharing(second, first));
|
|
62
|
+
/** The bare number right before a currency-after amount, joined to it (30〜 before 25万円), sharing its currency. */
|
|
63
|
+
const sharedBefore = (text, amount, floor, words) => {
|
|
64
|
+
const pattern = new RegExp(`(?<![0-90-9.,,A-Za-z])(${words.number})${scalePart(words)}${jointPart(words)}$`, "iu");
|
|
65
|
+
const match = pattern.exec(text.slice(floor, amount.offset));
|
|
66
|
+
if (match === null || !joinsRange(match[3] ?? "", restOfLine(text, amount.end), words))
|
|
67
|
+
return undefined;
|
|
68
|
+
const offset = floor + match.index;
|
|
69
|
+
const bare = bareReading({ offset, end: offset + match[0].length - (match[3] ?? "").length }, match[1] ?? "", match[2], words);
|
|
70
|
+
return bare === undefined ? undefined : sharedPair(bare, amount);
|
|
71
|
+
};
|
|
72
|
+
/** The bare number right after a currency-before amount, joined to it ($90–70k), sharing its currency. */
|
|
73
|
+
const sharedAfter = (text, amount, ceiling, words) => {
|
|
74
|
+
const pattern = new RegExp(`^${jointPart(words)}(${words.number})${scalePart(words)}(?![0-90-9A-Za-z])`, "iu");
|
|
75
|
+
const match = pattern.exec(text.slice(amount.end, ceiling));
|
|
76
|
+
if (match === null || !joinsRange(match[1] ?? "", restOfLine(text, amount.end + match[0].length), words))
|
|
77
|
+
return undefined;
|
|
78
|
+
const bare = bareReading({ offset: amount.end + (match[1] ?? "").length, end: amount.end + match[0].length }, match[2] ?? "", match[3], words);
|
|
79
|
+
return bare === undefined ? undefined : sharedPair(amount, bare);
|
|
80
|
+
};
|
|
81
|
+
const asEnd = (amount) => ({ offset: amount.offset, end: amount.end, value: amount.value, inherited: false });
|
|
82
|
+
/** Both ends written with their currency, joined by a connector. */
|
|
83
|
+
const writtenPair = (text, first, second, words) => {
|
|
84
|
+
if (first.currency !== second.currency)
|
|
85
|
+
return undefined;
|
|
86
|
+
if (!joinsRange(text.slice(first.end, second.offset), restOfLine(text, second.end), words))
|
|
87
|
+
return undefined;
|
|
88
|
+
return pairOf(asEnd(first), asEnd(second));
|
|
89
|
+
};
|
|
90
|
+
const isReversed = ([low, high]) => {
|
|
91
|
+
if (low.value <= high.value)
|
|
92
|
+
return false;
|
|
93
|
+
return !(low.inherited || high.inherited) || low.value / high.value <= MAX_INHERITED_RATIO;
|
|
94
|
+
};
|
|
95
|
+
/** A pair is a range in a sentence that changes no price and holds no equation (5,000円-2,000円=3,000円). */
|
|
96
|
+
const readsAsRange = (text, [low, high], words) => {
|
|
97
|
+
const start = Math.min(low.offset, high.offset);
|
|
98
|
+
const end = Math.max(low.end, high.end);
|
|
99
|
+
const sentence = sentenceAround(text, start, end);
|
|
100
|
+
return !ARITHMETIC.test(sentence) && !hasWord(sentence, words.changes);
|
|
101
|
+
};
|
|
102
|
+
/** The pairs of ends read as ranges: two written amounts, or one written amount and a bare number sharing its currency. */
|
|
103
|
+
const pairsOf = (text, amounts, words) => amounts.flatMap((amount, index) => {
|
|
104
|
+
const previous = amounts[index - 1];
|
|
105
|
+
const next = amounts[index + 1];
|
|
106
|
+
const floor = Math.max(previous?.end ?? 0, lineBounds(text, amount.offset).start);
|
|
107
|
+
return [
|
|
108
|
+
previous === undefined ? undefined : writtenPair(text, previous, amount, words),
|
|
109
|
+
amount.position === "after" ? sharedBefore(text, amount, floor, words) : undefined,
|
|
110
|
+
amount.position === "before" ? sharedAfter(text, amount, next?.offset ?? text.length, words) : undefined,
|
|
111
|
+
].filter((pair) => pair !== undefined);
|
|
112
|
+
});
|
|
113
|
+
/** Whether the text is only separators, particles, and at most the given label. */
|
|
114
|
+
const onlyLabel = (text, labels, words) => {
|
|
115
|
+
const rest = words.links.reduce((left, link) => left.replace(new RegExp(wordPattern(link), "giu"), " "), text.toLowerCase()).replace(SEPARATORS, "");
|
|
116
|
+
return rest === "" || isOneOf(rest, labels);
|
|
117
|
+
};
|
|
118
|
+
/** The label written right before the amount, past separators and particles: lower, upper, or none. */
|
|
119
|
+
const labelBefore = (text, amount, floor, words) => {
|
|
120
|
+
const before = text.slice(floor, amount.offset).toLowerCase();
|
|
121
|
+
const ends = (labels) => labels.some((label) => {
|
|
122
|
+
const match = new RegExp(`^[^]*${wordPattern(label)}([^]*)$`, "u").exec(before);
|
|
123
|
+
return match !== null && onlyLabel(match[1] ?? "", [], words);
|
|
124
|
+
});
|
|
125
|
+
if (ends(words.lowers))
|
|
126
|
+
return "lower";
|
|
127
|
+
return ends(words.uppers) ? "upper" : undefined;
|
|
128
|
+
};
|
|
129
|
+
/** Two adjacent amounts on one line labelled lower and upper bound (下限30万円・上限25万円), in either order. */
|
|
130
|
+
const labelledPairs = (text, amounts, words) => amounts.slice(1).flatMap((second, index) => {
|
|
131
|
+
const first = amounts[index];
|
|
132
|
+
if (first === undefined || first.currency !== second.currency || text.slice(first.end, second.offset).includes("\n"))
|
|
133
|
+
return [];
|
|
134
|
+
const floor = Math.max(amounts[index - 1]?.end ?? 0, lineBounds(text, first.offset).start);
|
|
135
|
+
const firstLabel = labelBefore(text, first, floor, words);
|
|
136
|
+
const secondLabel = labelBefore(text, second, first.end, words);
|
|
137
|
+
if (firstLabel === undefined || secondLabel === undefined || firstLabel === secondLabel)
|
|
138
|
+
return [];
|
|
139
|
+
if (!onlyLabel(text.slice(first.end, second.offset), [...words.lowers, ...words.uppers], words))
|
|
140
|
+
return [];
|
|
141
|
+
return [firstLabel === "lower" ? pairOf(asEnd(first), asEnd(second)) : pairOf(asEnd(second), asEnd(first))];
|
|
142
|
+
});
|
|
143
|
+
const issueOf = (text, [low, high]) => {
|
|
144
|
+
const start = Math.min(low.offset, high.offset);
|
|
145
|
+
return { offset: start, values: { range: text.slice(start, Math.max(low.end, high.end)).trim() } };
|
|
146
|
+
};
|
|
147
|
+
/** The ranges of amounts, written or labelled, whose upper end is below the lower one, once per place, in document order. */
|
|
148
|
+
export const reversedAmountRanges = (text, amounts, words) => [...pairsOf(text, amounts, words), ...labelledPairs(text, amounts, words)]
|
|
149
|
+
.filter((pair) => isReversed(pair) && readsAsRange(text, pair, words))
|
|
150
|
+
.map((pair) => issueOf(text, pair))
|
|
151
|
+
.toSorted((left, right) => left.offset - right.offset)
|
|
152
|
+
.filter((issue, index, issues) => issues[index - 1]?.offset !== issue.offset);
|
|
153
|
+
//# sourceMappingURL=amount-range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amount-range.js","sourceRoot":"","sources":["../../src/structure/amount-range.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,sHAAsH;AACtH,kEAAkE;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AA8BhE,yHAAyH;AACzH,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B,MAAM,UAAU,GAAG,8BAA8B,CAAC;AAElD,MAAM,KAAK,GAAG,YAAY,CAAC;AAE3B,oGAAoG;AACpG,MAAM,WAAW,GAAG,CAAC,IAAY,EAAU,EAAE;IAC3C,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,KAAwB,EAAW,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAEvJ,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,KAAwB,EAAW,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAA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E,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;KACrE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KAClC,QAAQ,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;KACrD,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -16,6 +16,12 @@ export type ScaleMix = {
|
|
|
16
16
|
};
|
|
17
17
|
/** For each currency, the amounts written the other way from the rest of their order of magnitude, in document order. */
|
|
18
18
|
export declare const scaleMixes: (amounts: readonly ScaledAmount[]) => ScaleMix[];
|
|
19
|
+
/**
|
|
20
|
+
* Leaves out a round figure in the text (約130万円, a cap of $1.5 million) whose only evidence is the exact amounts of a
|
|
21
|
+
* table, none of them the same amount: the text gives the round size and the table the detail, which is not one amount
|
|
22
|
+
* written two ways. The same amount in the table (220万円 and 2,200,000円) stays a mix, and so does a mix within the text.
|
|
23
|
+
*/
|
|
24
|
+
export declare const withoutRoundTextFigures: (mixes: readonly ScaleMix[], amounts: readonly ScaledAmount[], inTable: (amount: ScaledAmount) => boolean) => ScaleMix[];
|
|
19
25
|
/** A word of scale and the value it multiplies by (万 10000, million 1000000). */
|
|
20
26
|
export type ScaleWord = {
|
|
21
27
|
readonly word: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amount-scale.d.ts","sourceRoot":"","sources":["../../src/structure/amount-scale.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACx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C;AAEL,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAI1E;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,OAAO,SAAS,SAAS,EAAE,KAAG,MAAM,GAAG,SAYnF,CAAC"}
|
|
@@ -47,6 +47,19 @@ export const scaleMixes = (amounts) => {
|
|
|
47
47
|
.flatMap((currency) => mixesOfCurrency(ordered.filter((amount) => amount.currency === currency)))
|
|
48
48
|
.toSorted((left, right) => left.odd.offset - right.odd.offset);
|
|
49
49
|
};
|
|
50
|
+
/** The largest number of significant digits a round figure has (130万円, $1.5 million): a rounded total or a cap. */
|
|
51
|
+
const ROUND_DIGITS = 2;
|
|
52
|
+
/**
|
|
53
|
+
* Leaves out a round figure in the text (約130万円, a cap of $1.5 million) whose only evidence is the exact amounts of a
|
|
54
|
+
* table, none of them the same amount: the text gives the round size and the table the detail, which is not one amount
|
|
55
|
+
* written two ways. The same amount in the table (220万円 and 2,200,000円) stays a mix, and so does a mix within the text.
|
|
56
|
+
*/
|
|
57
|
+
export const withoutRoundTextFigures = (mixes, amounts, inTable) => mixes.filter(({ odd }) => {
|
|
58
|
+
if (inTable(odd) || significantDigits(odd.value) > ROUND_DIGITS)
|
|
59
|
+
return true;
|
|
60
|
+
const others = amounts.filter((amount) => comparable(amount) && amount.currency === odd.currency && magnitudeOf(amount.value) === magnitudeOf(odd.value) && isScaled(amount) !== isScaled(odd));
|
|
61
|
+
return others.some((amount) => !inTable(amount) || amount.value === odd.value);
|
|
62
|
+
});
|
|
50
63
|
const NUMBER_THEN_WORD = /(\d+(?:,\d{3})*(?:\.\d+)?)\s?([^\s\d.,]*)/gu;
|
|
51
64
|
/**
|
|
52
65
|
* The value of an amount as written, without its currency: 1億2,000万 is 120000000, 1.5 million is 1500000. Undefined when a
|
|
@@ -1 +1 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AAE,EAAE;QAChC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;QAC3D,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC3C,IAAI,IAAI,KAAK,EAAE;YAAE,OAAO,MAAM,CAAC;QAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,CAAC;QACvE,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC;IACjE,CAAC,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC,CAAC"}
|
package/dist/structure/cite.d.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import type { StructureNode } from "../plugin.ts";
|
|
2
|
+
/** address: where in the source the quote is, as `chaff tree` names it. Empty: anywhere in the source. */
|
|
2
3
|
export type Citation = {
|
|
3
4
|
readonly address: string;
|
|
4
5
|
readonly quote: string;
|
|
5
6
|
};
|
|
7
|
+
/** The address a citation leaves empty: it says the quote is somewhere in the source, not where. */
|
|
8
|
+
export declare const isAnywhere: (citation: Citation) => boolean;
|
|
6
9
|
export type CitationStatus = "ok" | "missing-address" | "quote-elsewhere" | "quote-not-found";
|
|
7
10
|
export type CitationResult = {
|
|
8
11
|
readonly citation: Citation;
|
|
9
12
|
readonly status: CitationStatus;
|
|
10
|
-
/** 引用文が原文で見つかった位置の、いちばん内側の番地。quote-elsewhere
|
|
13
|
+
/** 引用文が原文で見つかった位置の、いちばん内側の番地。quote-elsewhere のとき、本当はどこに書いてあるか。番地を書かない引用では、見つかった場所。 */
|
|
11
14
|
readonly foundAt?: string;
|
|
12
15
|
/** 引用文が見つかった行。引用文が空なら、番地の行。 */
|
|
13
16
|
readonly line?: number;
|
|
14
17
|
};
|
|
15
18
|
/**
|
|
16
19
|
* 引用を一件ずつ確かめる。source は木を作った原文そのもの。
|
|
17
|
-
*
|
|
20
|
+
* 引用文が空(空白だけ)なら番地だけを確かめる。番地が空なら、原文のどこかにあるかだけを確かめる。同じ番地が二つある(附則が第1条から振り直す)ときは、どちらかにあれば一致。
|
|
18
21
|
* 原文は一度だけ揃え、引用ごとには番地の範囲を揃え直さない。長い契約書に引用が何百とあっても、引用ごとの代金は原文の長さに比例するだけ。
|
|
19
22
|
*/
|
|
20
23
|
export declare const checkCitations: (source: string, tree: StructureNode, citations: readonly Citation[]) => CitationResult[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cite.d.ts","sourceRoot":"","sources":["../../src/structure/cite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAE9F,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,
|
|
1
|
+
{"version":3,"file":"cite.d.ts","sourceRoot":"","sources":["../../src/structure/cite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD,0GAA0G;AAC1G,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,oGAAoG;AACpG,eAAO,MAAM,UAAU,GAAI,UAAU,QAAQ,KAAG,OAAyC,CAAC;AAE1F,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAE9F,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,sFAAsF;IACtF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAmFF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,EAAE,MAAM,aAAa,EAAE,WAAW,SAAS,QAAQ,EAAE,KAAG,cAAc,EA0BlH,CAAC"}
|
package/dist/structure/cite.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { lineStarts, placeOf } from "../position.js";
|
|
2
|
+
/** The address a citation leaves empty: it says the quote is somewhere in the source, not where. */
|
|
3
|
+
export const isAnywhere = (citation) => citation.address.trim() === "";
|
|
2
4
|
const WHITESPACE = /^\s+$/u;
|
|
3
5
|
const GRAPHEMES = new Intl.Segmenter("und", { granularity: "grapheme" });
|
|
4
6
|
/**
|
|
@@ -55,9 +57,24 @@ const addressedNodes = (tree) => {
|
|
|
55
57
|
const innermostHolding = (nodes, occurrence) => nodes
|
|
56
58
|
.filter(({ node }) => within(node, occurrence))
|
|
57
59
|
.reduce((best, current) => (best === undefined || current.depth > best.depth ? current : best), undefined)?.node.address;
|
|
60
|
+
/**
|
|
61
|
+
* 番地を書かない引用。原文のどこかに書いてあれば一致で、見つかった場所の番地と行を添える。番地の無い原文(見出しの無い記事)にも使える。
|
|
62
|
+
* 引用文も空なら、何も示していないので番地が無いとする。一致にすると、書き忘れた引用が通る。
|
|
63
|
+
*/
|
|
64
|
+
const anywhere = (citation, whole, nodes, starts) => {
|
|
65
|
+
const key = normalize(citation.quote).text;
|
|
66
|
+
if (key === "")
|
|
67
|
+
return { citation, status: "missing-address" };
|
|
68
|
+
const at = whole.text.indexOf(key);
|
|
69
|
+
if (at === -1)
|
|
70
|
+
return { citation, status: "quote-not-found" };
|
|
71
|
+
const occurrence = { start: whole.index[at] ?? 0, last: whole.index[at + key.length - 1] ?? 0 };
|
|
72
|
+
const foundAt = innermostHolding(nodes, occurrence);
|
|
73
|
+
return { citation, status: "ok", line: placeOf(starts, occurrence.start).line, ...(foundAt === undefined ? {} : { foundAt }) };
|
|
74
|
+
};
|
|
58
75
|
/**
|
|
59
76
|
* 引用を一件ずつ確かめる。source は木を作った原文そのもの。
|
|
60
|
-
*
|
|
77
|
+
* 引用文が空(空白だけ)なら番地だけを確かめる。番地が空なら、原文のどこかにあるかだけを確かめる。同じ番地が二つある(附則が第1条から振り直す)ときは、どちらかにあれば一致。
|
|
61
78
|
* 原文は一度だけ揃え、引用ごとには番地の範囲を揃え直さない。長い契約書に引用が何百とあっても、引用ごとの代金は原文の長さに比例するだけ。
|
|
62
79
|
*/
|
|
63
80
|
export const checkCitations = (source, tree, citations) => {
|
|
@@ -71,6 +88,8 @@ export const checkCitations = (source, tree, citations) => {
|
|
|
71
88
|
const whole = normalize(source);
|
|
72
89
|
const starts = lineStarts(source);
|
|
73
90
|
return citations.map((citation) => {
|
|
91
|
+
if (isAnywhere(citation))
|
|
92
|
+
return anywhere(citation, whole, nodes, starts);
|
|
74
93
|
// 第 1 項に番号の無い書き方では、「12.1」は第12条そのもの。参照の fallback と同じに読む。
|
|
75
94
|
const firstParagraph = citation.address.endsWith(".1") ? byAddress.get(citation.address.slice(0, -2)) : undefined;
|
|
76
95
|
const candidates = byAddress.get(citation.address) ?? firstParagraph ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cite.js","sourceRoot":"","sources":["../../src/structure/cite.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"cite.js","sourceRoot":"","sources":["../../src/structure/cite.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAQrD,oGAAoG;AACpG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAkB,EAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AAgB1F,MAAM,UAAU,GAAG,QAAQ,CAAC;AAC5B,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC;AAEzE;;;GAGG;AACH,MAAM,SAAS,GAAG,CAAC,MAAc,EAAc,EAAE;IAC/C,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE;QAChE,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO;QACrC,oEAAoE;QACpE,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtB,KAAK,CAA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