chaffjs 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +330 -0
- package/README.md +119 -257
- package/dist/announced-count.d.ts +2 -0
- package/dist/announced-count.d.ts.map +1 -1
- package/dist/announced-count.js +4 -3
- package/dist/announced-count.js.map +1 -1
- package/dist/company-kana-spelling.d.ts +31 -0
- package/dist/company-kana-spelling.d.ts.map +1 -0
- package/dist/company-kana-spelling.js +79 -0
- package/dist/company-kana-spelling.js.map +1 -0
- package/dist/company-names.d.ts +32 -1
- package/dist/company-names.d.ts.map +1 -1
- package/dist/company-names.js +129 -22
- package/dist/company-names.js.map +1 -1
- package/dist/contacts/addresses.d.ts +21 -0
- package/dist/contacts/addresses.d.ts.map +1 -0
- package/dist/contacts/addresses.js +144 -0
- package/dist/contacts/addresses.js.map +1 -0
- package/dist/contacts/emails.d.ts +11 -0
- package/dist/contacts/emails.d.ts.map +1 -0
- package/dist/contacts/emails.js +51 -0
- package/dist/contacts/emails.js.map +1 -0
- package/dist/contacts/table-rows.d.ts +7 -0
- package/dist/contacts/table-rows.d.ts.map +1 -0
- package/dist/contacts/table-rows.js +42 -0
- package/dist/contacts/table-rows.js.map +1 -0
- package/dist/contacts/variants.d.ts +14 -0
- package/dist/contacts/variants.d.ts.map +1 -0
- package/dist/contacts/variants.js +25 -0
- package/dist/contacts/variants.js.map +1 -0
- package/dist/derived/age-on-date.d.ts +53 -0
- package/dist/derived/age-on-date.d.ts.map +1 -0
- package/dist/derived/age-on-date.js +114 -0
- package/dist/derived/age-on-date.js.map +1 -0
- package/dist/derived/battery-runtime.d.ts +85 -0
- package/dist/derived/battery-runtime.d.ts.map +1 -0
- package/dist/derived/battery-runtime.js +217 -0
- package/dist/derived/battery-runtime.js.map +1 -0
- package/dist/derived/durations.d.ts +17 -2
- package/dist/derived/durations.d.ts.map +1 -1
- package/dist/derived/durations.js +61 -10
- package/dist/derived/durations.js.map +1 -1
- package/dist/derived/hours-and-minutes.d.ts +26 -0
- package/dist/derived/hours-and-minutes.d.ts.map +1 -0
- package/dist/derived/hours-and-minutes.js +24 -0
- package/dist/derived/hours-and-minutes.js.map +1 -0
- package/dist/derived/hyphenated-counts.d.ts +15 -0
- package/dist/derived/hyphenated-counts.d.ts.map +1 -0
- package/dist/derived/hyphenated-counts.js +31 -0
- package/dist/derived/hyphenated-counts.js.map +1 -0
- package/dist/derived/marked-dates.d.ts +15 -0
- package/dist/derived/marked-dates.d.ts.map +1 -0
- package/dist/derived/marked-dates.js +41 -0
- package/dist/derived/marked-dates.js.map +1 -0
- package/dist/derived/money-span.d.ts +9 -0
- package/dist/derived/money-span.d.ts.map +1 -0
- package/dist/derived/money-span.js +6 -0
- package/dist/derived/money-span.js.map +1 -0
- package/dist/derived/period-counts.d.ts +48 -0
- package/dist/derived/period-counts.d.ts.map +1 -0
- package/dist/derived/period-counts.js +128 -0
- package/dist/derived/period-counts.js.map +1 -0
- package/dist/derived/period-parts.d.ts +55 -0
- package/dist/derived/period-parts.d.ts.map +1 -0
- package/dist/derived/period-parts.js +283 -0
- package/dist/derived/period-parts.js.map +1 -0
- package/dist/derived/readable-date.d.ts +20 -0
- package/dist/derived/readable-date.d.ts.map +1 -0
- package/dist/derived/readable-date.js +50 -0
- package/dist/derived/readable-date.js.map +1 -0
- package/dist/derived/stays.d.ts +3 -1
- package/dist/derived/stays.d.ts.map +1 -1
- package/dist/derived/stays.js +3 -0
- package/dist/derived/stays.js.map +1 -1
- package/dist/derived/time-lengths.d.ts.map +1 -1
- package/dist/derived/time-lengths.js +12 -9
- package/dist/derived/time-lengths.js.map +1 -1
- package/dist/derived/timesheet-hours.d.ts +27 -0
- package/dist/derived/timesheet-hours.d.ts.map +1 -0
- package/dist/derived/timesheet-hours.js +86 -0
- package/dist/derived/timesheet-hours.js.map +1 -0
- package/dist/derived/use-interval.d.ts +33 -0
- package/dist/derived/use-interval.d.ts.map +1 -0
- package/dist/derived/use-interval.js +93 -0
- package/dist/derived/use-interval.js.map +1 -0
- package/dist/derived/use-maximum.d.ts +27 -0
- package/dist/derived/use-maximum.d.ts.map +1 -0
- package/dist/derived/use-maximum.js +104 -0
- package/dist/derived/use-maximum.js.map +1 -0
- package/dist/derived/working-hours.d.ts +4 -5
- package/dist/derived/working-hours.d.ts.map +1 -1
- package/dist/detectors/announced-count.d.ts.map +1 -1
- package/dist/detectors/announced-count.js +1 -0
- package/dist/detectors/announced-count.js.map +1 -1
- package/dist/detectors/annual-holidays-mismatch.d.ts +3 -0
- package/dist/detectors/annual-holidays-mismatch.d.ts.map +1 -0
- package/dist/detectors/annual-holidays-mismatch.js +29 -0
- package/dist/detectors/annual-holidays-mismatch.js.map +1 -0
- package/dist/detectors/annual-pay-mismatch.d.ts +3 -0
- package/dist/detectors/annual-pay-mismatch.d.ts.map +1 -0
- package/dist/detectors/annual-pay-mismatch.js +52 -0
- package/dist/detectors/annual-pay-mismatch.js.map +1 -0
- package/dist/detectors/blank-structure.d.ts +3 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +45 -12
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/bmi-mismatch.d.ts +3 -0
- package/dist/detectors/bmi-mismatch.d.ts.map +1 -0
- package/dist/detectors/bmi-mismatch.js +70 -0
- package/dist/detectors/bmi-mismatch.js.map +1 -0
- package/dist/detectors/capacity-runtime.d.ts +7 -0
- package/dist/detectors/capacity-runtime.d.ts.map +1 -0
- package/dist/detectors/capacity-runtime.js +98 -0
- package/dist/detectors/capacity-runtime.js.map +1 -0
- package/dist/detectors/change-rate.d.ts.map +1 -1
- package/dist/detectors/change-rate.js +24 -9
- package/dist/detectors/change-rate.js.map +1 -1
- package/dist/detectors/closing-balance-mismatch.d.ts +3 -0
- package/dist/detectors/closing-balance-mismatch.d.ts.map +1 -0
- package/dist/detectors/closing-balance-mismatch.js +42 -0
- package/dist/detectors/closing-balance-mismatch.js.map +1 -0
- package/dist/detectors/contact-variant.d.ts +3 -0
- package/dist/detectors/contact-variant.d.ts.map +1 -0
- package/dist/detectors/contact-variant.js +25 -0
- package/dist/detectors/contact-variant.js.map +1 -0
- package/dist/detectors/count-over-capacity.d.ts +4 -0
- package/dist/detectors/count-over-capacity.d.ts.map +1 -0
- package/dist/detectors/count-over-capacity.js +26 -0
- package/dist/detectors/count-over-capacity.js.map +1 -0
- package/dist/detectors/cumulative-below-current.d.ts +3 -0
- package/dist/detectors/cumulative-below-current.d.ts.map +1 -0
- package/dist/detectors/cumulative-below-current.js +25 -0
- package/dist/detectors/cumulative-below-current.js.map +1 -0
- package/dist/detectors/currency-column.d.ts +3 -0
- package/dist/detectors/currency-column.d.ts.map +1 -0
- package/dist/detectors/currency-column.js +32 -0
- package/dist/detectors/currency-column.js.map +1 -0
- package/dist/detectors/date-any-year.d.ts +24 -0
- package/dist/detectors/date-any-year.d.ts.map +1 -0
- package/dist/detectors/date-any-year.js +103 -0
- package/dist/detectors/date-any-year.js.map +1 -0
- package/dist/detectors/date-outside-period.d.ts.map +1 -1
- package/dist/detectors/date-outside-period.js +5 -10
- package/dist/detectors/date-outside-period.js.map +1 -1
- package/dist/detectors/date-stamp-order.d.ts +3 -0
- package/dist/detectors/date-stamp-order.d.ts.map +1 -0
- package/dist/detectors/date-stamp-order.js +25 -0
- package/dist/detectors/date-stamp-order.js.map +1 -0
- package/dist/detectors/date-year.d.ts +18 -6
- package/dist/detectors/date-year.d.ts.map +1 -1
- package/dist/detectors/date-year.js +39 -11
- package/dist/detectors/date-year.js.map +1 -1
- package/dist/detectors/deductible-exceeds-limit.d.ts +4 -0
- package/dist/detectors/deductible-exceeds-limit.d.ts.map +1 -0
- package/dist/detectors/deductible-exceeds-limit.js +46 -0
- package/dist/detectors/deductible-exceeds-limit.js.map +1 -0
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +45 -9
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/definition-use.d.ts +1 -1
- package/dist/detectors/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +4 -2
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/derived-numbers.d.ts +12 -3
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +45 -72
- package/dist/detectors/derived-numbers.js.map +1 -1
- package/dist/detectors/discount-rate.d.ts +3 -0
- package/dist/detectors/discount-rate.d.ts.map +1 -0
- package/dist/detectors/discount-rate.js +35 -0
- package/dist/detectors/discount-rate.js.map +1 -0
- package/dist/detectors/due-date.d.ts.map +1 -1
- package/dist/detectors/due-date.js +16 -3
- package/dist/detectors/due-date.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +10 -2
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +24 -5
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +7 -4
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/event-deadline.d.ts +3 -0
- package/dist/detectors/event-deadline.d.ts.map +1 -0
- package/dist/detectors/event-deadline.js +33 -0
- package/dist/detectors/event-deadline.js.map +1 -0
- package/dist/detectors/fact-consistency.d.ts +1 -1
- package/dist/detectors/fact-consistency.d.ts.map +1 -1
- package/dist/detectors/fact-consistency.js +161 -5
- package/dist/detectors/fact-consistency.js.map +1 -1
- package/dist/detectors/gloss-year.d.ts +11 -0
- package/dist/detectors/gloss-year.d.ts.map +1 -0
- package/dist/detectors/gloss-year.js +14 -0
- package/dist/detectors/gloss-year.js.map +1 -0
- package/dist/detectors/gpa-mismatch.d.ts +3 -0
- package/dist/detectors/gpa-mismatch.d.ts.map +1 -0
- package/dist/detectors/gpa-mismatch.js +39 -0
- package/dist/detectors/gpa-mismatch.js.map +1 -0
- package/dist/detectors/heading-case.d.ts +5 -2
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +12 -4
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/heading-echo.d.ts +5 -0
- package/dist/detectors/heading-echo.d.ts.map +1 -1
- package/dist/detectors/heading-echo.js +14 -1
- package/dist/detectors/heading-echo.js.map +1 -1
- package/dist/detectors/impossible-date.d.ts.map +1 -1
- package/dist/detectors/impossible-date.js +22 -6
- package/dist/detectors/impossible-date.js.map +1 -1
- package/dist/detectors/installment-total-mismatch.d.ts +3 -0
- package/dist/detectors/installment-total-mismatch.d.ts.map +1 -0
- package/dist/detectors/installment-total-mismatch.js +49 -0
- package/dist/detectors/installment-total-mismatch.js.map +1 -0
- package/dist/detectors/interest.d.ts +3 -0
- package/dist/detectors/interest.d.ts.map +1 -0
- package/dist/detectors/interest.js +38 -0
- package/dist/detectors/interest.js.map +1 -0
- package/dist/detectors/lab-columns.d.ts +4 -0
- package/dist/detectors/lab-columns.d.ts.map +1 -0
- package/dist/detectors/lab-columns.js +3 -0
- package/dist/detectors/lab-columns.js.map +1 -0
- package/dist/detectors/labelled-age.d.ts +4 -0
- package/dist/detectors/labelled-age.d.ts.map +1 -0
- package/dist/detectors/labelled-age.js +110 -0
- package/dist/detectors/labelled-age.js.map +1 -0
- package/dist/detectors/layout-code.d.ts +5 -0
- package/dist/detectors/layout-code.d.ts.map +1 -0
- package/dist/detectors/layout-code.js +124 -0
- package/dist/detectors/layout-code.js.map +1 -0
- package/dist/detectors/line-amount.d.ts.map +1 -1
- package/dist/detectors/line-amount.js +45 -2
- package/dist/detectors/line-amount.js.map +1 -1
- package/dist/detectors/measured-facts.d.ts +8 -0
- package/dist/detectors/measured-facts.d.ts.map +1 -0
- package/dist/detectors/measured-facts.js +18 -0
- package/dist/detectors/measured-facts.js.map +1 -0
- package/dist/detectors/meter-usage.d.ts +3 -0
- package/dist/detectors/meter-usage.d.ts.map +1 -0
- package/dist/detectors/meter-usage.js +37 -0
- package/dist/detectors/meter-usage.js.map +1 -0
- package/dist/detectors/name-field.d.ts +13 -0
- package/dist/detectors/name-field.d.ts.map +1 -0
- package/dist/detectors/name-field.js +38 -0
- package/dist/detectors/name-field.js.map +1 -0
- package/dist/detectors/name-variant-model-codes.d.ts +11 -0
- package/dist/detectors/name-variant-model-codes.d.ts.map +1 -0
- package/dist/detectors/name-variant-model-codes.js +21 -0
- package/dist/detectors/name-variant-model-codes.js.map +1 -0
- package/dist/detectors/name-variant.d.ts.map +1 -1
- package/dist/detectors/name-variant.js +151 -16
- package/dist/detectors/name-variant.js.map +1 -1
- package/dist/detectors/net-amount-mismatch.d.ts +10 -0
- package/dist/detectors/net-amount-mismatch.d.ts.map +1 -0
- package/dist/detectors/net-amount-mismatch.js +70 -0
- package/dist/detectors/net-amount-mismatch.js.map +1 -0
- package/dist/detectors/net-gross-weight.d.ts +3 -0
- package/dist/detectors/net-gross-weight.d.ts.map +1 -0
- package/dist/detectors/net-gross-weight.js +35 -0
- package/dist/detectors/net-gross-weight.js.map +1 -0
- package/dist/detectors/nominal-step.d.ts +3 -0
- package/dist/detectors/nominal-step.d.ts.map +1 -0
- package/dist/detectors/nominal-step.js +28 -0
- package/dist/detectors/nominal-step.js.map +1 -0
- package/dist/detectors/number-style.d.ts +2 -0
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +8 -2
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/order-quantity.d.ts +10 -0
- package/dist/detectors/order-quantity.d.ts.map +1 -0
- package/dist/detectors/order-quantity.js +35 -0
- package/dist/detectors/order-quantity.js.map +1 -0
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +97 -17
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +21 -7
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/period-label-conflict.d.ts +4 -0
- package/dist/detectors/period-label-conflict.d.ts.map +1 -0
- package/dist/detectors/period-label-conflict.js +34 -0
- package/dist/detectors/period-label-conflict.js.map +1 -0
- package/dist/detectors/period-multiple-mismatch.d.ts +3 -0
- package/dist/detectors/period-multiple-mismatch.d.ts.map +1 -0
- package/dist/detectors/period-multiple-mismatch.js +36 -0
- package/dist/detectors/period-multiple-mismatch.js.map +1 -0
- package/dist/detectors/period-part.d.ts +4 -0
- package/dist/detectors/period-part.d.ts.map +1 -0
- package/dist/detectors/period-part.js +58 -0
- package/dist/detectors/period-part.js.map +1 -0
- package/dist/detectors/quantity-range.d.ts +3 -0
- package/dist/detectors/quantity-range.d.ts.map +1 -0
- package/dist/detectors/quantity-range.js +35 -0
- package/dist/detectors/quantity-range.js.map +1 -0
- package/dist/detectors/range-band.d.ts +5 -0
- package/dist/detectors/range-band.d.ts.map +1 -0
- package/dist/detectors/range-band.js +80 -0
- package/dist/detectors/range-band.js.map +1 -0
- package/dist/detectors/range-words.d.ts +5 -0
- package/dist/detectors/range-words.d.ts.map +1 -0
- package/dist/detectors/range-words.js +14 -0
- package/dist/detectors/range-words.js.map +1 -0
- package/dist/detectors/ratio-mismatch.d.ts +7 -0
- package/dist/detectors/ratio-mismatch.d.ts.map +1 -0
- package/dist/detectors/ratio-mismatch.js +89 -0
- package/dist/detectors/ratio-mismatch.js.map +1 -0
- package/dist/detectors/readable-dates.d.ts +9 -0
- package/dist/detectors/readable-dates.d.ts.map +1 -0
- package/dist/detectors/readable-dates.js +23 -0
- package/dist/detectors/readable-dates.js.map +1 -0
- package/dist/detectors/reference-flag.d.ts +3 -0
- package/dist/detectors/reference-flag.d.ts.map +1 -0
- package/dist/detectors/reference-flag.js +31 -0
- package/dist/detectors/reference-flag.js.map +1 -0
- package/dist/detectors/reference-number-repeated.d.ts +3 -0
- package/dist/detectors/reference-number-repeated.d.ts.map +1 -0
- package/dist/detectors/reference-number-repeated.js +22 -0
- package/dist/detectors/reference-number-repeated.js.map +1 -0
- package/dist/detectors/reference-number-variant.d.ts +3 -0
- package/dist/detectors/reference-number-variant.d.ts.map +1 -0
- package/dist/detectors/reference-number-variant.js +40 -0
- package/dist/detectors/reference-number-variant.js.map +1 -0
- package/dist/detectors/reference-unit.d.ts +3 -0
- package/dist/detectors/reference-unit.d.ts.map +1 -0
- package/dist/detectors/reference-unit.js +19 -0
- package/dist/detectors/reference-unit.js.map +1 -0
- package/dist/detectors/registry/annual-holidays-mismatch.d.ts +3 -0
- package/dist/detectors/registry/annual-holidays-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/annual-holidays-mismatch.js +3 -0
- package/dist/detectors/registry/annual-holidays-mismatch.js.map +1 -0
- package/dist/detectors/registry/annual-pay-mismatch.d.ts +3 -0
- package/dist/detectors/registry/annual-pay-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/annual-pay-mismatch.js +3 -0
- package/dist/detectors/registry/annual-pay-mismatch.js.map +1 -0
- package/dist/detectors/registry/backorder-mismatch.d.ts +3 -0
- package/dist/detectors/registry/backorder-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/backorder-mismatch.js +3 -0
- package/dist/detectors/registry/backorder-mismatch.js.map +1 -0
- package/dist/detectors/registry/bmi-mismatch.d.ts +3 -0
- package/dist/detectors/registry/bmi-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/bmi-mismatch.js +3 -0
- package/dist/detectors/registry/bmi-mismatch.js.map +1 -0
- package/dist/detectors/registry/capacity-runtime-mismatch.d.ts +3 -0
- package/dist/detectors/registry/capacity-runtime-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/capacity-runtime-mismatch.js +3 -0
- package/dist/detectors/registry/capacity-runtime-mismatch.js.map +1 -0
- package/dist/detectors/registry/closing-balance-mismatch.d.ts +3 -0
- package/dist/detectors/registry/closing-balance-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/closing-balance-mismatch.js +3 -0
- package/dist/detectors/registry/closing-balance-mismatch.js.map +1 -0
- package/dist/detectors/registry/contact-variant.d.ts +3 -0
- package/dist/detectors/registry/contact-variant.d.ts.map +1 -0
- package/dist/detectors/registry/contact-variant.js +3 -0
- package/dist/detectors/registry/contact-variant.js.map +1 -0
- package/dist/detectors/registry/count-over-capacity.d.ts +3 -0
- package/dist/detectors/registry/count-over-capacity.d.ts.map +1 -0
- package/dist/detectors/registry/count-over-capacity.js +3 -0
- package/dist/detectors/registry/count-over-capacity.js.map +1 -0
- package/dist/detectors/registry/cumulative-below-current.d.ts +3 -0
- package/dist/detectors/registry/cumulative-below-current.d.ts.map +1 -0
- package/dist/detectors/registry/cumulative-below-current.js +3 -0
- package/dist/detectors/registry/cumulative-below-current.js.map +1 -0
- package/dist/detectors/registry/currency-column-mix.d.ts +3 -0
- package/dist/detectors/registry/currency-column-mix.d.ts.map +1 -0
- package/dist/detectors/registry/currency-column-mix.js +3 -0
- package/dist/detectors/registry/currency-column-mix.js.map +1 -0
- package/dist/detectors/registry/date-stamp-order.d.ts +3 -0
- package/dist/detectors/registry/date-stamp-order.d.ts.map +1 -0
- package/dist/detectors/registry/date-stamp-order.js +3 -0
- package/dist/detectors/registry/date-stamp-order.js.map +1 -0
- package/dist/detectors/registry/deductible-exceeds-limit.d.ts +3 -0
- package/dist/detectors/registry/deductible-exceeds-limit.d.ts.map +1 -0
- package/dist/detectors/registry/deductible-exceeds-limit.js +3 -0
- package/dist/detectors/registry/deductible-exceeds-limit.js.map +1 -0
- package/dist/detectors/registry/delivered-over-ordered.d.ts +3 -0
- package/dist/detectors/registry/delivered-over-ordered.d.ts.map +1 -0
- package/dist/detectors/registry/delivered-over-ordered.js +3 -0
- package/dist/detectors/registry/delivered-over-ordered.js.map +1 -0
- package/dist/detectors/registry/discount-rate.d.ts +3 -0
- package/dist/detectors/registry/discount-rate.d.ts.map +1 -0
- package/dist/detectors/registry/discount-rate.js +3 -0
- package/dist/detectors/registry/discount-rate.js.map +1 -0
- package/dist/detectors/registry/elapsed-years-mismatch.js +1 -1
- package/dist/detectors/registry/elapsed-years-mismatch.js.map +1 -1
- package/dist/detectors/registry/event-deadline.d.ts +3 -0
- package/dist/detectors/registry/event-deadline.d.ts.map +1 -0
- package/dist/detectors/registry/event-deadline.js +3 -0
- package/dist/detectors/registry/event-deadline.js.map +1 -0
- package/dist/detectors/registry/gpa-mismatch.d.ts +3 -0
- package/dist/detectors/registry/gpa-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/gpa-mismatch.js +3 -0
- package/dist/detectors/registry/gpa-mismatch.js.map +1 -0
- package/dist/detectors/registry/installment-total-mismatch.d.ts +3 -0
- package/dist/detectors/registry/installment-total-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/installment-total-mismatch.js +3 -0
- package/dist/detectors/registry/installment-total-mismatch.js.map +1 -0
- package/dist/detectors/registry/interest.d.ts +3 -0
- package/dist/detectors/registry/interest.d.ts.map +1 -0
- package/dist/detectors/registry/interest.js +3 -0
- package/dist/detectors/registry/interest.js.map +1 -0
- package/dist/detectors/registry/interval-count-mismatch.d.ts +3 -0
- package/dist/detectors/registry/interval-count-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/interval-count-mismatch.js +3 -0
- package/dist/detectors/registry/interval-count-mismatch.js.map +1 -0
- package/dist/detectors/registry/layout-code-mismatch.d.ts +3 -0
- package/dist/detectors/registry/layout-code-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/layout-code-mismatch.js +3 -0
- package/dist/detectors/registry/layout-code-mismatch.js.map +1 -0
- package/dist/detectors/registry/meter-usage.d.ts +3 -0
- package/dist/detectors/registry/meter-usage.d.ts.map +1 -0
- package/dist/detectors/registry/meter-usage.js +3 -0
- package/dist/detectors/registry/meter-usage.js.map +1 -0
- package/dist/detectors/registry/net-amount-mismatch.d.ts +3 -0
- package/dist/detectors/registry/net-amount-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/net-amount-mismatch.js +3 -0
- package/dist/detectors/registry/net-amount-mismatch.js.map +1 -0
- package/dist/detectors/registry/net-over-gross.d.ts +3 -0
- package/dist/detectors/registry/net-over-gross.d.ts.map +1 -0
- package/dist/detectors/registry/net-over-gross.js +3 -0
- package/dist/detectors/registry/net-over-gross.js.map +1 -0
- package/dist/detectors/registry/period-label-conflict.d.ts +3 -0
- package/dist/detectors/registry/period-label-conflict.d.ts.map +1 -0
- package/dist/detectors/registry/period-label-conflict.js +3 -0
- package/dist/detectors/registry/period-label-conflict.js.map +1 -0
- package/dist/detectors/registry/period-multiple-mismatch.d.ts +3 -0
- package/dist/detectors/registry/period-multiple-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/period-multiple-mismatch.js +3 -0
- package/dist/detectors/registry/period-multiple-mismatch.js.map +1 -0
- package/dist/detectors/registry/period-part-exceeds-whole.d.ts +3 -0
- package/dist/detectors/registry/period-part-exceeds-whole.d.ts.map +1 -0
- package/dist/detectors/registry/period-part-exceeds-whole.js +3 -0
- package/dist/detectors/registry/period-part-exceeds-whole.js.map +1 -0
- package/dist/detectors/registry/product-exceeds-maximum.d.ts +3 -0
- package/dist/detectors/registry/product-exceeds-maximum.d.ts.map +1 -0
- package/dist/detectors/registry/product-exceeds-maximum.js +3 -0
- package/dist/detectors/registry/product-exceeds-maximum.js.map +1 -0
- package/dist/detectors/registry/quantity-range.d.ts +3 -0
- package/dist/detectors/registry/quantity-range.d.ts.map +1 -0
- package/dist/detectors/registry/quantity-range.js +3 -0
- package/dist/detectors/registry/quantity-range.js.map +1 -0
- package/dist/detectors/registry/range-band-mismatch.d.ts +3 -0
- package/dist/detectors/registry/range-band-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/range-band-mismatch.js +3 -0
- package/dist/detectors/registry/range-band-mismatch.js.map +1 -0
- package/dist/detectors/registry/ratio-mismatch.d.ts +3 -0
- package/dist/detectors/registry/ratio-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/ratio-mismatch.js +3 -0
- package/dist/detectors/registry/ratio-mismatch.js.map +1 -0
- package/dist/detectors/registry/reference-flag-mismatch.d.ts +3 -0
- package/dist/detectors/registry/reference-flag-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/reference-flag-mismatch.js +3 -0
- package/dist/detectors/registry/reference-flag-mismatch.js.map +1 -0
- package/dist/detectors/registry/reference-number-repeated.d.ts +3 -0
- package/dist/detectors/registry/reference-number-repeated.d.ts.map +1 -0
- package/dist/detectors/registry/reference-number-repeated.js +3 -0
- package/dist/detectors/registry/reference-number-repeated.js.map +1 -0
- package/dist/detectors/registry/reference-number-variant.d.ts +3 -0
- package/dist/detectors/registry/reference-number-variant.d.ts.map +1 -0
- package/dist/detectors/registry/reference-number-variant.js +3 -0
- package/dist/detectors/registry/reference-number-variant.js.map +1 -0
- package/dist/detectors/registry/reference-unit.d.ts +3 -0
- package/dist/detectors/registry/reference-unit.d.ts.map +1 -0
- package/dist/detectors/registry/reference-unit.js +3 -0
- package/dist/detectors/registry/reference-unit.js.map +1 -0
- package/dist/detectors/registry/rent-multiple-mismatch.d.ts +3 -0
- package/dist/detectors/registry/rent-multiple-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/rent-multiple-mismatch.js +3 -0
- package/dist/detectors/registry/rent-multiple-mismatch.js.map +1 -0
- package/dist/detectors/registry/revision-direction.d.ts +3 -0
- package/dist/detectors/registry/revision-direction.d.ts.map +1 -0
- package/dist/detectors/registry/revision-direction.js +3 -0
- package/dist/detectors/registry/revision-direction.js.map +1 -0
- package/dist/detectors/registry/running-balance.d.ts +3 -0
- package/dist/detectors/registry/running-balance.d.ts.map +1 -0
- package/dist/detectors/registry/running-balance.js +3 -0
- package/dist/detectors/registry/running-balance.js.map +1 -0
- package/dist/detectors/registry/scaled-quantity-mismatch.d.ts +3 -0
- package/dist/detectors/registry/scaled-quantity-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/scaled-quantity-mismatch.js +3 -0
- package/dist/detectors/registry/scaled-quantity-mismatch.js.map +1 -0
- package/dist/detectors/registry/serial-range.d.ts +3 -0
- package/dist/detectors/registry/serial-range.d.ts.map +1 -0
- package/dist/detectors/registry/serial-range.js +3 -0
- package/dist/detectors/registry/serial-range.js.map +1 -0
- package/dist/detectors/registry/share-amount.d.ts +3 -0
- package/dist/detectors/registry/share-amount.d.ts.map +1 -0
- package/dist/detectors/registry/share-amount.js +3 -0
- package/dist/detectors/registry/share-amount.js.map +1 -0
- package/dist/detectors/registry/step-time-sum-mismatch.d.ts +3 -0
- package/dist/detectors/registry/step-time-sum-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/step-time-sum-mismatch.js +3 -0
- package/dist/detectors/registry/step-time-sum-mismatch.js.map +1 -0
- package/dist/detectors/registry/table-unit-mix.d.ts +3 -0
- package/dist/detectors/registry/table-unit-mix.d.ts.map +1 -0
- package/dist/detectors/registry/table-unit-mix.js +3 -0
- package/dist/detectors/registry/table-unit-mix.js.map +1 -0
- package/dist/detectors/registry/tier-threshold.d.ts +3 -0
- package/dist/detectors/registry/tier-threshold.d.ts.map +1 -0
- package/dist/detectors/registry/tier-threshold.js +3 -0
- package/dist/detectors/registry/tier-threshold.js.map +1 -0
- package/dist/detectors/registry/time-range-reversed.d.ts +3 -0
- package/dist/detectors/registry/time-range-reversed.d.ts.map +1 -0
- package/dist/detectors/registry/time-range-reversed.js +3 -0
- package/dist/detectors/registry/time-range-reversed.js.map +1 -0
- package/dist/detectors/registry/unlisted-item-used.d.ts +3 -0
- package/dist/detectors/registry/unlisted-item-used.d.ts.map +1 -0
- package/dist/detectors/registry/unlisted-item-used.js +3 -0
- package/dist/detectors/registry/unlisted-item-used.js.map +1 -0
- package/dist/detectors/registry/variance-mismatch.d.ts +3 -0
- package/dist/detectors/registry/variance-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/variance-mismatch.js +3 -0
- package/dist/detectors/registry/variance-mismatch.js.map +1 -0
- package/dist/detectors/registry/walk-time-distance-mismatch.d.ts +3 -0
- package/dist/detectors/registry/walk-time-distance-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/walk-time-distance-mismatch.js +3 -0
- package/dist/detectors/registry/walk-time-distance-mismatch.js.map +1 -0
- package/dist/detectors/relative-dates.d.ts.map +1 -1
- package/dist/detectors/relative-dates.js +2 -1
- package/dist/detectors/relative-dates.js.map +1 -1
- package/dist/detectors/relative-day-words.d.ts.map +1 -1
- package/dist/detectors/relative-day-words.js +2 -1
- package/dist/detectors/relative-day-words.js.map +1 -1
- package/dist/detectors/rent-multiple-mismatch.d.ts +3 -0
- package/dist/detectors/rent-multiple-mismatch.d.ts.map +1 -0
- package/dist/detectors/rent-multiple-mismatch.js +39 -0
- package/dist/detectors/rent-multiple-mismatch.js.map +1 -0
- package/dist/detectors/request-owner.d.ts +3 -1
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +5 -2
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/revision-direction.d.ts +3 -0
- package/dist/detectors/revision-direction.d.ts.map +1 -0
- package/dist/detectors/revision-direction.js +32 -0
- package/dist/detectors/revision-direction.js.map +1 -0
- package/dist/detectors/row-sentence-amounts.d.ts +5 -0
- package/dist/detectors/row-sentence-amounts.d.ts.map +1 -0
- package/dist/detectors/row-sentence-amounts.js +71 -0
- package/dist/detectors/row-sentence-amounts.js.map +1 -0
- package/dist/detectors/running-balance.d.ts +3 -0
- package/dist/detectors/running-balance.d.ts.map +1 -0
- package/dist/detectors/running-balance.js +26 -0
- package/dist/detectors/running-balance.js.map +1 -0
- package/dist/detectors/scaled-quantity.d.ts +3 -0
- package/dist/detectors/scaled-quantity.d.ts.map +1 -0
- package/dist/detectors/scaled-quantity.js +37 -0
- package/dist/detectors/scaled-quantity.js.map +1 -0
- package/dist/detectors/serial-range.d.ts +3 -0
- package/dist/detectors/serial-range.d.ts.map +1 -0
- package/dist/detectors/serial-range.js +29 -0
- package/dist/detectors/serial-range.js.map +1 -0
- package/dist/detectors/share-amount.d.ts +3 -0
- package/dist/detectors/share-amount.d.ts.map +1 -0
- package/dist/detectors/share-amount.js +45 -0
- package/dist/detectors/share-amount.js.map +1 -0
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +3 -1
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/step-time-sum.d.ts +3 -0
- package/dist/detectors/step-time-sum.d.ts.map +1 -0
- package/dist/detectors/step-time-sum.js +46 -0
- package/dist/detectors/step-time-sum.js.map +1 -0
- package/dist/detectors/structure-tree.d.ts +2 -0
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +58 -9
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/structure.js +1 -1
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/table-scale.d.ts +3 -0
- package/dist/detectors/table-scale.d.ts.map +1 -0
- package/dist/detectors/table-scale.js +32 -0
- package/dist/detectors/table-scale.js.map +1 -0
- package/dist/detectors/tax-amount.d.ts.map +1 -1
- package/dist/detectors/tax-amount.js +34 -10
- package/dist/detectors/tax-amount.js.map +1 -1
- package/dist/detectors/technical-docs.d.ts +6 -1
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +15 -2
- package/dist/detectors/technical-docs.js.map +1 -1
- package/dist/detectors/tier-threshold.d.ts +3 -0
- package/dist/detectors/tier-threshold.d.ts.map +1 -0
- package/dist/detectors/tier-threshold.js +86 -0
- package/dist/detectors/tier-threshold.js.map +1 -0
- package/dist/detectors/time-order.d.ts +2 -0
- package/dist/detectors/time-order.d.ts.map +1 -1
- package/dist/detectors/time-order.js +45 -13
- package/dist/detectors/time-order.js.map +1 -1
- package/dist/detectors/unit-consistency.d.ts +1 -1
- package/dist/detectors/unit-consistency.d.ts.map +1 -1
- package/dist/detectors/unit-consistency.js +46 -38
- package/dist/detectors/unit-consistency.js.map +1 -1
- package/dist/detectors/unlisted-items.d.ts +3 -0
- package/dist/detectors/unlisted-items.d.ts.map +1 -0
- package/dist/detectors/unlisted-items.js +57 -0
- package/dist/detectors/unlisted-items.js.map +1 -0
- package/dist/detectors/use-count-words.d.ts +8 -0
- package/dist/detectors/use-count-words.d.ts.map +1 -0
- package/dist/detectors/use-count-words.js +20 -0
- package/dist/detectors/use-count-words.js.map +1 -0
- package/dist/detectors/use-interval.d.ts +3 -0
- package/dist/detectors/use-interval.d.ts.map +1 -0
- package/dist/detectors/use-interval.js +39 -0
- package/dist/detectors/use-interval.js.map +1 -0
- package/dist/detectors/use-maximum.d.ts +3 -0
- package/dist/detectors/use-maximum.d.ts.map +1 -0
- package/dist/detectors/use-maximum.js +32 -0
- package/dist/detectors/use-maximum.js.map +1 -0
- package/dist/detectors/variance.d.ts +3 -0
- package/dist/detectors/variance.d.ts.map +1 -0
- package/dist/detectors/variance.js +28 -0
- package/dist/detectors/variance.js.map +1 -0
- package/dist/detectors/walk-time-distance-mismatch.d.ts +4 -0
- package/dist/detectors/walk-time-distance-mismatch.d.ts.map +1 -0
- package/dist/detectors/walk-time-distance-mismatch.js +38 -0
- package/dist/detectors/walk-time-distance-mismatch.js.map +1 -0
- package/dist/detectors/whole-count-findings.d.ts +4 -0
- package/dist/detectors/whole-count-findings.d.ts.map +1 -0
- package/dist/detectors/whole-count-findings.js +38 -0
- package/dist/detectors/whole-count-findings.js.map +1 -0
- package/dist/detectors/working-hours-findings.d.ts +9 -0
- package/dist/detectors/working-hours-findings.d.ts.map +1 -0
- package/dist/detectors/working-hours-findings.js +79 -0
- package/dist/detectors/working-hours-findings.js.map +1 -0
- package/dist/facts/age-values.d.ts +22 -0
- package/dist/facts/age-values.d.ts.map +1 -0
- package/dist/facts/age-values.js +76 -0
- package/dist/facts/age-values.js.map +1 -0
- package/dist/facts/approximate-tolerance.d.ts +7 -0
- package/dist/facts/approximate-tolerance.d.ts.map +1 -0
- package/dist/facts/approximate-tolerance.js +16 -0
- package/dist/facts/approximate-tolerance.js.map +1 -0
- package/dist/facts/cell-keys.d.ts +12 -0
- package/dist/facts/cell-keys.d.ts.map +1 -0
- package/dist/facts/cell-keys.js +19 -0
- package/dist/facts/cell-keys.js.map +1 -0
- package/dist/facts/count-labels.d.ts +15 -0
- package/dist/facts/count-labels.d.ts.map +1 -0
- package/dist/facts/count-labels.js +19 -0
- package/dist/facts/count-labels.js.map +1 -0
- package/dist/facts/document-terms.d.ts +43 -0
- package/dist/facts/document-terms.d.ts.map +1 -0
- package/dist/facts/document-terms.js +74 -0
- package/dist/facts/document-terms.js.map +1 -0
- package/dist/facts/duration-scale.d.ts +11 -0
- package/dist/facts/duration-scale.d.ts.map +1 -0
- package/dist/facts/duration-scale.js +14 -0
- package/dist/facts/duration-scale.js.map +1 -0
- package/dist/facts/duration-values.d.ts +15 -0
- package/dist/facts/duration-values.d.ts.map +1 -0
- package/dist/facts/duration-values.js +29 -0
- package/dist/facts/duration-values.js.map +1 -0
- package/dist/facts/fact-values.d.ts +9 -1
- package/dist/facts/fact-values.d.ts.map +1 -1
- package/dist/facts/fact-values.js +19 -6
- package/dist/facts/fact-values.js.map +1 -1
- package/dist/facts/item-amounts.d.ts +18 -0
- package/dist/facts/item-amounts.d.ts.map +1 -0
- package/dist/facts/item-amounts.js +67 -0
- package/dist/facts/item-amounts.js.map +1 -0
- package/dist/facts/labelled-facts.d.ts +18 -0
- package/dist/facts/labelled-facts.d.ts.map +1 -1
- package/dist/facts/labelled-facts.js +71 -13
- package/dist/facts/labelled-facts.js.map +1 -1
- package/dist/facts/measure-units.d.ts +5 -0
- package/dist/facts/measure-units.d.ts.map +1 -0
- package/dist/facts/measure-units.js +43 -0
- package/dist/facts/measure-units.js.map +1 -0
- package/dist/facts/measures.d.ts +23 -4
- package/dist/facts/measures.d.ts.map +1 -1
- package/dist/facts/measures.js +71 -20
- package/dist/facts/measures.js.map +1 -1
- package/dist/facts/qualified-labels.d.ts +28 -0
- package/dist/facts/qualified-labels.d.ts.map +1 -0
- package/dist/facts/qualified-labels.js +96 -0
- package/dist/facts/qualified-labels.js.map +1 -0
- package/dist/facts/rate-values.d.ts +40 -0
- package/dist/facts/rate-values.d.ts.map +1 -0
- package/dist/facts/rate-values.js +68 -0
- package/dist/facts/rate-values.js.map +1 -0
- package/dist/facts/retention-periods.d.ts +51 -0
- package/dist/facts/retention-periods.d.ts.map +1 -0
- package/dist/facts/retention-periods.js +148 -0
- package/dist/facts/retention-periods.js.map +1 -0
- package/dist/facts/row-sentence-amounts.d.ts +51 -0
- package/dist/facts/row-sentence-amounts.d.ts.map +1 -0
- package/dist/facts/row-sentence-amounts.js +71 -0
- package/dist/facts/row-sentence-amounts.js.map +1 -0
- package/dist/facts/superscript-power.d.ts +3 -0
- package/dist/facts/superscript-power.d.ts.map +1 -0
- package/dist/facts/superscript-power.js +5 -0
- package/dist/facts/superscript-power.js.map +1 -0
- package/dist/facts/table-facts.d.ts +18 -2
- package/dist/facts/table-facts.d.ts.map +1 -1
- package/dist/facts/table-facts.js +16 -6
- package/dist/facts/table-facts.js.map +1 -1
- package/dist/facts/term-values.d.ts +34 -0
- package/dist/facts/term-values.d.ts.map +1 -0
- package/dist/facts/term-values.js +195 -0
- package/dist/facts/term-values.js.map +1 -0
- package/dist/facts/unit-conflicts.d.ts +3 -2
- package/dist/facts/unit-conflicts.d.ts.map +1 -1
- package/dist/facts/unit-conflicts.js +15 -7
- package/dist/facts/unit-conflicts.js.map +1 -1
- package/dist/facts/unit-equivalents.d.ts +13 -0
- package/dist/facts/unit-equivalents.d.ts.map +1 -0
- package/dist/facts/unit-equivalents.js +56 -0
- package/dist/facts/unit-equivalents.js.map +1 -0
- package/dist/facts/unit-tolerance.d.ts +4 -0
- package/dist/facts/unit-tolerance.d.ts.map +1 -0
- package/dist/facts/unit-tolerance.js +13 -0
- package/dist/facts/unit-tolerance.js.map +1 -0
- package/dist/facts/unit-word.d.ts +13 -0
- package/dist/facts/unit-word.d.ts.map +1 -0
- package/dist/facts/unit-word.js +43 -0
- package/dist/facts/unit-word.js.map +1 -0
- package/dist/facts/verb-quantity-facts.d.ts +22 -0
- package/dist/facts/verb-quantity-facts.d.ts.map +1 -0
- package/dist/facts/verb-quantity-facts.js +58 -0
- package/dist/facts/verb-quantity-facts.js.map +1 -0
- package/dist/facts/whole-counts.d.ts +58 -0
- package/dist/facts/whole-counts.d.ts.map +1 -0
- package/dist/facts/whole-counts.js +118 -0
- package/dist/facts/whole-counts.js.map +1 -0
- package/dist/facts/written-precision.d.ts +10 -0
- package/dist/facts/written-precision.d.ts.map +1 -0
- package/dist/facts/written-precision.js +20 -0
- package/dist/facts/written-precision.js.map +1 -0
- package/dist/kana-spelling.d.ts +12 -0
- package/dist/kana-spelling.d.ts.map +1 -1
- package/dist/kana-spelling.js +23 -0
- package/dist/kana-spelling.js.map +1 -1
- package/dist/model-codes.d.ts +23 -0
- package/dist/model-codes.d.ts.map +1 -0
- package/dist/model-codes.js +81 -0
- package/dist/model-codes.js.map +1 -0
- package/dist/name-char-reading.d.ts +16 -0
- package/dist/name-char-reading.d.ts.map +1 -0
- package/dist/name-char-reading.js +18 -0
- package/dist/name-char-reading.js.map +1 -0
- package/dist/name-line-block.d.ts +6 -0
- package/dist/name-line-block.d.ts.map +1 -0
- package/dist/name-line-block.js +35 -0
- package/dist/name-line-block.js.map +1 -0
- package/dist/name-lookalike-chars.d.ts +16 -0
- package/dist/name-lookalike-chars.d.ts.map +1 -0
- package/dist/name-lookalike-chars.js +41 -0
- package/dist/name-lookalike-chars.js.map +1 -0
- package/dist/name-neighbours.d.ts +7 -0
- package/dist/name-neighbours.d.ts.map +1 -0
- package/dist/name-neighbours.js +55 -0
- package/dist/name-neighbours.js.map +1 -0
- package/dist/name-ordinary-word.d.ts +13 -0
- package/dist/name-ordinary-word.d.ts.map +1 -0
- package/dist/name-ordinary-word.js +54 -0
- package/dist/name-ordinary-word.js.map +1 -0
- package/dist/name-person.d.ts +9 -0
- package/dist/name-person.d.ts.map +1 -0
- package/dist/name-person.js +25 -0
- package/dist/name-person.js.map +1 -0
- package/dist/name-separator.d.ts +14 -0
- package/dist/name-separator.d.ts.map +1 -0
- package/dist/name-separator.js +33 -0
- package/dist/name-separator.js.map +1 -0
- package/dist/name-spelling-chars.d.ts +16 -0
- package/dist/name-spelling-chars.d.ts.map +1 -0
- package/dist/name-spelling-chars.js +14 -0
- package/dist/name-spelling-chars.js.map +1 -0
- package/dist/name-variants.d.ts +10 -9
- package/dist/name-variants.d.ts.map +1 -1
- package/dist/name-variants.js +32 -88
- package/dist/name-variants.js.map +1 -1
- package/dist/name-weight.d.ts +10 -0
- package/dist/name-weight.d.ts.map +1 -0
- package/dist/name-weight.js +7 -0
- package/dist/name-weight.js.map +1 -0
- package/dist/person-field.d.ts +6 -0
- package/dist/person-field.d.ts.map +1 -0
- package/dist/person-field.js +40 -0
- package/dist/person-field.js.map +1 -0
- package/dist/person-full-name.d.ts +12 -0
- package/dist/person-full-name.d.ts.map +1 -0
- package/dist/person-full-name.js +52 -0
- package/dist/person-full-name.js.map +1 -0
- package/dist/phone-numbers.d.ts +23 -3
- package/dist/phone-numbers.d.ts.map +1 -1
- package/dist/phone-numbers.js +68 -23
- package/dist/phone-numbers.js.map +1 -1
- package/dist/place-names.d.ts +12 -5
- package/dist/place-names.d.ts.map +1 -1
- package/dist/place-names.js +34 -14
- package/dist/place-names.js.map +1 -1
- package/dist/plugin.d.ts +7 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/preamble-paragraphs.d.ts +2 -1
- package/dist/preamble-paragraphs.d.ts.map +1 -1
- package/dist/preamble-paragraphs.js +16 -1
- package/dist/preamble-paragraphs.js.map +1 -1
- package/dist/product-names.d.ts +33 -0
- package/dist/product-names.d.ts.map +1 -0
- package/dist/product-names.js +74 -0
- package/dist/product-names.js.map +1 -0
- package/dist/profile/parse.d.ts.map +1 -1
- package/dist/profile/parse.js +11 -0
- package/dist/profile/parse.js.map +1 -1
- package/dist/reference-numbers.d.ts +26 -0
- package/dist/reference-numbers.d.ts.map +1 -0
- package/dist/reference-numbers.js +43 -0
- package/dist/reference-numbers.js.map +1 -0
- package/dist/spaced-person-name.d.ts +17 -0
- package/dist/spaced-person-name.d.ts.map +1 -0
- package/dist/spaced-person-name.js +82 -0
- package/dist/spaced-person-name.js.map +1 -0
- package/dist/spacing-code.d.ts +7 -0
- package/dist/spacing-code.d.ts.map +1 -0
- package/dist/spacing-code.js +30 -0
- package/dist/spacing-code.js.map +1 -0
- package/dist/structure/amount-range.d.ts +2 -2
- package/dist/structure/amount-range.d.ts.map +1 -1
- package/dist/structure/amount-range.js +12 -5
- package/dist/structure/amount-range.js.map +1 -1
- package/dist/structure/annual-holidays.d.ts +56 -0
- package/dist/structure/annual-holidays.d.ts.map +1 -0
- package/dist/structure/annual-holidays.js +159 -0
- package/dist/structure/annual-holidays.js.map +1 -0
- package/dist/structure/annual-pay.d.ts +97 -0
- package/dist/structure/annual-pay.d.ts.map +1 -0
- package/dist/structure/annual-pay.js +236 -0
- package/dist/structure/annual-pay.js.map +1 -0
- package/dist/structure/bmi.d.ts +63 -0
- package/dist/structure/bmi.d.ts.map +1 -0
- package/dist/structure/bmi.js +106 -0
- package/dist/structure/bmi.js.map +1 -0
- package/dist/structure/capacity-count.d.ts +59 -0
- package/dist/structure/capacity-count.d.ts.map +1 -0
- package/dist/structure/capacity-count.js +118 -0
- package/dist/structure/capacity-count.js.map +1 -0
- package/dist/structure/change-rate-table.d.ts +46 -0
- package/dist/structure/change-rate-table.d.ts.map +1 -0
- package/dist/structure/change-rate-table.js +110 -0
- package/dist/structure/change-rate-table.js.map +1 -0
- package/dist/structure/change-rate.d.ts +13 -1
- package/dist/structure/change-rate.d.ts.map +1 -1
- package/dist/structure/change-rate.js +51 -19
- package/dist/structure/change-rate.js.map +1 -1
- package/dist/structure/closing-balance.d.ts +24 -0
- package/dist/structure/closing-balance.d.ts.map +1 -0
- package/dist/structure/closing-balance.js +79 -0
- package/dist/structure/closing-balance.js.map +1 -0
- package/dist/structure/column-date-order.d.ts +5 -0
- package/dist/structure/column-date-order.d.ts.map +1 -0
- package/dist/structure/column-date-order.js +57 -0
- package/dist/structure/column-date-order.js.map +1 -0
- package/dist/structure/compound-hours.d.ts +5 -0
- package/dist/structure/compound-hours.d.ts.map +1 -0
- package/dist/structure/compound-hours.js +45 -0
- package/dist/structure/compound-hours.js.map +1 -0
- package/dist/structure/counted-amounts.d.ts +6 -0
- package/dist/structure/counted-amounts.d.ts.map +1 -1
- package/dist/structure/counted-amounts.js +4 -4
- package/dist/structure/counted-amounts.js.map +1 -1
- package/dist/structure/cumulative-below-current.d.ts +21 -0
- package/dist/structure/cumulative-below-current.d.ts.map +1 -0
- package/dist/structure/cumulative-below-current.js +48 -0
- package/dist/structure/cumulative-below-current.js.map +1 -0
- package/dist/structure/currency-column.d.ts +21 -0
- package/dist/structure/currency-column.d.ts.map +1 -0
- package/dist/structure/currency-column.js +74 -0
- package/dist/structure/currency-column.js.map +1 -0
- package/dist/structure/date-deadline-mark.d.ts +15 -0
- package/dist/structure/date-deadline-mark.d.ts.map +1 -0
- package/dist/structure/date-deadline-mark.js +22 -0
- package/dist/structure/date-deadline-mark.js.map +1 -0
- package/dist/structure/date-outside-period.d.ts +8 -2
- package/dist/structure/date-outside-period.d.ts.map +1 -1
- package/dist/structure/date-outside-period.js +21 -14
- package/dist/structure/date-outside-period.js.map +1 -1
- package/dist/structure/date-range.d.ts +3 -1
- package/dist/structure/date-range.d.ts.map +1 -1
- package/dist/structure/date-range.js +5 -7
- package/dist/structure/date-range.js.map +1 -1
- package/dist/structure/deadline-after-event.d.ts +56 -0
- package/dist/structure/deadline-after-event.d.ts.map +1 -0
- package/dist/structure/deadline-after-event.js +113 -0
- package/dist/structure/deadline-after-event.js.map +1 -0
- package/dist/structure/deductible-limit.d.ts +69 -0
- package/dist/structure/deductible-limit.d.ts.map +1 -0
- package/dist/structure/deductible-limit.js +191 -0
- package/dist/structure/deductible-limit.js.map +1 -0
- package/dist/structure/definition-use.d.ts +1 -1
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +55 -2
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure/discount-rate.d.ts +35 -0
- package/dist/structure/discount-rate.d.ts.map +1 -0
- package/dist/structure/discount-rate.js +172 -0
- package/dist/structure/discount-rate.js.map +1 -0
- package/dist/structure/due-date.d.ts.map +1 -1
- package/dist/structure/due-date.js +5 -27
- package/dist/structure/due-date.js.map +1 -1
- package/dist/structure/generic-role.d.ts +2 -0
- package/dist/structure/generic-role.d.ts.map +1 -0
- package/dist/structure/generic-role.js +8 -0
- package/dist/structure/generic-role.js.map +1 -0
- package/dist/structure/gpa.d.ts +74 -0
- package/dist/structure/gpa.d.ts.map +1 -0
- package/dist/structure/gpa.js +170 -0
- package/dist/structure/gpa.js.map +1 -0
- package/dist/structure/installment-total.d.ts +110 -0
- package/dist/structure/installment-total.d.ts.map +1 -0
- package/dist/structure/installment-total.js +224 -0
- package/dist/structure/installment-total.js.map +1 -0
- package/dist/structure/interest.d.ts +22 -0
- package/dist/structure/interest.d.ts.map +1 -0
- package/dist/structure/interest.js +107 -0
- package/dist/structure/interest.js.map +1 -0
- package/dist/structure/key-value-row.d.ts +14 -0
- package/dist/structure/key-value-row.d.ts.map +1 -0
- package/dist/structure/key-value-row.js +38 -0
- package/dist/structure/key-value-row.js.map +1 -0
- package/dist/structure/lab-columns.d.ts +12 -0
- package/dist/structure/lab-columns.d.ts.map +1 -0
- package/dist/structure/lab-columns.js +11 -0
- package/dist/structure/lab-columns.js.map +1 -0
- package/dist/structure/labelled-date-order.d.ts +55 -0
- package/dist/structure/labelled-date-order.d.ts.map +1 -0
- package/dist/structure/labelled-date-order.js +49 -0
- package/dist/structure/labelled-date-order.js.map +1 -0
- package/dist/structure/labelled-order.d.ts +59 -0
- package/dist/structure/labelled-order.d.ts.map +1 -0
- package/dist/structure/labelled-order.js +65 -0
- package/dist/structure/labelled-order.js.map +1 -0
- package/dist/structure/labelled-time-order.d.ts +17 -0
- package/dist/structure/labelled-time-order.d.ts.map +1 -0
- package/dist/structure/labelled-time-order.js +79 -0
- package/dist/structure/labelled-time-order.js.map +1 -0
- package/dist/structure/layout-codes.d.ts +68 -0
- package/dist/structure/layout-codes.d.ts.map +1 -0
- package/dist/structure/layout-codes.js +161 -0
- package/dist/structure/layout-codes.js.map +1 -0
- package/dist/structure/line-amount-label.d.ts +31 -0
- package/dist/structure/line-amount-label.d.ts.map +1 -0
- package/dist/structure/line-amount-label.js +77 -0
- package/dist/structure/line-amount-label.js.map +1 -0
- package/dist/structure/line-amount-rate.d.ts +47 -0
- package/dist/structure/line-amount-rate.d.ts.map +1 -0
- package/dist/structure/line-amount-rate.js +141 -0
- package/dist/structure/line-amount-rate.js.map +1 -0
- package/dist/structure/line-amount-unit.d.ts +7 -0
- package/dist/structure/line-amount-unit.d.ts.map +1 -1
- package/dist/structure/line-amount-unit.js +11 -0
- package/dist/structure/line-amount-unit.js.map +1 -1
- package/dist/structure/line-amount.d.ts +33 -7
- package/dist/structure/line-amount.d.ts.map +1 -1
- package/dist/structure/line-amount.js +152 -42
- package/dist/structure/line-amount.js.map +1 -1
- package/dist/structure/measured-amounts.d.ts +17 -0
- package/dist/structure/measured-amounts.d.ts.map +1 -0
- package/dist/structure/measured-amounts.js +110 -0
- package/dist/structure/measured-amounts.js.map +1 -0
- package/dist/structure/meter-usage-read.d.ts +21 -0
- package/dist/structure/meter-usage-read.d.ts.map +1 -0
- package/dist/structure/meter-usage-read.js +116 -0
- package/dist/structure/meter-usage-read.js.map +1 -0
- package/dist/structure/meter-usage.d.ts +62 -0
- package/dist/structure/meter-usage.d.ts.map +1 -0
- package/dist/structure/meter-usage.js +157 -0
- package/dist/structure/meter-usage.js.map +1 -0
- package/dist/structure/net-amount.d.ts +81 -0
- package/dist/structure/net-amount.d.ts.map +1 -0
- package/dist/structure/net-amount.js +161 -0
- package/dist/structure/net-amount.js.map +1 -0
- package/dist/structure/net-gross-weight.d.ts +30 -0
- package/dist/structure/net-gross-weight.d.ts.map +1 -0
- package/dist/structure/net-gross-weight.js +79 -0
- package/dist/structure/net-gross-weight.js.map +1 -0
- package/dist/structure/order-quantity.d.ts +38 -0
- package/dist/structure/order-quantity.d.ts.map +1 -0
- package/dist/structure/order-quantity.js +104 -0
- package/dist/structure/order-quantity.js.map +1 -0
- package/dist/structure/party-role.d.ts.map +1 -1
- package/dist/structure/party-role.js +4 -1
- package/dist/structure/party-role.js.map +1 -1
- package/dist/structure/percent-sum.d.ts +2 -0
- package/dist/structure/percent-sum.d.ts.map +1 -1
- package/dist/structure/percent-sum.js +2 -0
- package/dist/structure/percent-sum.js.map +1 -1
- package/dist/structure/period-label-conflict.d.ts +52 -0
- package/dist/structure/period-label-conflict.d.ts.map +1 -0
- package/dist/structure/period-label-conflict.js +105 -0
- package/dist/structure/period-label-conflict.js.map +1 -0
- package/dist/structure/period-labels.d.ts +36 -0
- package/dist/structure/period-labels.d.ts.map +1 -0
- package/dist/structure/period-labels.js +86 -0
- package/dist/structure/period-labels.js.map +1 -0
- package/dist/structure/period-multiple.d.ts +46 -0
- package/dist/structure/period-multiple.d.ts.map +1 -0
- package/dist/structure/period-multiple.js +123 -0
- package/dist/structure/period-multiple.js.map +1 -0
- package/dist/structure/quantity-range.d.ts +8 -0
- package/dist/structure/quantity-range.d.ts.map +1 -0
- package/dist/structure/quantity-range.js +32 -0
- package/dist/structure/quantity-range.js.map +1 -0
- package/dist/structure/range-bands.d.ts +77 -0
- package/dist/structure/range-bands.d.ts.map +1 -0
- package/dist/structure/range-bands.js +244 -0
- package/dist/structure/range-bands.js.map +1 -0
- package/dist/structure/range-years.d.ts +18 -0
- package/dist/structure/range-years.d.ts.map +1 -0
- package/dist/structure/range-years.js +60 -0
- package/dist/structure/range-years.js.map +1 -0
- package/dist/structure/ratio.d.ts +136 -0
- package/dist/structure/ratio.d.ts.map +1 -0
- package/dist/structure/ratio.js +214 -0
- package/dist/structure/ratio.js.map +1 -0
- package/dist/structure/reference-flags.d.ts +55 -0
- package/dist/structure/reference-flags.d.ts.map +1 -0
- package/dist/structure/reference-flags.js +116 -0
- package/dist/structure/reference-flags.js.map +1 -0
- package/dist/structure/reference-number-repeated.d.ts +12 -0
- package/dist/structure/reference-number-repeated.d.ts.map +1 -0
- package/dist/structure/reference-number-repeated.js +43 -0
- package/dist/structure/reference-number-repeated.js.map +1 -0
- package/dist/structure/reference-unit.d.ts +24 -0
- package/dist/structure/reference-unit.d.ts.map +1 -0
- package/dist/structure/reference-unit.js +80 -0
- package/dist/structure/reference-unit.js.map +1 -0
- package/dist/structure/rent-multiple.d.ts +56 -0
- package/dist/structure/rent-multiple.d.ts.map +1 -0
- package/dist/structure/rent-multiple.js +139 -0
- package/dist/structure/rent-multiple.js.map +1 -0
- package/dist/structure/revision-direction.d.ts +51 -0
- package/dist/structure/revision-direction.d.ts.map +1 -0
- package/dist/structure/revision-direction.js +163 -0
- package/dist/structure/revision-direction.js.map +1 -0
- package/dist/structure/running-balance.d.ts +36 -0
- package/dist/structure/running-balance.d.ts.map +1 -0
- package/dist/structure/running-balance.js +126 -0
- package/dist/structure/running-balance.js.map +1 -0
- package/dist/structure/scaled-quantities.d.ts +50 -0
- package/dist/structure/scaled-quantities.d.ts.map +1 -0
- package/dist/structure/scaled-quantities.js +170 -0
- package/dist/structure/scaled-quantities.js.map +1 -0
- package/dist/structure/serial-range.d.ts +9 -0
- package/dist/structure/serial-range.d.ts.map +1 -0
- package/dist/structure/serial-range.js +41 -0
- package/dist/structure/serial-range.js.map +1 -0
- package/dist/structure/share-amount.d.ts +55 -0
- package/dist/structure/share-amount.d.ts.map +1 -0
- package/dist/structure/share-amount.js +162 -0
- package/dist/structure/share-amount.js.map +1 -0
- package/dist/structure/shift-times.d.ts +32 -0
- package/dist/structure/shift-times.d.ts.map +1 -0
- package/dist/structure/shift-times.js +112 -0
- package/dist/structure/shift-times.js.map +1 -0
- package/dist/structure/span-label.d.ts +3 -0
- package/dist/structure/span-label.d.ts.map +1 -0
- package/dist/structure/span-label.js +27 -0
- package/dist/structure/span-label.js.map +1 -0
- package/dist/structure/stamp-order.d.ts +16 -0
- package/dist/structure/stamp-order.d.ts.map +1 -0
- package/dist/structure/stamp-order.js +78 -0
- package/dist/structure/stamp-order.js.map +1 -0
- package/dist/structure/stated-multiple.d.ts +39 -0
- package/dist/structure/stated-multiple.d.ts.map +1 -0
- package/dist/structure/stated-multiple.js +49 -0
- package/dist/structure/stated-multiple.js.map +1 -0
- package/dist/structure/stated-period.d.ts +3 -2
- package/dist/structure/stated-period.d.ts.map +1 -1
- package/dist/structure/stated-period.js +17 -11
- package/dist/structure/stated-period.js.map +1 -1
- package/dist/structure/step-times.d.ts +49 -0
- package/dist/structure/step-times.d.ts.map +1 -0
- package/dist/structure/step-times.js +128 -0
- package/dist/structure/step-times.js.map +1 -0
- package/dist/structure/table-scale.d.ts +45 -0
- package/dist/structure/table-scale.d.ts.map +1 -0
- package/dist/structure/table-scale.js +188 -0
- package/dist/structure/table-scale.js.map +1 -0
- package/dist/structure/tax-price.d.ts +29 -0
- package/dist/structure/tax-price.d.ts.map +1 -0
- package/dist/structure/tax-price.js +112 -0
- package/dist/structure/tax-price.js.map +1 -0
- package/dist/structure/tax.d.ts +2 -0
- package/dist/structure/tax.d.ts.map +1 -1
- package/dist/structure/tax.js +46 -23
- package/dist/structure/tax.js.map +1 -1
- package/dist/structure/term-deadline.d.ts +19 -0
- package/dist/structure/term-deadline.d.ts.map +1 -0
- package/dist/structure/term-deadline.js +28 -0
- package/dist/structure/term-deadline.js.map +1 -0
- package/dist/structure/tier-threshold.d.ts +65 -0
- package/dist/structure/tier-threshold.d.ts.map +1 -0
- package/dist/structure/tier-threshold.js +170 -0
- package/dist/structure/tier-threshold.js.map +1 -0
- package/dist/structure/time-range.d.ts +18 -0
- package/dist/structure/time-range.d.ts.map +1 -0
- package/dist/structure/time-range.js +62 -0
- package/dist/structure/time-range.js.map +1 -0
- package/dist/structure/total-line.d.ts +48 -0
- package/dist/structure/total-line.d.ts.map +1 -0
- package/dist/structure/total-line.js +165 -0
- package/dist/structure/total-line.js.map +1 -0
- package/dist/structure/total-row-blank.d.ts +10 -0
- package/dist/structure/total-row-blank.d.ts.map +1 -0
- package/dist/structure/total-row-blank.js +15 -0
- package/dist/structure/total-row-blank.js.map +1 -0
- package/dist/structure/total.d.ts +17 -1
- package/dist/structure/total.d.ts.map +1 -1
- package/dist/structure/total.js +103 -7
- package/dist/structure/total.js.map +1 -1
- package/dist/structure/unlisted-items.d.ts +70 -0
- package/dist/structure/unlisted-items.d.ts.map +1 -0
- package/dist/structure/unlisted-items.js +152 -0
- package/dist/structure/unlisted-items.js.map +1 -0
- package/dist/structure/variance-table.d.ts +34 -0
- package/dist/structure/variance-table.d.ts.map +1 -0
- package/dist/structure/variance-table.js +130 -0
- package/dist/structure/variance-table.js.map +1 -0
- package/dist/structure/walk-time.d.ts +87 -0
- package/dist/structure/walk-time.d.ts.map +1 -0
- package/dist/structure/walk-time.js +195 -0
- package/dist/structure/walk-time.js.map +1 -0
- package/dist/table-names.d.ts +4 -3
- package/dist/table-names.d.ts.map +1 -1
- package/dist/table-names.js +6 -6
- package/dist/table-names.js.map +1 -1
- package/dist/unlabelled-references.d.ts +16 -0
- package/dist/unlabelled-references.d.ts.map +1 -0
- package/dist/unlabelled-references.js +73 -0
- package/dist/unlabelled-references.js.map +1 -0
- package/dist/vehicle-plates.d.ts +28 -0
- package/dist/vehicle-plates.d.ts.map +1 -0
- package/dist/vehicle-plates.js +116 -0
- package/dist/vehicle-plates.js.map +1 -0
- package/dist/whole-word-runs.d.ts +24 -0
- package/dist/whole-word-runs.d.ts.map +1 -0
- package/dist/whole-word-runs.js +26 -0
- package/dist/whole-word-runs.js.map +1 -0
- package/package.json +4 -3
- package/profiles/listing.yaml +20 -0
- package/rules/absolute-exception.yaml +1 -1
- package/rules/ai-generated-composite.yaml +1 -1
- package/rules/ai-tell.yaml +1 -1
- package/rules/amount-range-reversed.yaml +1 -1
- package/rules/amount-scale-consistency.yaml +1 -1
- package/rules/announced-count-mismatch.yaml +2 -2
- package/rules/announcing-opener.yaml +1 -1
- package/rules/annual-holidays-mismatch.yaml +65 -0
- package/rules/annual-pay-mismatch.yaml +64 -0
- package/rules/article-sound.yaml +1 -1
- package/rules/assistant-residue.yaml +1 -1
- package/rules/attachment-not-attached.yaml +1 -1
- package/rules/backorder-mismatch.yaml +57 -0
- package/rules/bmi-mismatch.yaml +63 -0
- package/rules/bold-label-list.yaml +1 -1
- package/rules/broken-link.yaml +1 -1
- package/rules/capacity-runtime-mismatch.yaml +66 -0
- package/rules/change-rate-mismatch.yaml +6 -6
- package/rules/chat-citation-residue.yaml +2 -2
- package/rules/cliche.yaml +2 -2
- package/rules/closing-balance-mismatch.yaml +63 -0
- package/rules/colon-lead-in.yaml +1 -1
- package/rules/comparative-without-baseline.yaml +1 -1
- package/rules/concrete-evidence-density.yaml +1 -1
- package/rules/connection-time-short.yaml +1 -1
- package/rules/contact-variant.yaml +76 -0
- package/rules/contrast-framing.yaml +2 -2
- package/rules/count-over-capacity.yaml +55 -0
- package/rules/cross-doc-broken-link.yaml +1 -1
- package/rules/cross-doc-fact-conflict.yaml +1 -1
- package/rules/cross-doc-term-variant.yaml +1 -1
- package/rules/cumulative-below-current.yaml +59 -0
- package/rules/currency-column-mix.yaml +70 -0
- package/rules/currency-notation-consistency.yaml +2 -2
- package/rules/cushion-phrase-density.yaml +1 -1
- package/rules/dangling-participle.yaml +2 -2
- package/rules/dangling-reference.yaml +1 -1
- package/rules/date-format-consistency.yaml +1 -1
- package/rules/date-outside-period.yaml +5 -5
- package/rules/date-range-reversed.yaml +2 -2
- package/rules/date-stamp-order.yaml +82 -0
- package/rules/date-without-year.yaml +12 -12
- package/rules/deadline-after-event.yaml +72 -0
- package/rules/deductible-exceeds-limit.yaml +54 -0
- package/rules/defined-name-repeated.yaml +3 -3
- package/rules/defined-term-form.yaml +2 -2
- package/rules/delivered-over-ordered.yaml +57 -0
- package/rules/demonstrative-opener-run.yaml +1 -1
- package/rules/discount-rate-mismatch.yaml +66 -0
- package/rules/due-before-issue.yaml +36 -11
- package/rules/duration-mismatch.yaml +16 -7
- package/rules/duration-product-mismatch.yaml +11 -3
- package/rules/elapsed-years-mismatch.yaml +11 -6
- package/rules/email-greeting-closing.yaml +2 -2
- package/rules/empty-conclusion.yaml +1 -1
- package/rules/empty-intensifier.yaml +1 -1
- package/rules/empty-list-item.yaml +1 -1
- package/rules/empty-section.yaml +1 -1
- package/rules/empty-table-cell.yaml +2 -2
- package/rules/expletive-construction.yaml +1 -1
- package/rules/fact-conflict.yaml +21 -4
- package/rules/figurative-density.yaml +1 -1
- package/rules/figure-reference-order.yaml +1 -1
- package/rules/footnote-mismatch.yaml +1 -1
- package/rules/fullwidth-alnum-consistency.yaml +1 -1
- package/rules/gpa-mismatch.yaml +80 -0
- package/rules/heading-echo.yaml +2 -2
- package/rules/heading-end-punctuation-mix.yaml +1 -1
- package/rules/heading-level-skip.yaml +1 -1
- package/rules/heading-numbering-mix.yaml +3 -3
- package/rules/homophone-slip.yaml +1 -1
- package/rules/humble-for-others.yaml +1 -1
- package/rules/idiom-misuse.yaml +1 -1
- package/rules/ime-residue.yaml +1 -1
- package/rules/impossible-date.yaml +10 -6
- package/rules/installment-total-mismatch.yaml +58 -0
- package/rules/interest-mismatch.yaml +50 -0
- package/rules/interval-count-mismatch.yaml +54 -0
- package/rules/invisible-character.yaml +1 -1
- package/rules/kana-function-word.yaml +2 -2
- package/rules/katakana-density.yaml +1 -1
- package/rules/katakana-long-vowel.yaml +2 -2
- package/rules/kutoten-consistency.yaml +1 -1
- package/rules/latin-spacing.yaml +20 -6
- package/rules/layout-code-mismatch.yaml +68 -0
- package/rules/less-for-fewer.yaml +1 -1
- package/rules/line-amount-mismatch.yaml +8 -7
- package/rules/link-text-url-mismatch.yaml +1 -1
- package/rules/list-item-form-mix.yaml +1 -1
- package/rules/lookalike-character.yaml +1 -1
- package/rules/max-kanji-continuous.yaml +1 -1
- package/rules/meter-usage-mismatch.yaml +64 -0
- package/rules/misconversion.yaml +1 -1
- package/rules/modal-conflict.yaml +1 -1
- package/rules/name-variant.yaml +18 -3
- package/rules/net-amount-mismatch.yaml +57 -0
- package/rules/net-over-gross.yaml +57 -0
- package/rules/no-doubled-joshi.yaml +1 -1
- package/rules/no-em-dash.yaml +2 -2
- package/rules/no-mixed-desumasu.yaml +1 -1
- package/rules/no-nakaguro-parallel.yaml +1 -1
- package/rules/nominalization.yaml +1 -1
- package/rules/nonstandard-word.yaml +1 -1
- package/rules/number-style-consistency.yaml +3 -3
- package/rules/number-without-unit.yaml +1 -1
- package/rules/number-word-figure-mismatch.yaml +1 -1
- package/rules/numbering-gap.yaml +1 -1
- package/rules/obligation-without-deadline.yaml +1 -1
- package/rules/ordinal-suffix-mismatch.yaml +1 -1
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/outside-announced-list.yaml +1 -1
- package/rules/padded-intro.yaml +1 -1
- package/rules/paragraph-restatement.yaml +1 -1
- package/rules/party-role-name.yaml +3 -3
- package/rules/percent-sum-mismatch.yaml +2 -2
- package/rules/period-label-conflict.yaml +68 -0
- package/rules/period-multiple-mismatch.yaml +61 -0
- package/rules/period-part-exceeds-whole.yaml +62 -0
- package/rules/person-consistency.yaml +1 -1
- package/rules/phone-number-variant.yaml +3 -3
- package/rules/preamble-length.yaml +2 -2
- package/rules/preferred-term.yaml +2 -2
- package/rules/prerequisite-after-step.yaml +1 -1
- package/rules/product-exceeds-maximum.yaml +49 -0
- package/rules/proper-noun-density.yaml +1 -1
- package/rules/quantity-range-reversed.yaml +53 -0
- package/rules/range-band-mismatch.yaml +70 -0
- package/rules/ratio-mismatch.yaml +64 -0
- package/rules/reference-flag-mismatch.yaml +74 -0
- package/rules/reference-number-repeated.yaml +63 -0
- package/rules/reference-number-variant.yaml +81 -0
- package/rules/reference-title-mismatch.yaml +1 -1
- package/rules/reference-topic-missing.yaml +1 -1
- package/rules/reference-unit-mismatch.yaml +62 -0
- package/rules/relative-date-mismatch.yaml +1 -1
- package/rules/rent-multiple-mismatch.yaml +61 -0
- package/rules/request-without-deadline.yaml +3 -3
- package/rules/required-listed-as-preferred.yaml +1 -1
- package/rules/required-sections.yaml +2 -2
- package/rules/requirement-modal.yaml +2 -2
- package/rules/requirement-smell.yaml +1 -1
- package/rules/revision-direction-mismatch.yaml +66 -0
- package/rules/risk-disclosure.yaml +1 -1
- package/rules/running-balance-mismatch.yaml +59 -0
- package/rules/scaled-quantity-mismatch.yaml +69 -0
- package/rules/serial-range-reversed.yaml +52 -0
- package/rules/share-amount-mismatch.yaml +58 -0
- package/rules/share-over-hundred.yaml +1 -1
- package/rules/shell-prompt-mix.yaml +1 -1
- package/rules/space-before-punctuation.yaml +1 -1
- package/rules/spelling-consistency.yaml +1 -1
- package/rules/step-statement-mix.yaml +3 -3
- package/rules/step-time-sum-mismatch.yaml +65 -0
- package/rules/stock-transition.yaml +1 -1
- package/rules/summary-fact-mismatch.yaml +1 -1
- package/rules/table-header-variant.yaml +1 -1
- package/rules/table-unit-mix.yaml +82 -0
- package/rules/taigen-dome-in-prose.yaml +1 -1
- package/rules/tax-mismatch.yaml +13 -7
- package/rules/tier-threshold-mismatch.yaml +73 -0
- package/rules/time-order.yaml +7 -4
- package/rules/time-range-reversed.yaml +53 -0
- package/rules/title-case-consistency.yaml +2 -2
- package/rules/toc-heading-mismatch.yaml +1 -1
- package/rules/topic-predicate-distance.yaml +1 -1
- package/rules/total-mismatch.yaml +5 -5
- package/rules/ui-label-variant.yaml +1 -1
- package/rules/unclosed-code-fence.yaml +1 -1
- package/rules/uncomparable-graded.yaml +2 -2
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +2 -2
- package/rules/unit-mismatch.yaml +13 -5
- package/rules/unit-spacing-consistency.yaml +1 -1
- package/rules/unknown-word.yaml +1 -1
- package/rules/unlisted-item-used.yaml +90 -0
- package/rules/unused-definition.yaml +2 -2
- package/rules/url-run-on.yaml +1 -1
- package/rules/use-before-definition.yaml +2 -2
- package/rules/vague-deadline.yaml +1 -1
- package/rules/vague-figure-reference.yaml +1 -1
- package/rules/vague-word-density.yaml +2 -2
- package/rules/variance-mismatch.yaml +67 -0
- package/rules/very-adjective.yaml +1 -1
- package/rules/walk-time-distance-mismatch.yaml +55 -0
- package/rules/warning-without-action.yaml +1 -1
- package/rules/weasel-word.yaml +2 -2
- package/rules/wordy-phrase.yaml +2 -2
- package/rules/yori-as-from.yaml +1 -1
- package/skills/chaff/SKILL.md +59 -9
- package/src/announced-count.ts +6 -3
- package/src/company-kana-spelling.ts +105 -0
- package/src/company-names.ts +159 -26
- package/src/contacts/addresses.ts +179 -0
- package/src/contacts/emails.ts +63 -0
- package/src/contacts/table-rows.ts +51 -0
- package/src/contacts/variants.ts +33 -0
- package/src/derived/age-on-date.ts +161 -0
- package/src/derived/battery-runtime.ts +284 -0
- package/src/derived/durations.ts +83 -12
- package/src/derived/hours-and-minutes.ts +41 -0
- package/src/derived/hyphenated-counts.ts +38 -0
- package/src/derived/marked-dates.ts +61 -0
- package/src/derived/money-span.ts +10 -0
- package/src/derived/period-counts.ts +178 -0
- package/src/derived/period-parts.ts +360 -0
- package/src/derived/readable-date.ts +63 -0
- package/src/derived/stays.ts +7 -2
- package/src/derived/time-lengths.ts +12 -9
- package/src/derived/timesheet-hours.ts +112 -0
- package/src/derived/use-interval.ts +151 -0
- package/src/derived/use-maximum.ts +158 -0
- package/src/derived/working-hours.ts +2 -2
- package/src/detectors/announced-count.ts +1 -0
- package/src/detectors/annual-holidays-mismatch.ts +41 -0
- package/src/detectors/annual-pay-mismatch.ts +71 -0
- package/src/detectors/blank-structure.ts +54 -14
- package/src/detectors/bmi-mismatch.ts +82 -0
- package/src/detectors/capacity-runtime.ts +128 -0
- package/src/detectors/change-rate.ts +27 -4
- package/src/detectors/closing-balance-mismatch.ts +52 -0
- package/src/detectors/contact-variant.ts +30 -0
- package/src/detectors/count-over-capacity.ts +37 -0
- package/src/detectors/cumulative-below-current.ts +30 -0
- package/src/detectors/currency-column.ts +37 -0
- package/src/detectors/date-any-year.ts +130 -0
- package/src/detectors/date-outside-period.ts +5 -10
- package/src/detectors/date-stamp-order.ts +29 -0
- package/src/detectors/date-year.ts +55 -13
- package/src/detectors/deductible-exceeds-limit.ts +55 -0
- package/src/detectors/defined-term-form.ts +48 -9
- package/src/detectors/definition-use.ts +6 -2
- package/src/detectors/derived-numbers.ts +52 -91
- package/src/detectors/discount-rate.ts +41 -0
- package/src/detectors/due-date.ts +28 -6
- package/src/detectors/email-letter.ts +45 -15
- package/src/detectors/en-shape.ts +11 -4
- package/src/detectors/event-deadline.ts +39 -0
- package/src/detectors/fact-consistency.ts +206 -7
- package/src/detectors/gloss-year.ts +21 -0
- package/src/detectors/gpa-mismatch.ts +43 -0
- package/src/detectors/heading-case.ts +13 -4
- package/src/detectors/heading-echo.ts +17 -1
- package/src/detectors/impossible-date.ts +25 -3
- package/src/detectors/installment-total-mismatch.ts +68 -0
- package/src/detectors/interest.ts +43 -0
- package/src/detectors/lab-columns.ts +9 -0
- package/src/detectors/labelled-age.ts +154 -0
- package/src/detectors/layout-code.ts +174 -0
- package/src/detectors/line-amount.ts +58 -3
- package/src/detectors/measured-facts.ts +20 -0
- package/src/detectors/meter-usage.ts +49 -0
- package/src/detectors/name-field.ts +43 -0
- package/src/detectors/name-variant-model-codes.ts +27 -0
- package/src/detectors/name-variant.ts +190 -20
- package/src/detectors/net-amount-mismatch.ts +86 -0
- package/src/detectors/net-gross-weight.ts +39 -0
- package/src/detectors/nominal-step.ts +35 -0
- package/src/detectors/number-style.ts +11 -2
- package/src/detectors/order-quantity.ts +46 -0
- package/src/detectors/orthographic-variant.ts +118 -19
- package/src/detectors/orthography.ts +34 -8
- package/src/detectors/period-label-conflict.ts +43 -0
- package/src/detectors/period-multiple-mismatch.ts +54 -0
- package/src/detectors/period-part.ts +71 -0
- package/src/detectors/quantity-range.ts +47 -0
- package/src/detectors/range-band.ts +125 -0
- package/src/detectors/range-words.ts +17 -0
- package/src/detectors/ratio-mismatch.ts +116 -0
- package/src/detectors/readable-dates.ts +36 -0
- package/src/detectors/reference-flag.ts +36 -0
- package/src/detectors/reference-number-repeated.ts +25 -0
- package/src/detectors/reference-number-variant.ts +44 -0
- package/src/detectors/reference-unit.ts +24 -0
- package/src/detectors/registry/annual-holidays-mismatch.ts +4 -0
- package/src/detectors/registry/annual-pay-mismatch.ts +4 -0
- package/src/detectors/registry/backorder-mismatch.ts +4 -0
- package/src/detectors/registry/bmi-mismatch.ts +4 -0
- package/src/detectors/registry/capacity-runtime-mismatch.ts +4 -0
- package/src/detectors/registry/closing-balance-mismatch.ts +4 -0
- package/src/detectors/registry/contact-variant.ts +4 -0
- package/src/detectors/registry/count-over-capacity.ts +4 -0
- package/src/detectors/registry/cumulative-below-current.ts +4 -0
- package/src/detectors/registry/currency-column-mix.ts +4 -0
- package/src/detectors/registry/date-stamp-order.ts +4 -0
- package/src/detectors/registry/deductible-exceeds-limit.ts +4 -0
- package/src/detectors/registry/delivered-over-ordered.ts +4 -0
- package/src/detectors/registry/discount-rate.ts +4 -0
- package/src/detectors/registry/elapsed-years-mismatch.ts +1 -1
- package/src/detectors/registry/event-deadline.ts +4 -0
- package/src/detectors/registry/gpa-mismatch.ts +4 -0
- package/src/detectors/registry/installment-total-mismatch.ts +4 -0
- package/src/detectors/registry/interest.ts +4 -0
- package/src/detectors/registry/interval-count-mismatch.ts +4 -0
- package/src/detectors/registry/layout-code-mismatch.ts +4 -0
- package/src/detectors/registry/meter-usage.ts +4 -0
- package/src/detectors/registry/net-amount-mismatch.ts +4 -0
- package/src/detectors/registry/net-over-gross.ts +4 -0
- package/src/detectors/registry/period-label-conflict.ts +4 -0
- package/src/detectors/registry/period-multiple-mismatch.ts +4 -0
- package/src/detectors/registry/period-part-exceeds-whole.ts +4 -0
- package/src/detectors/registry/product-exceeds-maximum.ts +4 -0
- package/src/detectors/registry/quantity-range.ts +4 -0
- package/src/detectors/registry/range-band-mismatch.ts +4 -0
- package/src/detectors/registry/ratio-mismatch.ts +4 -0
- package/src/detectors/registry/reference-flag-mismatch.ts +4 -0
- package/src/detectors/registry/reference-number-repeated.ts +4 -0
- package/src/detectors/registry/reference-number-variant.ts +4 -0
- package/src/detectors/registry/reference-unit.ts +4 -0
- package/src/detectors/registry/rent-multiple-mismatch.ts +4 -0
- package/src/detectors/registry/revision-direction.ts +4 -0
- package/src/detectors/registry/running-balance.ts +4 -0
- package/src/detectors/registry/scaled-quantity-mismatch.ts +4 -0
- package/src/detectors/registry/serial-range.ts +4 -0
- package/src/detectors/registry/share-amount.ts +4 -0
- package/src/detectors/registry/step-time-sum-mismatch.ts +4 -0
- package/src/detectors/registry/table-unit-mix.ts +4 -0
- package/src/detectors/registry/tier-threshold.ts +4 -0
- package/src/detectors/registry/time-range-reversed.ts +4 -0
- package/src/detectors/registry/unlisted-item-used.ts +4 -0
- package/src/detectors/registry/variance-mismatch.ts +4 -0
- package/src/detectors/registry/walk-time-distance-mismatch.ts +4 -0
- package/src/detectors/relative-dates.ts +2 -1
- package/src/detectors/relative-day-words.ts +2 -1
- package/src/detectors/rent-multiple-mismatch.ts +57 -0
- package/src/detectors/request-owner.ts +5 -2
- package/src/detectors/revision-direction.ts +44 -0
- package/src/detectors/row-sentence-amounts.ts +96 -0
- package/src/detectors/running-balance.ts +31 -0
- package/src/detectors/scaled-quantity.ts +49 -0
- package/src/detectors/serial-range.ts +37 -0
- package/src/detectors/share-amount.ts +51 -0
- package/src/detectors/signals.ts +3 -1
- package/src/detectors/step-time-sum.ts +55 -0
- package/src/detectors/structure-tree.ts +82 -9
- package/src/detectors/structure.ts +1 -1
- package/src/detectors/table-scale.ts +37 -0
- package/src/detectors/tax-amount.ts +45 -13
- package/src/detectors/technical-docs.ts +16 -2
- package/src/detectors/tier-threshold.ts +108 -0
- package/src/detectors/time-order.ts +55 -17
- package/src/detectors/unit-consistency.ts +50 -38
- package/src/detectors/unlisted-items.ts +72 -0
- package/src/detectors/use-count-words.ts +32 -0
- package/src/detectors/use-interval.ts +51 -0
- package/src/detectors/use-maximum.ts +38 -0
- package/src/detectors/variance.ts +33 -0
- package/src/detectors/walk-time-distance-mismatch.ts +45 -0
- package/src/detectors/whole-count-findings.ts +48 -0
- package/src/detectors/working-hours-findings.ts +100 -0
- package/src/facts/age-values.ts +124 -0
- package/src/facts/approximate-tolerance.ts +19 -0
- package/src/facts/cell-keys.ts +21 -0
- package/src/facts/count-labels.ts +28 -0
- package/src/facts/document-terms.ts +107 -0
- package/src/facts/duration-scale.ts +22 -0
- package/src/facts/duration-values.ts +44 -0
- package/src/facts/fact-values.ts +36 -7
- package/src/facts/item-amounts.ts +94 -0
- package/src/facts/labelled-facts.ts +92 -13
- package/src/facts/measure-units.ts +49 -0
- package/src/facts/measures.ts +114 -26
- package/src/facts/qualified-labels.ts +126 -0
- package/src/facts/rate-values.ts +117 -0
- package/src/facts/retention-periods.ts +216 -0
- package/src/facts/row-sentence-amounts.ts +113 -0
- package/src/facts/superscript-power.ts +5 -0
- package/src/facts/table-facts.ts +35 -7
- package/src/facts/term-values.ts +236 -0
- package/src/facts/unit-conflicts.ts +22 -9
- package/src/facts/unit-equivalents.ts +70 -0
- package/src/facts/unit-tolerance.ts +17 -0
- package/src/facts/unit-word.ts +48 -0
- package/src/facts/verb-quantity-facts.ts +84 -0
- package/src/facts/whole-counts.ts +183 -0
- package/src/facts/written-precision.ts +23 -0
- package/src/kana-spelling.ts +25 -0
- package/src/model-codes.ts +104 -0
- package/src/name-char-reading.ts +24 -0
- package/src/name-line-block.ts +40 -0
- package/src/name-lookalike-chars.ts +53 -0
- package/src/name-neighbours.ts +58 -0
- package/src/name-ordinary-word.ts +68 -0
- package/src/name-person.ts +31 -0
- package/src/name-separator.ts +48 -0
- package/src/name-spelling-chars.ts +34 -0
- package/src/name-variants.ts +49 -92
- package/src/name-weight.ts +12 -0
- package/src/person-field.ts +43 -0
- package/src/person-full-name.ts +70 -0
- package/src/phone-numbers.ts +76 -20
- package/src/place-names.ts +53 -14
- package/src/plugin.ts +4 -0
- package/src/preamble-paragraphs.ts +21 -2
- package/src/product-names.ts +98 -0
- package/src/profile/parse.ts +10 -0
- package/src/reference-numbers.ts +55 -0
- package/src/spaced-person-name.ts +97 -0
- package/src/spacing-code.ts +47 -0
- package/src/structure/amount-range.ts +16 -7
- package/src/structure/annual-holidays.ts +222 -0
- package/src/structure/annual-pay.ts +339 -0
- package/src/structure/bmi.ts +133 -0
- package/src/structure/capacity-count.ts +196 -0
- package/src/structure/change-rate-table.ts +135 -0
- package/src/structure/change-rate.ts +54 -17
- package/src/structure/closing-balance.ts +104 -0
- package/src/structure/column-date-order.ts +73 -0
- package/src/structure/compound-hours.ts +49 -0
- package/src/structure/counted-amounts.ts +5 -4
- package/src/structure/cumulative-below-current.ts +66 -0
- package/src/structure/currency-column.ts +97 -0
- package/src/structure/date-deadline-mark.ts +30 -0
- package/src/structure/date-outside-period.ts +28 -15
- package/src/structure/date-range.ts +7 -10
- package/src/structure/deadline-after-event.ts +184 -0
- package/src/structure/deductible-limit.ts +255 -0
- package/src/structure/definition-use.ts +59 -2
- package/src/structure/discount-rate.ts +209 -0
- package/src/structure/due-date.ts +8 -32
- package/src/structure/generic-role.ts +8 -0
- package/src/structure/gpa.ts +218 -0
- package/src/structure/installment-total.ts +343 -0
- package/src/structure/interest.ts +133 -0
- package/src/structure/key-value-row.ts +45 -0
- package/src/structure/lab-columns.ts +21 -0
- package/src/structure/labelled-date-order.ts +100 -0
- package/src/structure/labelled-order.ts +122 -0
- package/src/structure/labelled-time-order.ts +100 -0
- package/src/structure/layout-codes.ts +210 -0
- package/src/structure/line-amount-label.ts +100 -0
- package/src/structure/line-amount-rate.ts +178 -0
- package/src/structure/line-amount-unit.ts +16 -0
- package/src/structure/line-amount.ts +200 -48
- package/src/structure/measured-amounts.ts +138 -0
- package/src/structure/meter-usage-read.ts +139 -0
- package/src/structure/meter-usage.ts +224 -0
- package/src/structure/net-amount.ts +243 -0
- package/src/structure/net-gross-weight.ts +97 -0
- package/src/structure/order-quantity.ts +125 -0
- package/src/structure/party-role.ts +4 -1
- package/src/structure/percent-sum.ts +3 -0
- package/src/structure/period-label-conflict.ts +174 -0
- package/src/structure/period-labels.ts +147 -0
- package/src/structure/period-multiple.ts +186 -0
- package/src/structure/quantity-range.ts +47 -0
- package/src/structure/range-bands.ts +316 -0
- package/src/structure/range-years.ts +75 -0
- package/src/structure/ratio.ts +296 -0
- package/src/structure/reference-flags.ts +156 -0
- package/src/structure/reference-number-repeated.ts +57 -0
- package/src/structure/reference-unit.ts +105 -0
- package/src/structure/rent-multiple.ts +207 -0
- package/src/structure/revision-direction.ts +214 -0
- package/src/structure/running-balance.ts +157 -0
- package/src/structure/scaled-quantities.ts +239 -0
- package/src/structure/serial-range.ts +52 -0
- package/src/structure/share-amount.ts +206 -0
- package/src/structure/shift-times.ts +136 -0
- package/src/structure/span-label.ts +26 -0
- package/src/structure/stamp-order.ts +100 -0
- package/src/structure/stated-multiple.ts +82 -0
- package/src/structure/stated-period.ts +23 -11
- package/src/structure/step-times.ts +169 -0
- package/src/structure/table-scale.ts +239 -0
- package/src/structure/tax-price.ts +136 -0
- package/src/structure/tax.ts +55 -20
- package/src/structure/term-deadline.ts +35 -0
- package/src/structure/tier-threshold.ts +218 -0
- package/src/structure/time-range.ts +70 -0
- package/src/structure/total-line.ts +232 -0
- package/src/structure/total-row-blank.ts +23 -0
- package/src/structure/total.ts +156 -12
- package/src/structure/unlisted-items.ts +207 -0
- package/src/structure/variance-table.ts +167 -0
- package/src/structure/walk-time.ts +285 -0
- package/src/table-names.ts +6 -6
- package/src/unlabelled-references.ts +83 -0
- package/src/vehicle-plates.ts +142 -0
- package/src/whole-word-runs.ts +38 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { CompanyMention } from "./company-names.ts";
|
|
2
|
+
import { toKatakana } from "./kana-spelling.ts";
|
|
3
|
+
import { escapeRegExp } from "./orthography.ts";
|
|
4
|
+
|
|
5
|
+
// 会社の名前の漢字一字を、その読みのかなで書いた所(みどり野生命保険株式会社 と みどりの生命保険株式会社)。読みは品詞解析が言う。
|
|
6
|
+
|
|
7
|
+
/** 名前の中の語。start と end は source の上の位置。reading はカタカナ。 */
|
|
8
|
+
export type ReadWord = { readonly start: number; readonly end: number; readonly surface: string; readonly reading: string | undefined };
|
|
9
|
+
|
|
10
|
+
/** 漢字の名前を、かなで書いた所。usual は多いほうの書き方。 */
|
|
11
|
+
export type KanaSpelled = { readonly surface: string; readonly offset: number; readonly usual: string };
|
|
12
|
+
|
|
13
|
+
const HAN = /^\p{Script=Han}$/u;
|
|
14
|
+
const KANA = /^[\p{Script=Hiragana}\p{Script=Katakana}ー]$/u;
|
|
15
|
+
const KATAKANA = /[ァ-ヶ]/gu;
|
|
16
|
+
const KATAKANA_TO_HIRAGANA = 0x60;
|
|
17
|
+
/** かなで書いた所の外側に続くと、名前の続き(別の名前)になる字。 */
|
|
18
|
+
const NAME_CHAR = /[\p{Script=Katakana}\p{Script=Han}\p{Script=Latin}\p{N}ー]/u;
|
|
19
|
+
/** 多いほうの書き方の数。一度だけの名前は、どちらが正しいとも言えない。 */
|
|
20
|
+
const MIN_USUAL_COUNT = 2;
|
|
21
|
+
|
|
22
|
+
const toHiragana = (text: string): string => text.replace(KATAKANA, (char) => String.fromCodePoint((char.codePointAt(0) ?? 0) - KATAKANA_TO_HIRAGANA));
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* かなと漢字一字の語(みどり野 ミドリノ、野 ノ)の、漢字の読みと、語の中の位置(UTF-16 の単位)。かなの部分が読みの頭と終わりに
|
|
26
|
+
* 合い、残りがあるときだけ。漢字二字以上の語(生命 セイメイ)は、どの字がどの音か分からないので読まない。
|
|
27
|
+
*/
|
|
28
|
+
export const kanjiReadingOf = (
|
|
29
|
+
surface: string,
|
|
30
|
+
reading: string | undefined,
|
|
31
|
+
): { readonly index: number; readonly kanji: string; readonly reading: string } | undefined => {
|
|
32
|
+
const chars = [...surface];
|
|
33
|
+
const at = chars.findIndex((char) => HAN.test(char));
|
|
34
|
+
const kanji = chars[at];
|
|
35
|
+
if (reading === undefined || kanji === undefined || !chars.every((char, index) => index === at || KANA.test(char))) return undefined;
|
|
36
|
+
const [head, tail] = [toKatakana(chars.slice(0, at).join("")), toKatakana(chars.slice(at + 1).join(""))];
|
|
37
|
+
const read = toKatakana(reading);
|
|
38
|
+
if (read.length <= head.length + tail.length || !read.startsWith(head) || !read.endsWith(tail)) return undefined;
|
|
39
|
+
return { index: chars.slice(0, at).join("").length, kanji, reading: read.slice(head.length, read.length - tail.length) };
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const baseStartOf = (mention: CompanyMention): number =>
|
|
43
|
+
mention.position === "after" ? mention.offset : mention.offset + mention.surface.length - mention.base.length;
|
|
44
|
+
|
|
45
|
+
/** 会社の名前の、漢字一字をその読みのひらがなかカタカナで書いた形(みどりの生命保険株式会社、みどりノ生命保険株式会社)。 */
|
|
46
|
+
export const kanaSpellingsOf = (mention: CompanyMention, words: readonly ReadWord[]): string[] => {
|
|
47
|
+
const baseStart = baseStartOf(mention);
|
|
48
|
+
const baseEnd = baseStart + mention.base.length;
|
|
49
|
+
return words
|
|
50
|
+
.filter((word) => word.start >= baseStart && word.end <= baseEnd)
|
|
51
|
+
.flatMap((word) => {
|
|
52
|
+
const read = kanjiReadingOf(word.surface, word.reading);
|
|
53
|
+
if (read === undefined) return [];
|
|
54
|
+
const at = word.start - mention.offset + read.index;
|
|
55
|
+
const [before, after] = [mention.surface.slice(0, at), mention.surface.slice(at + read.kanji.length)];
|
|
56
|
+
return [toHiragana(read.reading), read.reading].map((kana) => `${before}${kana}${after}`);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const HIRAGANA = /^\p{Script=Hiragana}$/u;
|
|
61
|
+
const HIRAGANA_AFTER = /^\p{Script=Hiragana}+/u;
|
|
62
|
+
/** 助詞を探す、前のひらがなの字数。語彙表の一番長い助詞より長い。 */
|
|
63
|
+
const PARTICLE_LOOKBACK = 10;
|
|
64
|
+
|
|
65
|
+
const hiraganaBefore = (source: string, at: number): string => {
|
|
66
|
+
const chars = Array.from(source.slice(Math.max(0, at - PARTICLE_LOOKBACK), at));
|
|
67
|
+
return chars.slice(chars.findLastIndex((char) => !HIRAGANA.test(char)) + 1).join("");
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 名前の側に名前の字が続かない現れ。続けば、別の長い名前の一部(あおいみどりの生命保険)。ひらがなが続くときは、助詞(当社は、
|
|
72
|
+
* と、における)で切れるときだけ名前の外と見る。particles は語彙表 company-name-kana の particle。
|
|
73
|
+
*/
|
|
74
|
+
const standsAlone = (source: string, at: number, length: number, position: CompanyMention["position"], particles: readonly string[]): boolean => {
|
|
75
|
+
const neighbour = position === "after" ? source.charAt(at - 1) : source.charAt(at + length);
|
|
76
|
+
if (NAME_CHAR.test(neighbour)) return false;
|
|
77
|
+
const kana = position === "after" ? hiraganaBefore(source, at) : (HIRAGANA_AFTER.exec(source.slice(at + length))?.[0] ?? "");
|
|
78
|
+
if (kana === "") return true;
|
|
79
|
+
return particles.some((particle) => (position === "after" ? kana.endsWith(particle) : kana.startsWith(particle)));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const occurrencesOf = (source: string, text: string): number[] => [...source.matchAll(new RegExp(escapeRegExp(text), "gu"))].map((match) => match.index);
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 二度以上書いた会社の名前の漢字一字を、その読みのかなで書いた所が一度だけある所。名前のほかの所はそのまま同じもの。
|
|
86
|
+
* 語の読みは words が言う(品詞解析の語)。前後のひらがなを切る助詞は particles。
|
|
87
|
+
*/
|
|
88
|
+
export const kanaSpelledCompanies = (
|
|
89
|
+
source: string,
|
|
90
|
+
mentions: readonly CompanyMention[],
|
|
91
|
+
words: readonly ReadWord[],
|
|
92
|
+
particles: readonly string[],
|
|
93
|
+
): KanaSpelled[] => {
|
|
94
|
+
const counts = new Map<string, number>();
|
|
95
|
+
mentions.forEach((mention) => counts.set(mention.surface, (counts.get(mention.surface) ?? 0) + 1));
|
|
96
|
+
const usuals = mentions.filter(
|
|
97
|
+
(mention, index) => (counts.get(mention.surface) ?? 0) >= MIN_USUAL_COUNT && mentions.findIndex((other) => other.surface === mention.surface) === index,
|
|
98
|
+
);
|
|
99
|
+
return usuals.flatMap((usual) =>
|
|
100
|
+
[...new Set(kanaSpellingsOf(usual, words))].flatMap((spelled) => {
|
|
101
|
+
const found = occurrencesOf(source, spelled).filter((at) => standsAlone(source, at, spelled.length, usual.position, particles));
|
|
102
|
+
return found.length === 1 && found[0] !== undefined ? [{ surface: spelled, offset: found[0], usual: usual.surface }] : [];
|
|
103
|
+
}),
|
|
104
|
+
);
|
|
105
|
+
};
|
package/src/company-names.ts
CHANGED
|
@@ -5,7 +5,16 @@ import { escapeRegExp } from "./orthography.ts";
|
|
|
5
5
|
// 会社の形の語(株式会社、Inc)は語彙表 company-form が言う。group が同じ語は同じ形(Inc と Incorporated、株式会社 と (株))、
|
|
6
6
|
// position は名前のどちら側に立つか(無ければどちらにも立つ)。名前の部分は、形の語のすぐ隣の、名前に使う字の連なり。
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* foreign は、カタカナか英字の名前のすぐ後ろにだけ立つ形の語(サウスベイ・インポート社 の 社)。漢字の語の中(会社、本社)では形の語でない。
|
|
10
|
+
* words はこの語で始まる語(社員、社長)で、そこでは形の語と読まない。
|
|
11
|
+
*/
|
|
12
|
+
export type CompanyForm = {
|
|
13
|
+
readonly pattern: string;
|
|
14
|
+
readonly group: string;
|
|
15
|
+
readonly position?: "before" | "after" | undefined;
|
|
16
|
+
readonly foreign?: { readonly words: readonly string[] } | undefined;
|
|
17
|
+
};
|
|
9
18
|
|
|
10
19
|
/** surface は形の語も含めた書いたまま。base は名前の部分、form は形の組、position は形の語が名前のどちら側にあるか。 */
|
|
11
20
|
export type CompanyMention = {
|
|
@@ -14,6 +23,8 @@ export type CompanyMention = {
|
|
|
14
23
|
readonly base: string;
|
|
15
24
|
readonly form: string;
|
|
16
25
|
readonly position: "before" | "after";
|
|
26
|
+
/** カタカナか英字の名前のすぐ後ろにだけ立つ形の語(社)で書いたもの。 */
|
|
27
|
+
readonly foreign?: boolean | undefined;
|
|
17
28
|
};
|
|
18
29
|
|
|
19
30
|
/** 二つの書き方の違い。spelling は記号・幅・大小だけ、form は会社の形、position は形の語の側、near は名前の一字違い。 */
|
|
@@ -26,7 +37,7 @@ export type IsProper = (start: number, end: number) => boolean;
|
|
|
26
37
|
|
|
27
38
|
const LATIN = /\p{Script=Latin}/u;
|
|
28
39
|
const LETTER = /\p{L}/u;
|
|
29
|
-
/**
|
|
40
|
+
/** 漢字・かなの名前に使う字。ひらがなは名前の頭にだけ立つ(kanaHeadOf)。 */
|
|
30
41
|
const CJK_NAME = /[\p{Script=Katakana}\p{Script=Han}\p{Script=Latin}\p{N}ー・&&]/u;
|
|
31
42
|
const NOT_HAN_LETTER = /(?!\p{Script=Han})\p{L}/u;
|
|
32
43
|
/** 英字の名前の一語。大文字か数字で始まる。 */
|
|
@@ -65,17 +76,69 @@ const CJK_BEFORE = new RegExp(`${CJK_NAME.source}+$`, "u");
|
|
|
65
76
|
const CJK_AFTER = new RegExp(`^${CJK_NAME.source}+`, "u");
|
|
66
77
|
const SPACES: ReadonlySet<string> = new Set([" ", "\u3000"]);
|
|
67
78
|
|
|
79
|
+
/**
|
|
80
|
+
* 名前の頭のひらがなを切り分ける語(語彙表 company-name-kana)。particles は前の語に続けて書く語(は、と、における)、openers は
|
|
81
|
+
* 句読点や行の頭に立つ語(また、なお)、ends は名前の頭の終わりに来ない字(の、る、て)。
|
|
82
|
+
*/
|
|
83
|
+
export type KanaStops = { readonly particles: readonly string[]; readonly openers: readonly string[]; readonly ends: readonly string[] };
|
|
84
|
+
|
|
85
|
+
/** ひらがなの前に何があるか。word は語や閉じ括弧(当社はこもれび、)により)、form は会社の形の語(株式会社こもれび)、boundary は句読点や行の頭。 */
|
|
86
|
+
export type KanaLead = "word" | "form" | "boundary";
|
|
87
|
+
|
|
88
|
+
const MIN_KANA_HEAD_LENGTH = 2;
|
|
89
|
+
|
|
90
|
+
const longestPrefix = (text: string, words: readonly string[]): string | undefined =>
|
|
91
|
+
words.filter((word) => text.startsWith(word)).toSorted((left, right) => right.length - left.length)[0];
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 漢字やカタカナの名前のすぐ前のひらがなのうち、名前の頭と読む所(はこもれび の こもれび)。語のすぐ後ろなら助詞で始まるときだけ、
|
|
95
|
+
* その後ろを読む。形の語のすぐ後ろなら助詞で始まらないときだけ。二字以上で、句読点の後に立つ語で始まらず、助詞や動詞の終わりの字で終わらないもの。
|
|
96
|
+
* 語彙表が無ければ(英語の文書)ひらがなは名前に入れない。
|
|
97
|
+
*/
|
|
98
|
+
export const kanaHeadOf = (kana: string, lead: KanaLead, stops: KanaStops): string | undefined => {
|
|
99
|
+
if (stops.particles.length === 0) return undefined;
|
|
100
|
+
const particle = longestPrefix(kana, stops.particles);
|
|
101
|
+
if ((lead === "word" && particle === undefined) || (lead === "form" && particle !== undefined)) return undefined;
|
|
102
|
+
const head = lead === "word" ? kana.slice(particle?.length ?? 0) : kana;
|
|
103
|
+
if ([...head].length < MIN_KANA_HEAD_LENGTH || longestPrefix(head, stops.openers) !== undefined) return undefined;
|
|
104
|
+
return stops.ends.some((end) => head.endsWith(end)) ? undefined : head;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/** ひらがなをその前の語に続けて読む字。閉じ括弧や数字の後ろのひらがなも助詞()により、第3条の)。 */
|
|
108
|
+
const GLUED = /[\p{L}\p{N}\p{Pe}\p{Pf}]/u;
|
|
109
|
+
const HIRAGANA = /\p{Script=Hiragana}/u;
|
|
110
|
+
const KANA_AFTER = /^\p{Script=Hiragana}+/u;
|
|
111
|
+
|
|
112
|
+
/** end の前に続くひらがなの始まり。 */
|
|
113
|
+
const kanaRunStart = (source: string, end: number): number => {
|
|
114
|
+
let start = end;
|
|
115
|
+
while (start > 0 && HIRAGANA.test(source.charAt(start - 1))) start -= 1;
|
|
116
|
+
return start;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/** 名前の前に続くひらがなのうち、名前の頭と読む所を足した始まり。 */
|
|
120
|
+
const withKanaHead = (source: string, start: number, stops: KanaStops): number => {
|
|
121
|
+
const kanaStart = kanaRunStart(source, start);
|
|
122
|
+
if (kanaStart === start) return start;
|
|
123
|
+
const lead = GLUED.test(source.charAt(kanaStart - 1)) ? "word" : "boundary";
|
|
124
|
+
return start - (kanaHeadOf(source.slice(kanaStart, start), lead, stops)?.length ?? 0);
|
|
125
|
+
};
|
|
126
|
+
|
|
68
127
|
/** 漢字・かなの名前: 形の語の隣の、名前に使う字の続き。形の語との間の空白一つは名前の外。 */
|
|
69
|
-
const cjkBaseBefore = (source: string, end: number): Span | undefined => {
|
|
128
|
+
const cjkBaseBefore = (source: string, end: number, stops: KanaStops): Span | undefined => {
|
|
70
129
|
const stop = SPACES.has(source.charAt(end - 1)) ? end - 1 : end;
|
|
71
130
|
const match = CJK_BEFORE.exec(source.slice(0, stop));
|
|
72
|
-
return match === null ? undefined : { start: match.index, end: stop };
|
|
131
|
+
return match === null ? undefined : { start: withKanaHead(source, match.index, stops), end: stop };
|
|
73
132
|
};
|
|
74
133
|
|
|
75
|
-
|
|
134
|
+
/** 形の語の後ろの名前。ひらがなで始まる名前(株式会社こもれび珈琲)は、ひらがなの後ろに名前に使う字が続くときだけ。 */
|
|
135
|
+
const cjkBaseAfter = (source: string, start: number, stops: KanaStops): Span | undefined => {
|
|
76
136
|
const from = SPACES.has(source.charAt(start)) ? start + 1 : start;
|
|
77
|
-
const
|
|
78
|
-
|
|
137
|
+
const kana = KANA_AFTER.exec(source.slice(from))?.[0] ?? "";
|
|
138
|
+
const head = kana === "" ? "" : kanaHeadOf(kana, "form", stops);
|
|
139
|
+
if (head === undefined) return undefined;
|
|
140
|
+
const match = CJK_AFTER.exec(source.slice(from + head.length));
|
|
141
|
+
return match === null ? undefined : { start: from, end: from + head.length + match[0].length };
|
|
79
142
|
};
|
|
80
143
|
|
|
81
144
|
/** 名前の部分の字数。一字(法令の項目の印 イ、ロ)は名前と読まない。 */
|
|
@@ -94,22 +157,50 @@ const mentionOf = (source: string, base: Span, form: Span, group: string): Compa
|
|
|
94
157
|
return { surface: source.slice(start, end), offset: start, base: source.slice(base.start, base.end), form: group, position };
|
|
95
158
|
};
|
|
96
159
|
|
|
97
|
-
|
|
98
|
-
|
|
160
|
+
/** カタカナか英字の名前の字。英字の語の間の空白一つも名前の内。 */
|
|
161
|
+
const FOREIGN_CHAR = /[\p{Script=Katakana}\p{Script=Latin}\p{N}ー・&&'’.\- ]/u;
|
|
162
|
+
/** 形の語のすぐ前の字。カタカナ・長音の印・英字のときだけ、形の語と読む(会社、本社、神社の 社 は読まない)。 */
|
|
163
|
+
const FOREIGN_END = /(?:[\p{Script=Katakana}ー\p{Script=Latin}]|\p{Script=Latin}\.)$/u;
|
|
164
|
+
/** 名前の頭に立たない字(空白、記号、数字だけの頭はそのまま残す)。 */
|
|
165
|
+
const FOREIGN_LEAD = /^[\s・&&'’.-]+/u;
|
|
166
|
+
/** カタカナの語に一字の記号を付けた仮の名前(ベンダーA、メーカーB)。名前ではないので、A と B を一字違いと見ない。 */
|
|
167
|
+
const PLACEHOLDER = /[\p{Script=Katakana}ー]\s?[\p{Lu}\p{N}]$/u;
|
|
168
|
+
|
|
169
|
+
/** text の終わりに続く、カタカナか英字の名前の字の始まり。 */
|
|
170
|
+
const foreignRunStart = (text: string): number => {
|
|
171
|
+
let start = text.length;
|
|
172
|
+
while (start > 0 && FOREIGN_CHAR.test(text.charAt(start - 1))) start -= 1;
|
|
173
|
+
return start;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/** カタカナか英字の名前のすぐ後ろの形の語(サウスベイ・インポート社、Marlow Bay社)。形の語で始まる漢字の語(社員、社長)は外す。 */
|
|
177
|
+
const foreignMentionAt = (source: string, form: CompanyForm, at: number, words: readonly string[]): CompanyMention | undefined => {
|
|
178
|
+
const before = source.slice(0, at);
|
|
179
|
+
if (!FOREIGN_END.test(before) || words.some((word) => source.startsWith(word, at))) return undefined;
|
|
180
|
+
const run = before.slice(foreignRunStart(before));
|
|
181
|
+
const start = at - run.length + (FOREIGN_LEAD.exec(run)?.[0].length ?? 0);
|
|
182
|
+
const base = { start, end: at };
|
|
183
|
+
if (!isNameBase(source, base, () => false) || PLACEHOLDER.test(source.slice(start, at))) return undefined;
|
|
184
|
+
return { ...mentionOf(source, base, { start: at, end: at + form.pattern.length }, form.group), foreign: true };
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const baseBefore = (source: string, at: number, latin: boolean, isProper: IsProper, stops: KanaStops): Span | undefined =>
|
|
188
|
+
latin ? latinBaseBefore(source, at, isProper) : cjkBaseBefore(source, at, stops);
|
|
99
189
|
|
|
100
190
|
/** 形の語の一つの現れから、会社の名前の現れ。名前が前にあればそれを、無ければ後ろを取る。 */
|
|
101
|
-
const mentionAt = (source: string, form: CompanyForm, at: number, isProper: IsProper): CompanyMention | undefined => {
|
|
191
|
+
const mentionAt = (source: string, form: CompanyForm, at: number, isProper: IsProper, stops: KanaStops): CompanyMention | undefined => {
|
|
192
|
+
if (form.foreign !== undefined) return foreignMentionAt(source, form, at, form.foreign.words);
|
|
102
193
|
const formSpan = { start: at, end: at + form.pattern.length };
|
|
103
194
|
const latin = LATIN.test(form.pattern);
|
|
104
195
|
if (latin && CONTINUED.test(source.slice(formSpan.end))) return undefined;
|
|
105
|
-
const before = form.position === "before" ? undefined : baseBefore(source, at, latin, isProper);
|
|
196
|
+
const before = form.position === "before" ? undefined : baseBefore(source, at, latin, isProper, stops);
|
|
106
197
|
if (before !== undefined && isNameBase(source, before, isProper)) return mentionOf(source, before, formSpan, form.group);
|
|
107
|
-
const after = form.position === "after" || latin ? undefined : cjkBaseAfter(source, formSpan.end);
|
|
198
|
+
const after = form.position === "after" || latin ? undefined : cjkBaseAfter(source, formSpan.end, stops);
|
|
108
199
|
return after !== undefined && isNameBase(source, after, isProper) ? mentionOf(source, after, formSpan, form.group) : undefined;
|
|
109
200
|
};
|
|
110
201
|
|
|
111
202
|
/** 文書の中の会社の名前の現れ。長い形の語(Co., Ltd)を先に取り、その中の短い語(Ltd)は数えない。 */
|
|
112
|
-
export const companyMentionsIn = (source: string, forms: readonly CompanyForm[], isProper: IsProper): CompanyMention[] => {
|
|
203
|
+
export const companyMentionsIn = (source: string, forms: readonly CompanyForm[], isProper: IsProper, stops: KanaStops): CompanyMention[] => {
|
|
113
204
|
const taken: Span[] = [];
|
|
114
205
|
return forms
|
|
115
206
|
.toSorted((left, right) => right.pattern.length - left.pattern.length)
|
|
@@ -118,7 +209,7 @@ export const companyMentionsIn = (source: string, forms: readonly CompanyForm[],
|
|
|
118
209
|
const end = at + form.pattern.length;
|
|
119
210
|
if (!standsAsWord(source, form.pattern, at) || taken.some((span) => span.start < end && at < span.end)) return [];
|
|
120
211
|
taken.push({ start: at, end });
|
|
121
|
-
const mention = mentionAt(source, form, at, isProper);
|
|
212
|
+
const mention = mentionAt(source, form, at, isProper, stops);
|
|
122
213
|
return mention === undefined ? [] : [mention];
|
|
123
214
|
}),
|
|
124
215
|
)
|
|
@@ -130,23 +221,30 @@ const MIN_SLIP_LENGTH = 7;
|
|
|
130
221
|
const spliced = (chars: readonly string[], at: number, count: number): string => chars.toSpliced(at, count).join("");
|
|
131
222
|
const firstDifference = (left: readonly string[], right: readonly string[]): number => left.findIndex((char, index) => char !== right[index]);
|
|
132
223
|
|
|
224
|
+
/** 一字違いの、違う字(changed)と、それが立つ名前の字(chars)の何字目か(at)。 */
|
|
225
|
+
type Change = { readonly changed: readonly string[]; readonly chars: readonly string[]; readonly at: number };
|
|
226
|
+
|
|
133
227
|
/** 一字の抜けなら、その字。 */
|
|
134
|
-
const droppedChars = (longer: readonly string[], shorter: readonly string[]):
|
|
228
|
+
const droppedChars = (longer: readonly string[], shorter: readonly string[]): Change | undefined => {
|
|
135
229
|
if (longer.length !== shorter.length + 1) return undefined;
|
|
136
230
|
const at = firstDifference(longer, shorter);
|
|
137
|
-
return spliced(longer, at, 1) === shorter.join("") ? [longer[at] ?? ""] : undefined;
|
|
231
|
+
return spliced(longer, at, 1) === shorter.join("") ? { changed: [longer[at] ?? ""], chars: longer, at } : undefined;
|
|
138
232
|
};
|
|
139
233
|
|
|
140
234
|
/** 一字の置き換えか、隣どうしの入れ替えなら、その字。 */
|
|
141
|
-
const replacedChars = (left: readonly string[], right: readonly string[]):
|
|
235
|
+
const replacedChars = (left: readonly string[], right: readonly string[]): Change | undefined => {
|
|
142
236
|
const at = firstDifference(left, right);
|
|
143
|
-
const
|
|
237
|
+
const change = { changed: [left[at] ?? "", right[at] ?? ""], chars: left, at };
|
|
144
238
|
if (left.length !== right.length || at < 0) return undefined;
|
|
145
|
-
if (spliced(left, at, 1) === spliced(right, at, 1)) return
|
|
239
|
+
if (spliced(left, at, 1) === spliced(right, at, 1)) return change;
|
|
146
240
|
const swapped = left[at] === right[at + 1] && left[at + 1] === right[at] && spliced(left, at, 2) === spliced(right, at, 2);
|
|
147
|
-
return swapped ?
|
|
241
|
+
return swapped ? change : undefined;
|
|
148
242
|
};
|
|
149
243
|
|
|
244
|
+
/** 名前の部分の一字違い(置き換え・抜け・隣どうしの入れ替え)。 */
|
|
245
|
+
const changeBetween = (leftChars: readonly string[], rightChars: readonly string[]): Change | undefined =>
|
|
246
|
+
replacedChars(leftChars, rightChars) ?? droppedChars(leftChars, rightChars) ?? droppedChars(rightChars, leftChars);
|
|
247
|
+
|
|
150
248
|
/**
|
|
151
249
|
* 名前の部分が一字違いか(置き換え・抜け・隣どうしの入れ替え)。違う字が漢字なら見ない。漢字の一字違い(日本電気 と 日本電機)
|
|
152
250
|
* は別の会社のことがある。短い名前(Alpha と Alpho)も別の会社のことが多い。
|
|
@@ -154,13 +252,40 @@ const replacedChars = (left: readonly string[], right: readonly string[]): strin
|
|
|
154
252
|
const isSlip = (left: string, right: string): boolean => {
|
|
155
253
|
const [leftChars, rightChars] = [[...left], [...right]];
|
|
156
254
|
if (Math.min(leftChars.length, rightChars.length) < MIN_SLIP_LENGTH) return false;
|
|
157
|
-
const
|
|
158
|
-
return
|
|
255
|
+
const change = changeBetween(leftChars, rightChars);
|
|
256
|
+
return change !== undefined && change.changed.every((char) => NOT_HAN_LETTER.test(char));
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
const HAN = /\p{Script=Han}/u;
|
|
260
|
+
const KANA = /^[\p{Script=Hiragana}\p{Script=Katakana}ー]$/u;
|
|
261
|
+
/** 漢字を含む短い名前で、一字違いを見るかなの語の字数。三字のかなの語(サンワ と サンヨ)は別の会社のことがある。 */
|
|
262
|
+
const MIN_KANA_WORD_LENGTH = 4;
|
|
263
|
+
|
|
264
|
+
/** at の字を含む、かなの続きの字数。 */
|
|
265
|
+
const kanaRunLength = (chars: readonly string[], at: number): number => {
|
|
266
|
+
const isKanaAt = (index: number): boolean => KANA.test(chars[index] ?? "");
|
|
267
|
+
if (!isKanaAt(at)) return 0;
|
|
268
|
+
const start = chars.findLastIndex((_char, index) => index < at && !isKanaAt(index)) + 1;
|
|
269
|
+
const end = chars.findIndex((_char, index) => index > at && !isKanaAt(index));
|
|
270
|
+
return (end < 0 ? chars.length : end) - start;
|
|
159
271
|
};
|
|
160
272
|
|
|
161
|
-
/**
|
|
273
|
+
/**
|
|
274
|
+
* 漢字を含む名前の、四字以上のかなの語の中の、かな一字違い(コモレビ電機 と コモレピ電機)。漢字の部分が同じなので、七字に
|
|
275
|
+
* 満たない名前でも見る。漢字の一字違い(日本電気 と 日本電機)は見ない。
|
|
276
|
+
*/
|
|
277
|
+
export const isKanaWordSlip = (left: string, right: string): boolean => {
|
|
278
|
+
if (!HAN.test(left) || !HAN.test(right)) return false;
|
|
279
|
+
const change = changeBetween([...left], [...right]);
|
|
280
|
+
return change !== undefined && change.changed.every((char) => KANA.test(char)) && kanaRunLength(change.chars, change.at) >= MIN_KANA_WORD_LENGTH;
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* 名前の部分が同じ二つ。同じ形の短い書き方と長い書き方(株式会社 と (株)、Inc と Incorporated)は書き分けと見ない。社で呼ぶ書き方
|
|
285
|
+
* (アップル社 と アップル株式会社)は正式の名前を略した呼び方なので、ほかの形の語と比べない。
|
|
286
|
+
*/
|
|
162
287
|
const sameNameRelation = (left: CompanyMention, right: CompanyMention): CompanyRelation | undefined => {
|
|
163
|
-
if (left.form !== right.form) return "form";
|
|
288
|
+
if (left.form !== right.form) return left.foreign === true || right.foreign === true ? undefined : "form";
|
|
164
289
|
if (left.position !== right.position) return "position";
|
|
165
290
|
return nameKey(left.surface) === nameKey(right.surface) ? "spelling" : undefined;
|
|
166
291
|
};
|
|
@@ -191,12 +316,20 @@ const talliesOf = (mentions: readonly CompanyMention[]): Tally[] => {
|
|
|
191
316
|
/** 多いほうが先。同数なら先に書いたほう。 */
|
|
192
317
|
const byUsage = (left: Tally, right: Tally): number => right.count - left.count || left.first.offset - right.first.offset;
|
|
193
318
|
|
|
319
|
+
/** 短い名前のかなの一字違いは、別の会社のこともあるので、相手が二度以上、こちらが一度だけのときに限る。 */
|
|
320
|
+
const relationBetween = (tally: Tally, other: Tally): CompanyRelation | undefined => {
|
|
321
|
+
const relation = companyRelation(tally.first, other.first);
|
|
322
|
+
if (relation !== undefined || tally.count !== 1 || other.count < 2) return relation;
|
|
323
|
+
const [left, right] = [tally.first, other.first];
|
|
324
|
+
return left.form === right.form && left.position === right.position && isKanaWordSlip(nameKey(left.base), nameKey(right.base)) ? "near" : undefined;
|
|
325
|
+
};
|
|
326
|
+
|
|
194
327
|
/** 同じ会社の、少ないほうの書き方。同じ会社と言える相手のうち一番多いものと比べる。書き方ごとに最初の現れを一つ。 */
|
|
195
328
|
export const companyVariants = (mentions: readonly CompanyMention[]): CompanyVariant[] => {
|
|
196
329
|
const tallies = talliesOf(mentions);
|
|
197
330
|
return tallies.flatMap((tally) => {
|
|
198
|
-
const [usual] = tallies.filter((other) => other === tally ||
|
|
199
|
-
const kind = usual === undefined || usual === tally ? undefined :
|
|
331
|
+
const [usual] = tallies.filter((other) => other === tally || relationBetween(tally, other) !== undefined).toSorted(byUsage);
|
|
332
|
+
const kind = usual === undefined || usual === tally ? undefined : relationBetween(tally, usual);
|
|
200
333
|
return usual === undefined || kind === undefined ? [] : [{ mention: tally.first, usual: usual.first.surface, kind }];
|
|
201
334
|
});
|
|
202
335
|
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// Postal addresses written two ways in one document: the same street with its block numbers swapped or one of them changed
|
|
2
|
+
// (丸の内二丁目4番1号 and 丸の内二丁目1番4号, 2-4-1 and 2-1-4 Marunouchi), or the same street and numbers under two postcodes.
|
|
3
|
+
// Only an address with a label shortly before it on its line is read (住所, 本店所在地, Address, head office); the labels come
|
|
4
|
+
// from the language's address-label lexicon, grouped by whose address they name, so a head office and a branch are never
|
|
5
|
+
// compared. Pure.
|
|
6
|
+
import type { LexiconEntry } from "../plugin.ts";
|
|
7
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
8
|
+
import { writingVariants, type Variant, type Writing } from "./variants.ts";
|
|
9
|
+
|
|
10
|
+
/** An address as written: the street it is on and the area written with it (東京都千代田区, Chiyoda-ku), its block numbers, its postcode when the line has one, and its label's group. */
|
|
11
|
+
export type AddressWriting = Writing & {
|
|
12
|
+
readonly street: string;
|
|
13
|
+
readonly area: string;
|
|
14
|
+
readonly numbers: readonly number[];
|
|
15
|
+
readonly postcode: string | undefined;
|
|
16
|
+
readonly label: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** A group that names no one office (住所, Address) and so may be compared with any. */
|
|
20
|
+
const ANY_OFFICE = "address";
|
|
21
|
+
const KANA_HAN = String.raw`\p{sc=Han}\p{sc=Hiragana}\p{sc=Katakana}ー々ヶ`;
|
|
22
|
+
const BLOCK_JOIN = String.raw`\s?(?:丁目|番地|番|号|の|[-‐−-])\s?`;
|
|
23
|
+
/** A Japanese street (its town, ward, city) and its block numbers: 東京都千代田区丸の内二丁目4番1号, 梅田1-2-3. */
|
|
24
|
+
const JA_ADDRESS = new RegExp(String.raw`([${KANA_HAN}]{2,40}?)([0-90-9]{1,4}(?:${BLOCK_JOIN}[0-90-9]{1,4}){1,3})(?:\s?(?:号|番地|番))?`, "gu");
|
|
25
|
+
/** Block numbers, the capitalised street after them and the area after a comma: 2-4-1 Marunouchi, Chiyoda-ku; 120 Main Street, Springfield. */
|
|
26
|
+
const EN_BLOCK = String.raw`(?<![\w.\-/])(\d{1,5}(?:-\d{1,5}){0,3})`;
|
|
27
|
+
const EN_STREET = String.raw`([A-Z][a-z]+(?:\s[A-Z][a-z]+){0,3})`;
|
|
28
|
+
const EN_AREA = String.raw`(?:,\s?([A-Z][A-Za-z]*(?:-[a-z]+)?))?`;
|
|
29
|
+
const EN_ADDRESS = new RegExp(String.raw`${EN_BLOCK}\s+${EN_STREET}${EN_AREA}`, "gu");
|
|
30
|
+
/** 都道府県, 市, 区 and 郡: what comes after the last of them in a Japanese street is the town the numbers count in. */
|
|
31
|
+
const DIVISIONS = [..."都道府県市区郡"];
|
|
32
|
+
const CHOME = "丁目";
|
|
33
|
+
const KANJI_NUMERALS = "一二三四五六七八九十";
|
|
34
|
+
const KANJI_DIGITS = "一二三四五六七八九";
|
|
35
|
+
const JP_POSTCODE = /(?<![\d\-‐−-])〒?\s?(\d{3})[-‐−-](\d{4})(?![\d\-‐−-])/u;
|
|
36
|
+
const US_ZIP = /\b[A-Z]{2}\s(\d{5})(?:-\d{4})?\b/u;
|
|
37
|
+
const JP_POSTCODE_ONLY = /^\d{3}-\d{4}$/u;
|
|
38
|
+
const YEAR = /^(?:19|20)\d{2}$/u;
|
|
39
|
+
const FULL_WIDTH_DIGIT = /[0-9]/gu;
|
|
40
|
+
const NUMBER = /\d+/gu;
|
|
41
|
+
const LATIN_START = /^[A-Za-z]/u;
|
|
42
|
+
const LETTER = /\p{L}/u;
|
|
43
|
+
/** How far before an address its label may end: 「本店所在地(」, "head office at ". */
|
|
44
|
+
const MAX_LABEL_GAP = 20;
|
|
45
|
+
const MIN_STREET_LENGTH = 2;
|
|
46
|
+
|
|
47
|
+
/** 一 to 九十九 as a number; the 丁目 of a Japanese street. */
|
|
48
|
+
const kanjiNumber = (kanji: string): number => {
|
|
49
|
+
const digit = (char: string): number => KANJI_DIGITS.indexOf(char) + 1;
|
|
50
|
+
if (!kanji.includes("十")) return digit(kanji);
|
|
51
|
+
const [tens = "", ones = ""] = kanji.split("十");
|
|
52
|
+
return (tens === "" ? 1 : digit(tens)) * 10 + (ones === "" ? 0 : digit(ones));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const halfWidth = (text: string): string => text.replaceAll(FULL_WIDTH_DIGIT, (char) => String.fromCharCode(char.charCodeAt(0) - 0xfee0));
|
|
56
|
+
const numbersOf = (text: string): number[] => [...halfWidth(text).matchAll(NUMBER)].map((match) => Number(match[0]));
|
|
57
|
+
|
|
58
|
+
/** The 二丁目 a street ends with, or "" when it ends with none. */
|
|
59
|
+
const chomeOf = (street: string): string => {
|
|
60
|
+
if (!street.endsWith(CHOME)) return "";
|
|
61
|
+
const numeral = Array.from(street.slice(0, -CHOME.length))
|
|
62
|
+
.toReversed()
|
|
63
|
+
.findIndex((char) => !KANJI_NUMERALS.includes(char));
|
|
64
|
+
const length = numeral === -1 ? street.length - CHOME.length : numeral;
|
|
65
|
+
return length === 0 ? "" : street.slice(street.length - CHOME.length - length);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** The town of a Japanese street as written (丸の内二丁目), its name without the 丁目 and the 丁目 as a number; undefined when the street names no ward, city or prefecture. */
|
|
69
|
+
const jaStreet = (run: string): { area: string; written: string; town: string; chome: number[] } | undefined => {
|
|
70
|
+
const lastDivision = Math.max(...DIVISIONS.map((division) => run.lastIndexOf(division)));
|
|
71
|
+
if (lastDivision < 0) return undefined;
|
|
72
|
+
const written = run.slice(lastDivision + 1);
|
|
73
|
+
const chome = chomeOf(written);
|
|
74
|
+
const town = written.slice(0, written.length - chome.length);
|
|
75
|
+
const numbered = chome === "" ? [] : [kanjiNumber(chome.slice(0, -CHOME.length))];
|
|
76
|
+
return town.length < MIN_STREET_LENGTH ? undefined : { area: run.slice(0, lastDivision + 1), written, town, chome: numbered };
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
type Place = { readonly offset: number; readonly written: string; readonly street: string; readonly area: string; readonly numbers: number[] };
|
|
80
|
+
|
|
81
|
+
const jaPlaces = (text: string): Place[] =>
|
|
82
|
+
[...text.matchAll(JA_ADDRESS)].flatMap((match) => {
|
|
83
|
+
const run = match[1] ?? "";
|
|
84
|
+
const street = jaStreet(run);
|
|
85
|
+
if (street === undefined) return [];
|
|
86
|
+
const townStart = run.length - street.written.length;
|
|
87
|
+
return [
|
|
88
|
+
{
|
|
89
|
+
offset: match.index + townStart,
|
|
90
|
+
written: match[0].slice(townStart),
|
|
91
|
+
street: street.town,
|
|
92
|
+
area: street.area,
|
|
93
|
+
numbers: [...street.chome, ...numbersOf(match[2] ?? "")],
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/** A lone number before capitalised words is an address only when a comma goes on to the area (120 Main Street, Springfield), not a count (365 Plan). */
|
|
99
|
+
const isAddressBlock = (block: string, area: string): boolean => block.includes("-") || area !== "";
|
|
100
|
+
|
|
101
|
+
const enPlaces = (text: string): Place[] =>
|
|
102
|
+
[...text.matchAll(EN_ADDRESS)].flatMap((match) => {
|
|
103
|
+
const [, block = "", street = "", area = ""] = match;
|
|
104
|
+
if (JP_POSTCODE_ONLY.test(block) || YEAR.test(block) || !isAddressBlock(block, area)) return [];
|
|
105
|
+
return [{ offset: match.index, written: `${block} ${street}`, street: street.toLowerCase(), area: area.toLowerCase(), numbers: numbersOf(block) }];
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
/** Where a label last occurs before an address on its line; a Latin label only as a whole word (office, not officer). */
|
|
109
|
+
const lastPlace = (before: string, label: string): number => {
|
|
110
|
+
const lowered = label.toLowerCase();
|
|
111
|
+
const places = [...before.matchAll(new RegExp(escapeRegExp(lowered), "gu"))].map((match) => match.index);
|
|
112
|
+
const whole = LATIN_START.test(label) ? places.filter((at) => !LETTER.test(before[at - 1] ?? "") && !LETTER.test(before[at + lowered.length] ?? "")) : places;
|
|
113
|
+
return whole.at(-1) ?? -1;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** The group of the label ending nearest before an address on its line, the longest when two end together (本店所在地 over 所在地). */
|
|
117
|
+
const labelBefore = (before: string, labels: readonly LexiconEntry[]): string | undefined =>
|
|
118
|
+
labels
|
|
119
|
+
.map((entry) => {
|
|
120
|
+
const at = lastPlace(before, entry.pattern);
|
|
121
|
+
return { group: entry.group ?? ANY_OFFICE, at, end: at + entry.pattern.length };
|
|
122
|
+
})
|
|
123
|
+
.filter((hit) => hit.at >= 0 && before.length - hit.end <= MAX_LABEL_GAP)
|
|
124
|
+
.toSorted((a, b) => b.end - a.end || a.at - b.at)[0]?.group;
|
|
125
|
+
|
|
126
|
+
const postcodeOf = (line: string): string | undefined => {
|
|
127
|
+
const japanese = JP_POSTCODE.exec(line);
|
|
128
|
+
if (japanese !== null) return `${japanese[1] ?? ""}-${japanese[2] ?? ""}`;
|
|
129
|
+
return US_ZIP.exec(line)?.[1];
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/** The labelled addresses of one line; its postcode is given to an address only when the line holds one address. */
|
|
133
|
+
const lineAddresses = (line: string, start: number, labels: readonly LexiconEntry[]): AddressWriting[] => {
|
|
134
|
+
const places = [...jaPlaces(line), ...enPlaces(line)];
|
|
135
|
+
const postcode = places.length === 1 ? postcodeOf(line) : undefined;
|
|
136
|
+
return places.flatMap((place) => {
|
|
137
|
+
const label = labelBefore(line.slice(0, place.offset).toLowerCase(), labels);
|
|
138
|
+
if (label === undefined) return [];
|
|
139
|
+
const key = `${place.street}\u0000${place.numbers.join("-")}`;
|
|
140
|
+
return [{ ...place, offset: start + place.offset, key, postcode, label }];
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/** The postal addresses of a text that have a label shortly before them on their line. */
|
|
145
|
+
export const labelledAddresses = (text: string, labels: readonly LexiconEntry[]): AddressWriting[] => {
|
|
146
|
+
const lines = text.split("\n");
|
|
147
|
+
const starts = lines.reduce<number[]>((acc, line, index) => [...acc, index === 0 ? 0 : (acc[index - 1] ?? 0) + (lines[index - 1] ?? "").length + 1], []);
|
|
148
|
+
return lines.flatMap((line, index) => lineAddresses(line, starts[index] ?? 0, labels));
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/** Two lists of block numbers that are one address mistyped: the same numbers in another order, or one of them changed. */
|
|
152
|
+
export const isBlockSlip = (a: readonly number[], b: readonly number[]): boolean => {
|
|
153
|
+
if (a.length !== b.length || a.join("-") === b.join("-")) return false;
|
|
154
|
+
const sorted = (numbers: readonly number[]): string => numbers.toSorted((x, y) => x - y).join("-");
|
|
155
|
+
const differing = a.filter((number, index) => number !== b[index]).length;
|
|
156
|
+
return sorted(a) === sorted(b) || differing === 1;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/** Whether two writings are on one street: the same town or street name, in the same area where both write one (千代田区 within 東京都千代田区). */
|
|
160
|
+
const sameStreet = (a: AddressWriting, b: AddressWriting): boolean => a.street === b.street && (a.area.endsWith(b.area) || b.area.endsWith(a.area));
|
|
161
|
+
|
|
162
|
+
const sameOffice = (a: AddressWriting, b: AddressWriting): boolean => a.label === b.label || a.label === ANY_OFFICE || b.label === ANY_OFFICE;
|
|
163
|
+
|
|
164
|
+
export type AddressVariant = { readonly variant: "address" | "postcode"; readonly found: Variant<AddressWriting> };
|
|
165
|
+
|
|
166
|
+
/** Every writing of an address that is another of the same street with its numbers mistyped, or under another postcode. */
|
|
167
|
+
export const addressVariants = (text: string, labels: readonly LexiconEntry[]): AddressVariant[] => {
|
|
168
|
+
const addresses = labelledAddresses(text, labels);
|
|
169
|
+
const numbered = writingVariants(addresses, (a, b) => sameStreet(a, b) && sameOffice(a, b) && isBlockSlip(a.numbers, b.numbers));
|
|
170
|
+
const withPostcode = addresses.flatMap((address) => (address.postcode === undefined ? [] : [{ ...address, key: `${address.key}\u0000${address.postcode}` }]));
|
|
171
|
+
const postcoded = writingVariants(
|
|
172
|
+
withPostcode,
|
|
173
|
+
(a, b) => sameStreet(a, b) && a.numbers.join("-") === b.numbers.join("-") && a.postcode !== b.postcode && sameOffice(a, b),
|
|
174
|
+
);
|
|
175
|
+
const tagged =
|
|
176
|
+
(variant: AddressVariant["variant"]) =>
|
|
177
|
+
(found: Variant<AddressWriting>): AddressVariant => ({ variant, found });
|
|
178
|
+
return [...numbered.map(tagged("address")), ...postcoded.map(tagged("postcode"))];
|
|
179
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Email addresses written two ways in one document (support@hibari-lab.example and suport@hibari-lab.example). Two addresses
|
|
2
|
+
// are one contact misspelt only when everything but one word of them is the same, so sales@ and support@ of one domain, or
|
|
3
|
+
// one mailbox at two domains that differ by more than a slip, stay apart. Pure.
|
|
4
|
+
import { writingVariants, type Variant, type Writing } from "./variants.ts";
|
|
5
|
+
|
|
6
|
+
export type EmailWriting = Writing;
|
|
7
|
+
|
|
8
|
+
const EMAIL = /(?<![\w.%+-])[a-z0-9][a-z0-9._%+-]*@[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/giu;
|
|
9
|
+
const SEPARATOR = /[.@\-_+%]/u;
|
|
10
|
+
const SEPARATORS = /[.\-_]/gu;
|
|
11
|
+
const DIGIT = /\d/u;
|
|
12
|
+
/** A word shorter than this is a whole name (hr, pr, jp, sale, info), not one to be misspelt. */
|
|
13
|
+
const MIN_WORD_LENGTH = 5;
|
|
14
|
+
/** Longer than this, a word is an id rather than a name, and is not compared. */
|
|
15
|
+
const MAX_WORD_LENGTH = 64;
|
|
16
|
+
/** From this length a word may differ by two edits and still be a slip; a shorter one by one. */
|
|
17
|
+
const TWO_EDIT_LENGTH = 6;
|
|
18
|
+
|
|
19
|
+
/** The email addresses of a text, lower-cased into their key. */
|
|
20
|
+
export const emailWritings = (text: string): EmailWriting[] =>
|
|
21
|
+
[...text.matchAll(EMAIL)].map((match) => ({ offset: match.index, written: match[0], key: match[0].toLowerCase() }));
|
|
22
|
+
|
|
23
|
+
/** Edits (insert, delete, replace, swap of neighbours) between two short strings: the optimal string alignment distance. */
|
|
24
|
+
export const editDistance = (a: string, b: string): number => {
|
|
25
|
+
const rows = [...a].reduce<number[][]>(
|
|
26
|
+
(done, charA, i) => {
|
|
27
|
+
const previous = done[i] ?? [];
|
|
28
|
+
const row = [...b].reduce<number[]>(
|
|
29
|
+
(cells, charB, j) => {
|
|
30
|
+
const cost = charA === charB ? 0 : 1;
|
|
31
|
+
const swapped = i > 0 && j > 0 && charA === b[j - 1] && a[i - 1] === charB ? (done[i - 1]?.[j - 1] ?? Infinity) + 1 : Infinity;
|
|
32
|
+
return [...cells, Math.min((previous[j + 1] ?? Infinity) + 1, (cells[j] ?? Infinity) + 1, (previous[j] ?? Infinity) + cost, swapped)];
|
|
33
|
+
},
|
|
34
|
+
[i + 1],
|
|
35
|
+
);
|
|
36
|
+
return [...done, row];
|
|
37
|
+
},
|
|
38
|
+
[[...Array(b.length + 1).keys()]],
|
|
39
|
+
);
|
|
40
|
+
return rows.at(-1)?.at(-1) ?? 0;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const separatorsOf = (address: string): string => [...address].filter((char) => SEPARATOR.test(char)).join("");
|
|
44
|
+
|
|
45
|
+
/** One word of the two differs, by a slip: both long enough, no digits (support1@ and support2@ are two mailboxes). */
|
|
46
|
+
const oneWordSlip = (a: string, b: string): boolean => {
|
|
47
|
+
if (separatorsOf(a) !== separatorsOf(b)) return false;
|
|
48
|
+
const wordsA = a.split(SEPARATOR);
|
|
49
|
+
const wordsB = b.split(SEPARATOR);
|
|
50
|
+
const differing = wordsA.flatMap((word, index): [string, string][] => (word === wordsB[index] ? [] : [[word, wordsB[index] ?? ""]]));
|
|
51
|
+
const [pair] = differing;
|
|
52
|
+
if (differing.length !== 1 || pair === undefined) return false;
|
|
53
|
+
const [wordA, wordB] = pair;
|
|
54
|
+
const shorter = Math.min(wordA.length, wordB.length);
|
|
55
|
+
if (shorter < MIN_WORD_LENGTH || Math.max(wordA.length, wordB.length) > MAX_WORD_LENGTH || DIGIT.test(wordA) || DIGIT.test(wordB)) return false;
|
|
56
|
+
return editDistance(wordA, wordB) <= (shorter >= TWO_EDIT_LENGTH ? 2 : 1);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** Whether two addresses are one written two ways: a dot or hyphen dropped or added, or one word misspelt. */
|
|
60
|
+
export const isEmailSlip = (a: string, b: string): boolean => a !== b && (a.replaceAll(SEPARATORS, "") === b.replaceAll(SEPARATORS, "") || oneWordSlip(a, b));
|
|
61
|
+
|
|
62
|
+
/** Every writing of an address that is another address of the document written with a slip, with that other address. */
|
|
63
|
+
export const emailVariants = (text: string): Variant<EmailWriting>[] => writingVariants(emailWritings(text), (a, b) => isEmailSlip(a.key, b.key));
|