chaffjs 0.31.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/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/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/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/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-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/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-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/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/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.map +1 -1
- package/dist/detectors/contact-variant.js +6 -2
- package/dist/detectors/contact-variant.js.map +1 -1
- 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 +4 -10
- package/dist/detectors/date-outside-period.js.map +1 -1
- package/dist/detectors/date-stamp-order.d.ts.map +1 -1
- package/dist/detectors/date-stamp-order.js +2 -1
- package/dist/detectors/date-stamp-order.js.map +1 -1
- 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 +6 -20
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/derived-numbers.d.ts +4 -3
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +43 -70
- 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 +11 -4
- 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/event-deadline.d.ts.map +1 -1
- package/dist/detectors/event-deadline.js +11 -2
- package/dist/detectors/event-deadline.js.map +1 -1
- package/dist/detectors/fact-consistency.d.ts.map +1 -1
- package/dist/detectors/fact-consistency.js +112 -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/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/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 +1 -1
- package/dist/detectors/measured-facts.d.ts.map +1 -1
- package/dist/detectors/measured-facts.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/detectors/name-variant.js +128 -14
- 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 +35 -10
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +15 -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/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/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/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/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/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/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/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/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/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/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/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/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.map +1 -1
- package/dist/detectors/rent-multiple-mismatch.js.map +1 -1
- 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.js +1 -1
- package/dist/detectors/scaled-quantity.js.map +1 -1
- 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/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +42 -10
- package/dist/detectors/structure-tree.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 +1 -1
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +3 -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 +1 -0
- package/dist/detectors/time-order.d.ts.map +1 -1
- package/dist/detectors/time-order.js +43 -13
- package/dist/detectors/time-order.js.map +1 -1
- 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/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/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/labelled-facts.d.ts +15 -1
- package/dist/facts/labelled-facts.d.ts.map +1 -1
- package/dist/facts/labelled-facts.js +51 -8
- package/dist/facts/labelled-facts.js.map +1 -1
- package/dist/facts/measure-units.d.ts.map +1 -1
- package/dist/facts/measure-units.js +23 -8
- package/dist/facts/measure-units.js.map +1 -1
- package/dist/facts/measures.js +11 -9
- 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/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-word.d.ts +5 -0
- package/dist/facts/unit-word.d.ts.map +1 -1
- package/dist/facts/unit-word.js +9 -0
- package/dist/facts/unit-word.js.map +1 -1
- 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/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-variants.d.ts +8 -8
- package/dist/name-variants.d.ts.map +1 -1
- package/dist/name-variants.js +28 -81
- 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 +49 -21
- package/dist/phone-numbers.js.map +1 -1
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.d.ts.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/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 +1 -0
- package/dist/spacing-code.d.ts.map +1 -1
- package/dist/spacing-code.js +15 -1
- package/dist/spacing-code.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/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/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 +5 -1
- package/dist/structure/date-outside-period.d.ts.map +1 -1
- package/dist/structure/date-outside-period.js +13 -9
- package/dist/structure/date-outside-period.js.map +1 -1
- package/dist/structure/date-range.d.ts +2 -1
- package/dist/structure/date-range.d.ts.map +1 -1
- package/dist/structure/date-range.js +4 -6
- package/dist/structure/date-range.js.map +1 -1
- package/dist/structure/deadline-after-event.d.ts +35 -2
- package/dist/structure/deadline-after-event.d.ts.map +1 -1
- package/dist/structure/deadline-after-event.js +77 -6
- package/dist/structure/deadline-after-event.js.map +1 -1
- 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/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/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 +33 -16
- package/dist/structure/labelled-date-order.d.ts.map +1 -1
- package/dist/structure/labelled-date-order.js +38 -30
- package/dist/structure/labelled-date-order.js.map +1 -1
- 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/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/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.map +1 -1
- package/dist/structure/quantity-range.js +1 -5
- package/dist/structure/quantity-range.js.map +1 -1
- package/dist/structure/range-bands.d.ts +2 -0
- package/dist/structure/range-bands.d.ts.map +1 -1
- package/dist/structure/range-bands.js +1 -1
- package/dist/structure/range-bands.js.map +1 -1
- 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 +2 -22
- package/dist/structure/rent-multiple.d.ts.map +1 -1
- package/dist/structure/rent-multiple.js +2 -49
- package/dist/structure/rent-multiple.js.map +1 -1
- 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 +1 -1
- package/dist/structure/scaled-quantities.d.ts.map +1 -1
- package/dist/structure/scaled-quantities.js +23 -6
- package/dist/structure/scaled-quantities.js.map +1 -1
- 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/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/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/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 +2 -0
- package/dist/structure/time-range.d.ts.map +1 -1
- package/dist/structure/time-range.js +7 -2
- package/dist/structure/time-range.js.map +1 -1
- package/dist/structure/total-line.d.ts +34 -2
- package/dist/structure/total-line.d.ts.map +1 -1
- package/dist/structure/total-line.js +124 -3
- package/dist/structure/total-line.js.map +1 -1
- 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 +13 -3
- package/dist/structure/total.d.ts.map +1 -1
- package/dist/structure/total.js +80 -7
- package/dist/structure/total.js.map +1 -1
- 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/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/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/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 +1 -1
- 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 +4 -4
- package/rules/contrast-framing.yaml +2 -2
- 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 +2 -2
- package/rules/date-without-year.yaml +12 -12
- package/rules/deadline-after-event.yaml +11 -6
- 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 +33 -12
- 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 +16 -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-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 +1 -1
- 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 +1 -1
- 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 +12 -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-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/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 +2 -2
- package/rules/range-band-mismatch.yaml +1 -1
- 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/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 +1 -1
- 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/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 +9 -4
- 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 +1 -1
- package/rules/unit-spacing-consistency.yaml +1 -1
- package/rules/unknown-word.yaml +1 -1
- package/rules/url-run-on.yaml +1 -1
- 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 +1 -1
- 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/company-kana-spelling.ts +105 -0
- package/src/company-names.ts +159 -26
- package/src/contacts/table-rows.ts +51 -0
- package/src/derived/age-on-date.ts +161 -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-parts.ts +360 -0
- package/src/derived/readable-date.ts +63 -0
- package/src/derived/stays.ts +7 -2
- package/src/derived/timesheet-hours.ts +112 -0
- package/src/derived/use-maximum.ts +158 -0
- package/src/derived/working-hours.ts +2 -2
- 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/change-rate.ts +27 -4
- package/src/detectors/closing-balance-mismatch.ts +52 -0
- package/src/detectors/contact-variant.ts +8 -2
- 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 +4 -10
- package/src/detectors/date-stamp-order.ts +2 -1
- package/src/detectors/date-year.ts +55 -13
- package/src/detectors/deductible-exceeds-limit.ts +55 -0
- package/src/detectors/defined-term-form.ts +6 -23
- package/src/detectors/derived-numbers.ts +50 -89
- package/src/detectors/discount-rate.ts +41 -0
- package/src/detectors/due-date.ts +21 -7
- package/src/detectors/email-letter.ts +45 -15
- package/src/detectors/event-deadline.ts +13 -3
- package/src/detectors/fact-consistency.ts +145 -7
- package/src/detectors/gloss-year.ts +21 -0
- package/src/detectors/gpa-mismatch.ts +43 -0
- 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/line-amount.ts +58 -3
- package/src/detectors/measured-facts.ts +1 -1
- package/src/detectors/meter-usage.ts +49 -0
- package/src/detectors/name-field.ts +43 -0
- package/src/detectors/name-variant.ts +160 -16
- 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 +40 -10
- package/src/detectors/orthography.ts +27 -11
- 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/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/closing-balance-mismatch.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/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/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/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/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/revision-direction.ts +4 -0
- package/src/detectors/registry/running-balance.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/table-unit-mix.ts +4 -0
- package/src/detectors/registry/tier-threshold.ts +4 -0
- package/src/detectors/registry/variance-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 +3 -2
- 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 +1 -1
- package/src/detectors/serial-range.ts +37 -0
- package/src/detectors/share-amount.ts +51 -0
- package/src/detectors/structure-tree.ts +58 -10
- package/src/detectors/table-scale.ts +37 -0
- package/src/detectors/tax-amount.ts +45 -13
- package/src/detectors/technical-docs.ts +4 -2
- package/src/detectors/tier-threshold.ts +108 -0
- package/src/detectors/time-order.ts +52 -18
- package/src/detectors/use-maximum.ts +38 -0
- package/src/detectors/variance.ts +33 -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/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/labelled-facts.ts +66 -9
- package/src/facts/measure-units.ts +28 -10
- package/src/facts/measures.ts +11 -11
- package/src/facts/qualified-labels.ts +126 -0
- package/src/facts/rate-values.ts +117 -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-word.ts +13 -0
- package/src/facts/verb-quantity-facts.ts +84 -0
- package/src/facts/whole-counts.ts +183 -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-variants.ts +42 -86
- 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 +54 -18
- package/src/plugin.ts +2 -0
- package/src/product-names.ts +98 -0
- package/src/reference-numbers.ts +55 -0
- package/src/spaced-person-name.ts +97 -0
- package/src/spacing-code.ts +22 -1
- 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/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/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 +17 -9
- package/src/structure/date-range.ts +6 -9
- package/src/structure/deadline-after-event.ts +125 -8
- package/src/structure/deductible-limit.ts +255 -0
- package/src/structure/discount-rate.ts +209 -0
- 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 +68 -52
- package/src/structure/labelled-order.ts +122 -0
- package/src/structure/labelled-time-order.ts +100 -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/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 +1 -8
- package/src/structure/range-bands.ts +1 -1
- 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 +12 -82
- package/src/structure/revision-direction.ts +214 -0
- package/src/structure/running-balance.ts +157 -0
- package/src/structure/scaled-quantities.ts +20 -6
- 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/stated-multiple.ts +82 -0
- package/src/structure/stated-period.ts +23 -11
- 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/tier-threshold.ts +218 -0
- package/src/structure/time-range.ts +9 -3
- package/src/structure/total-line.ts +174 -5
- package/src/structure/total-row-blank.ts +23 -0
- package/src/structure/total.ts +122 -13
- package/src/structure/variance-table.ts +167 -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,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A computed length of time as whole hours and minutes, and which of the two a message writes: 4時間15分 / 4 hours 15
|
|
3
|
+
* minutes, 7時間 / 7 hours, 45分 / 45 minutes. A part of a minute is rounded to the nearest minute (half up).
|
|
4
|
+
*/
|
|
5
|
+
export type HoursAndMinutes = {
|
|
6
|
+
readonly hours: number;
|
|
7
|
+
readonly minutes: number;
|
|
8
|
+
/** "hours" when the minutes are 0, "minutes" under an hour (0 too), else "hours-minutes". */
|
|
9
|
+
readonly shape: "hours" | "minutes" | "hours-minutes";
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const MINUTES_PER_HOUR = 60;
|
|
13
|
+
|
|
14
|
+
/** undefined for a length that cannot be written: negative, NaN or infinite. */
|
|
15
|
+
export const hoursAndMinutes = (totalMinutes: number): HoursAndMinutes | undefined => {
|
|
16
|
+
if (!Number.isFinite(totalMinutes) || totalMinutes < 0) return undefined;
|
|
17
|
+
const whole = Math.round(totalMinutes);
|
|
18
|
+
const hours = Math.floor(whole / MINUTES_PER_HOUR);
|
|
19
|
+
const minutes = whole % MINUTES_PER_HOUR;
|
|
20
|
+
if (hours === 0) return { hours, minutes, shape: "minutes" };
|
|
21
|
+
return { hours, minutes, shape: minutes === 0 ? "hours" : "hours-minutes" };
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** Whether a computed length would be written as the stated one: a message saying "8 hours, but 8 hours is written" says nothing. */
|
|
25
|
+
export const readsTheSame = (computedMinutes: number, statedMinutes: number): boolean => Math.round(computedMinutes) === Math.round(statedMinutes);
|
|
26
|
+
|
|
27
|
+
const HOUR_DECIMALS = 100;
|
|
28
|
+
|
|
29
|
+
/** The computed length for a message: decimal hours as `expected` (kept for JSON readers), hours and minutes to write. */
|
|
30
|
+
export type ComputedLength = {
|
|
31
|
+
readonly shape: HoursAndMinutes["shape"];
|
|
32
|
+
readonly values: { readonly expected: number; readonly hours: number; readonly minutes: number };
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** undefined when the computed length cannot be written, or would be written as the stated one. */
|
|
36
|
+
export const computedLength = (computedMinutes: number, statedMinutes: number): ComputedLength | undefined => {
|
|
37
|
+
const length = hoursAndMinutes(computedMinutes);
|
|
38
|
+
if (length === undefined || readsTheSame(computedMinutes, statedMinutes)) return undefined;
|
|
39
|
+
const expected = Math.round((computedMinutes / MINUTES_PER_HOUR) * HOUR_DECIMALS) / HOUR_DECIMALS;
|
|
40
|
+
return { shape: length.shape, values: { expected, hours: length.hours, minutes: length.minutes } };
|
|
41
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
3
|
+
|
|
4
|
+
/** A figure joined to its unit by a hyphen ("a 3-month trial", "a 2-night, 3-day tour"), with the unit as written in the list. */
|
|
5
|
+
export type HyphenatedCount = Span & { readonly amount: number; readonly unit: string; readonly attributive: true };
|
|
6
|
+
|
|
7
|
+
const HYPHENS = "[-‐‑]";
|
|
8
|
+
|
|
9
|
+
const alternation = (units: readonly string[]): string =>
|
|
10
|
+
units
|
|
11
|
+
.filter((unit) => unit !== "")
|
|
12
|
+
.toSorted((left, right) => right.length - left.length)
|
|
13
|
+
.map(escapeRegExp)
|
|
14
|
+
.join("|");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Figures in digits joined by a hyphen to one of the units. The unit ends the word: "3-month-old" is an age and "3-monthly"
|
|
18
|
+
* another word, and a figure inside a longer number or word ("2026-04-3-day", "v2-day") is not a count. Pure.
|
|
19
|
+
*/
|
|
20
|
+
export const hyphenatedCounts = (text: string, units: readonly string[]): HyphenatedCount[] => {
|
|
21
|
+
const words = alternation(units);
|
|
22
|
+
if (words === "") return [];
|
|
23
|
+
const pattern = new RegExp(`(?<![\\p{L}\\p{N}\\p{Pd}.,])(\\p{Nd}+)${HYPHENS}(${words})(?![\\p{L}\\p{N}\\p{Pd}])`, "giu");
|
|
24
|
+
return [...text.matchAll(pattern)].flatMap((match): HyphenatedCount[] => {
|
|
25
|
+
const unit = units.find((candidate) => candidate.toLowerCase() === (match[2] ?? "").toLowerCase());
|
|
26
|
+
return unit === undefined
|
|
27
|
+
? []
|
|
28
|
+
: [{ start: match.index, end: match.index + match[0].length, amount: Number((match[1] ?? "").normalize("NFKC")), unit, attributive: true }];
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** The text before an attributive count without the article its noun takes ("up to a" → "up to"): a rough mark stands before it. Pure. */
|
|
33
|
+
export const withoutArticle = (before: string, articles: readonly string[]): string => {
|
|
34
|
+
const trimmed = before.trimEnd();
|
|
35
|
+
const lower = trimmed.toLowerCase();
|
|
36
|
+
const article = articles.find((word) => word !== "" && (lower === word.toLowerCase() || lower.endsWith(` ${word.toLowerCase()}`)));
|
|
37
|
+
return article === undefined ? trimmed : trimmed.slice(0, trimmed.length - article.length).trimEnd();
|
|
38
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
3
|
+
import { withoutTrailingWeekday, type RangeWords } from "../structure/date-range.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 日付が三つ以上ある文で、始まりと終わりを語で印した二つ(「お買い上げ日が7月1日の場合、7月1日から12か月(7月31日まで)」)。
|
|
7
|
+
* 始まりの印は、日付の後ろの開きの語(から)か、前の枠の前の語(from)。終わりの印は、後ろの閉じの語(まで)か、前のつなぎの語
|
|
8
|
+
* (〜、until)や枠の間の語(to)、または期間のすぐ後ろで開いた括弧。語は語彙表(range-opener、range-closer、range-connector、
|
|
9
|
+
* range-frame)から受け取る。
|
|
10
|
+
*/
|
|
11
|
+
export type MarkText = { readonly source: string; readonly range: RangeWords };
|
|
12
|
+
|
|
13
|
+
/** 印の語を探す、日付の前後の字数。印の語はこれより短い。 */
|
|
14
|
+
const MARK_REACH = 40;
|
|
15
|
+
const OPEN_BRACKETS: readonly string[] = ["(", "("];
|
|
16
|
+
const CLOSE_BRACKETS: readonly string[] = [")", ")"];
|
|
17
|
+
const LATIN = /\p{Script=Latin}/u;
|
|
18
|
+
|
|
19
|
+
/** 語が書いてあるか。ラテン文字の端は、隣がラテン文字でないときだけ("from" は "therefrom" の終わりではない)。 */
|
|
20
|
+
const hasWord = (text: string, word: string, where: "start" | "end" | "anywhere"): boolean => {
|
|
21
|
+
if (word === "") return false;
|
|
22
|
+
const head = LATIN.test(word.charAt(0)) ? "(?<!\\p{Script=Latin})" : "";
|
|
23
|
+
const tail = LATIN.test(word.at(-1) ?? "") ? "(?!\\p{Script=Latin})" : "";
|
|
24
|
+
const body = `${head}${escapeRegExp(word)}${tail}`;
|
|
25
|
+
const anchored = { start: `^${body}`, end: `${body}$`, anywhere: body }[where];
|
|
26
|
+
return new RegExp(anchored, "iu").test(text);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const before = (text: MarkText, date: Span): string =>
|
|
30
|
+
withoutTrailingWeekday(text.source.slice(Math.max(0, date.start - MARK_REACH), date.start).trimEnd(), text.range.weekdays ?? []);
|
|
31
|
+
|
|
32
|
+
const after = (text: MarkText, date: Span): string => text.source.slice(date.end, date.end + MARK_REACH).trimStart();
|
|
33
|
+
|
|
34
|
+
const isStart = (text: MarkText, date: Span): boolean =>
|
|
35
|
+
text.range.openers.some((word) => hasWord(after(text, date), word, "start")) ||
|
|
36
|
+
text.range.frames.some((frame) => hasWord(before(text, date), frame.lead, "end"));
|
|
37
|
+
|
|
38
|
+
/** 期間のすぐ後ろの括弧が、日付だけを囲む(12か月(2027年6月30日))。日付で始まる注((May 15, 2026 billing notice))は終わりではない。 */
|
|
39
|
+
const bracketAfterLength = (text: MarkText, date: Span, length: Span): boolean =>
|
|
40
|
+
length.end <= date.start &&
|
|
41
|
+
OPEN_BRACKETS.includes(text.source.slice(length.end, date.start).trim()) &&
|
|
42
|
+
CLOSE_BRACKETS.some((bracket) => after(text, date).startsWith(bracket));
|
|
43
|
+
|
|
44
|
+
/** 文に変更の語(moved、postponed)があれば、日付を動かした文で、期間ではない。 */
|
|
45
|
+
const isChange = (text: MarkText, sentence: Span): boolean =>
|
|
46
|
+
text.range.changes.some((word) => hasWord(text.source.slice(sentence.start, sentence.end), word, "anywhere"));
|
|
47
|
+
|
|
48
|
+
const isEnd = (text: MarkText, date: Span, length: Span): boolean =>
|
|
49
|
+
text.range.closers.some((word) => hasWord(after(text, date), word, "start")) ||
|
|
50
|
+
[...text.range.connectors, ...text.range.frames.map((frame) => frame.joint)].some((word) => hasWord(before(text, date), word, "end")) ||
|
|
51
|
+
bracketAfterLength(text, date, length);
|
|
52
|
+
|
|
53
|
+
/** 始まりの印の日付と終わりの印の日付が一つずつで、別の日付のときだけ、その組。 */
|
|
54
|
+
export const markedPair = <T extends Span>(text: MarkText, sentence: Span, dates: readonly T[], length: Span): readonly [T, T] | undefined => {
|
|
55
|
+
if (isChange(text, sentence)) return undefined;
|
|
56
|
+
const starts = dates.filter((date) => isStart(text, date));
|
|
57
|
+
const ends = dates.filter((date) => isEnd(text, date, length));
|
|
58
|
+
const [start] = starts;
|
|
59
|
+
const [end] = ends;
|
|
60
|
+
return starts.length === 1 && ends.length === 1 && start !== undefined && end !== undefined && start !== end ? [start, end] : undefined;
|
|
61
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
|
|
3
|
+
/** A currency mark from the currency-notation lexicon and the side of the number it is written on. */
|
|
4
|
+
export type CurrencyMark = { readonly pattern: string; readonly before: boolean };
|
|
5
|
+
|
|
6
|
+
/** Whether the amount at span is money: a currency mark right before its number (¥1,000, $5) or as its unit (3,000円, 10 USD). */
|
|
7
|
+
export const isMoneySpan = (text: string, span: Span, unit: string, marks: readonly CurrencyMark[]): boolean => {
|
|
8
|
+
const before = text.slice(0, span.start).trimEnd();
|
|
9
|
+
return marks.some((mark) => (mark.before ? before.endsWith(mark.pattern) : unit === mark.pattern));
|
|
10
|
+
};
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
import type { DurationUnit } from "./date-arithmetic.ts";
|
|
3
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 期間の一部として書いた期間(「保証期間(12か月)のうち、無料交換期間は18か月」"Within the 12-month warranty period, the free
|
|
7
|
+
* replacement period is 18 months")が、全体より長い所。全体の長さは、印の前後に書いた長さ(括弧の中、名詞の前)を読み、無ければ
|
|
8
|
+
* 同じ節で全体の名前(保証期間)に書いた長さを読む。「このうち」"within it" は前の文の長さ。目安の長さ、幅のある長さ、延長や追加の期間
|
|
9
|
+
* (全体の後に来る期間)は比べない。年と月、週と日の間だけ換算する。
|
|
10
|
+
*/
|
|
11
|
+
export type PeriodLength = Span & { readonly amount: number; readonly unit: DurationUnit };
|
|
12
|
+
|
|
13
|
+
/** 全体と部分をつなぐ印。position は全体から見た印の側(のうち は全体の後ろ after、within the は前 before)。 */
|
|
14
|
+
export type PartMarker = { readonly pattern: string; readonly position: "before" | "after"; readonly group?: string | undefined };
|
|
15
|
+
|
|
16
|
+
export type PlacedWord = { readonly pattern: string; readonly position: "before" | "after" };
|
|
17
|
+
|
|
18
|
+
export type PeriodPartWords = {
|
|
19
|
+
readonly markers: readonly PartMarker[];
|
|
20
|
+
/** 期間の名前の終わりの語(期間、period)。 */
|
|
21
|
+
readonly periodWords: readonly string[];
|
|
22
|
+
/** 全体の後に来る期間の語(延長、extended)。文にあれば読まない。 */
|
|
23
|
+
readonly afterWords: readonly string[];
|
|
24
|
+
/** 名前の後ろで長さを言う語(the warranty runs for 12 months の runs for)。 */
|
|
25
|
+
readonly lengthVerbs: readonly string[];
|
|
26
|
+
readonly approximate: readonly PlacedWord[];
|
|
27
|
+
readonly rangeJoiners: readonly string[];
|
|
28
|
+
/** 長さと名前の間に置く語(12か月の保証期間 の の)。空白だけの間はいつでもよい。 */
|
|
29
|
+
readonly inlineJoiners: readonly string[];
|
|
30
|
+
/** 期間の語の前に来ても名前にならない語(the period、that period)。 */
|
|
31
|
+
readonly unnamed: readonly string[];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type PeriodPartIssue = { readonly part: PeriodLength; readonly whole: PeriodLength };
|
|
35
|
+
|
|
36
|
+
/** 印の group。anaphor は前の文の期間を全体にする(このうち)。adjacent は部分を印のすぐ前に書く(18 months of the warranty)。 */
|
|
37
|
+
const ANAPHOR = "anaphor";
|
|
38
|
+
const ADJACENT = "adjacent";
|
|
39
|
+
|
|
40
|
+
type Whole = { readonly phrase: Span; readonly label: string; readonly inline: PeriodLength | undefined };
|
|
41
|
+
|
|
42
|
+
const NEAR = 12;
|
|
43
|
+
const JA_LABEL_CHAR = /^[\p{Script=Han}\p{Script=Katakana}ー]$/u;
|
|
44
|
+
|
|
45
|
+
/** text の終わりの、漢字と片仮名の続き(「本体の保証期間」の 保証期間)。 */
|
|
46
|
+
const labelRunAtEnd = (text: string): string => {
|
|
47
|
+
let start = text.length;
|
|
48
|
+
while (start > 0 && JA_LABEL_CHAR.test(text.charAt(start - 1))) start -= 1;
|
|
49
|
+
return text.slice(start);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** text の頭の、漢字と片仮名の続き(「無料修理期間は」の 無料修理期間)。 */
|
|
53
|
+
const labelRunAtStart = (text: string): string => {
|
|
54
|
+
let end = 0;
|
|
55
|
+
while (end < text.length && JA_LABEL_CHAR.test(text.charAt(end))) end += 1;
|
|
56
|
+
return text.slice(0, end);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** text の終わりの語("the free replacement " の replacement)。 */
|
|
60
|
+
const wordAtEnd = (text: string): string => {
|
|
61
|
+
const trimmed = text.trimEnd();
|
|
62
|
+
let start = trimmed.length;
|
|
63
|
+
while (start > 0 && LETTER.test(trimmed.charAt(start - 1))) start -= 1;
|
|
64
|
+
return trimmed.slice(start);
|
|
65
|
+
};
|
|
66
|
+
const LETTER = /\p{L}/u;
|
|
67
|
+
const BRACKET_PAIRS: Readonly<Record<string, string>> = { ")": "(", ")": "(" };
|
|
68
|
+
const MONTHS_PER_YEAR = 12;
|
|
69
|
+
const DAYS_PER_WEEK = 7;
|
|
70
|
+
|
|
71
|
+
const lower = (text: string): string => text.toLowerCase();
|
|
72
|
+
const includesWord = (text: string, words: readonly string[]): boolean => words.some((word) => word !== "" && lower(text).includes(lower(word)));
|
|
73
|
+
|
|
74
|
+
const BARE_NUMBER = /\p{Nd}$/u;
|
|
75
|
+
|
|
76
|
+
/** 幅の端(12〜18か月、12 to 18 months、12か月から18か月)。つなぐ語の向こうに数だけか、別の長さがある。 */
|
|
77
|
+
const isRange = (source: string, length: Span, lengths: readonly Span[], joiners: readonly string[]): boolean =>
|
|
78
|
+
joiners.some((joiner) => {
|
|
79
|
+
if (joiner === "") return false;
|
|
80
|
+
const before = lower(source.slice(Math.max(0, length.start - NEAR), length.start).trimEnd());
|
|
81
|
+
const head = before.endsWith(lower(joiner)) ? source.slice(0, length.start).trimEnd().slice(0, -joiner.length).trimEnd() : undefined;
|
|
82
|
+
const opens = head !== undefined && (BARE_NUMBER.test(head) || lengths.some((other) => other.end === head.length));
|
|
83
|
+
const after = source.slice(length.end, length.end + NEAR);
|
|
84
|
+
const rest = after.trimStart();
|
|
85
|
+
const tail = rest.slice(joiner.length);
|
|
86
|
+
const tailAt = length.end + (after.length - rest.length) + joiner.length + (tail.length - tail.trimStart().length);
|
|
87
|
+
const closes = lower(rest).startsWith(lower(joiner)) && lengths.some((other) => other.start === tailAt);
|
|
88
|
+
return opens || closes;
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
/** 約18か月、18か月程度、up to 18 months、12〜18か月、12 to 18 months。 */
|
|
92
|
+
const isRough = (source: string, length: Span, lengths: readonly Span[], words: PeriodPartWords): boolean => {
|
|
93
|
+
const before = lower(source.slice(Math.max(0, length.start - NEAR), length.start).trimEnd());
|
|
94
|
+
const after = lower(source.slice(length.end, length.end + NEAR).trimStart());
|
|
95
|
+
const marked = words.approximate.some((word) => (word.position === "before" ? before.endsWith(lower(word.pattern)) : after.startsWith(lower(word.pattern))));
|
|
96
|
+
return marked || isRange(source, length, lengths, words.rangeJoiners);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const within = (span: Span, outer: Span): boolean => span.start >= outer.start && span.end <= outer.end;
|
|
100
|
+
const lengthsIn = (lengths: readonly PeriodLength[], span: Span): PeriodLength[] => lengths.filter((length) => within(length, span));
|
|
101
|
+
|
|
102
|
+
/** 名前のすぐ前に書いた長さ(12か月の保証期間、12-month warranty period)。 */
|
|
103
|
+
const lengthJustBefore = (source: string, lengths: readonly PeriodLength[], at: number, joiners: readonly string[]): PeriodLength | undefined =>
|
|
104
|
+
lengths.find((length) => {
|
|
105
|
+
const gap = source.slice(length.end, at).trim();
|
|
106
|
+
return length.end <= at && (gap === "" || joiners.includes(gap));
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const endsWithPeriodWord = (label: string, words: PeriodPartWords): boolean =>
|
|
110
|
+
words.periodWords.some((word) => word !== "" && lower(label).endsWith(lower(word)) && label.length > word.length);
|
|
111
|
+
|
|
112
|
+
/** 括弧の始まり(「保証期間(12か月)」の ()。閉じ括弧で終わらなければ undefined。 */
|
|
113
|
+
const bracketStart = (source: string, start: number, end: number): number | undefined => {
|
|
114
|
+
const opener = BRACKET_PAIRS[source.charAt(end - 1)];
|
|
115
|
+
if (opener === undefined) return undefined;
|
|
116
|
+
const at = source.lastIndexOf(opener, end - 1);
|
|
117
|
+
return at >= start ? at : undefined;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/** 全体を印の前に書いたもの(保証期間(12か月)のうち)。名前は漢字と片仮名の続き。 */
|
|
121
|
+
const wholeBefore = (source: string, unit: Span, markerAt: number, lengths: readonly PeriodLength[], words: PeriodPartWords): Whole | undefined => {
|
|
122
|
+
const bracket = bracketStart(source, unit.start, markerAt);
|
|
123
|
+
const labelEnd = bracket ?? markerAt;
|
|
124
|
+
const label = labelRunAtEnd(source.slice(unit.start, labelEnd));
|
|
125
|
+
if (!endsWithPeriodWord(label, words)) return undefined;
|
|
126
|
+
const labelStart = labelEnd - label.length;
|
|
127
|
+
const inBracket = bracket === undefined ? [] : lengthsIn(lengths, { start: bracket, end: markerAt });
|
|
128
|
+
const inline = inBracket[0] ?? lengthJustBefore(source, lengths, labelStart, words.inlineJoiners);
|
|
129
|
+
return { phrase: { start: inline === undefined ? labelStart : Math.min(inline.start, labelStart), end: markerAt }, label, inline };
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const labelPattern = (words: PeriodPartWords): RegExp => {
|
|
133
|
+
const ends = words.periodWords
|
|
134
|
+
.filter((word) => word !== "")
|
|
135
|
+
.map(escapeRegExp)
|
|
136
|
+
.join("|");
|
|
137
|
+
return new RegExp(`^((?:\\p{L}+ ){0,3}?(?:${ends}))(?!\\p{L})(\\s*\\([^)]*\\))?`, "iu");
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/** 全体を印の後ろに書いたもの(within the 12-month warranty period、within the warranty period (12 months))。 */
|
|
141
|
+
const wholeAfter = (source: string, unit: Span, markerEnd: number, lengths: readonly PeriodLength[], words: PeriodPartWords): Whole | undefined => {
|
|
142
|
+
const gap = source.slice(markerEnd, unit.end).length - source.slice(markerEnd, unit.end).trimStart().length;
|
|
143
|
+
const lead = lengths.find((length) => length.start === markerEnd + gap);
|
|
144
|
+
const afterLead = lead === undefined ? "" : source.slice(lead.end, unit.end);
|
|
145
|
+
const labelAt = lead === undefined ? markerEnd + gap : lead.end + afterLead.length - afterLead.trimStart().length;
|
|
146
|
+
const match = labelPattern(words).exec(source.slice(labelAt, unit.end));
|
|
147
|
+
if (words.periodWords.length === 0 || match === null) return undefined;
|
|
148
|
+
const end = labelAt + match[0].length;
|
|
149
|
+
const inBracket = lengthsIn(lengths, { start: labelAt + (match[1] ?? "").length, end });
|
|
150
|
+
return { phrase: { start: markerEnd, end }, label: match[1] ?? "", inline: lead ?? inBracket[0] };
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const occurrences = (text: string, pattern: string): number[] => {
|
|
154
|
+
const found: number[] = [];
|
|
155
|
+
let at = text.indexOf(pattern);
|
|
156
|
+
while (pattern !== "" && at !== -1) {
|
|
157
|
+
found.push(at);
|
|
158
|
+
at = text.indexOf(pattern, at + pattern.length);
|
|
159
|
+
}
|
|
160
|
+
return found;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
type MarkerAt = { readonly marker: PartMarker; readonly start: number; readonly end: number };
|
|
164
|
+
|
|
165
|
+
const LATIN = /[a-z]/iu;
|
|
166
|
+
|
|
167
|
+
/** 英字の印は語の途中で切らない(within the の前後が英字なら別の語)。 */
|
|
168
|
+
const cutsWord = (source: string, start: number, end: number, pattern: string): boolean =>
|
|
169
|
+
LATIN.test(pattern) && (LETTER.test(source.charAt(start - 1)) || LETTER.test(source.charAt(end)));
|
|
170
|
+
|
|
171
|
+
const markersIn = (source: string, unit: Span, markers: readonly PartMarker[]): MarkerAt[] => {
|
|
172
|
+
const text = lower(source.slice(unit.start, unit.end));
|
|
173
|
+
return markers.flatMap((marker) =>
|
|
174
|
+
occurrences(text, lower(marker.pattern))
|
|
175
|
+
.map((at) => ({ marker, start: unit.start + at, end: unit.start + at + marker.pattern.length }))
|
|
176
|
+
.filter((found) => !cutsWord(source, found.start, found.end, marker.pattern)),
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export type PeriodPartInput = {
|
|
181
|
+
readonly source: string;
|
|
182
|
+
/** 文と表の行。出てくる順。 */
|
|
183
|
+
readonly units: readonly Span[];
|
|
184
|
+
/** 節の始まり(見出しの位置)。 */
|
|
185
|
+
readonly sectionStarts: readonly number[];
|
|
186
|
+
readonly lengths: readonly PeriodLength[];
|
|
187
|
+
readonly words: PeriodPartWords;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/** 昇順の節の始まりのうち、at 以前のものの数(二分探索)。大きな文書で節を引くたびに見出しを全部回らないため。 */
|
|
191
|
+
const sectionOf = (starts: readonly number[], at: number): number => {
|
|
192
|
+
let low = 0;
|
|
193
|
+
let high = starts.length;
|
|
194
|
+
while (low < high) {
|
|
195
|
+
const middle = (low + high) >> 1;
|
|
196
|
+
if ((starts[middle] ?? Number.POSITIVE_INFINITY) <= at) low = middle + 1;
|
|
197
|
+
else high = middle;
|
|
198
|
+
}
|
|
199
|
+
return low;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
/** 年は月に、週は日に揃える。月と日の間は月の日数が決まらないので比べない。 */
|
|
203
|
+
const scaleOf = (length: PeriodLength): { readonly family: string; readonly amount: number } => {
|
|
204
|
+
if (length.unit === "year") return { family: "month", amount: length.amount * MONTHS_PER_YEAR };
|
|
205
|
+
if (length.unit === "week") return { family: "day", amount: length.amount * DAYS_PER_WEEK };
|
|
206
|
+
return { family: length.unit, amount: length.amount };
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const isLonger = (part: PeriodLength, whole: PeriodLength): boolean => {
|
|
210
|
+
const [left, right] = [scaleOf(part), scaleOf(whole)];
|
|
211
|
+
return left.family === right.family && left.amount > right.amount;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/** 名前の前が同じ語の続き(無料修理期間の 修理期間、extended warranty period)なら、別の期間の名前。 */
|
|
215
|
+
const isWholeName = (source: string, at: number, label: string, words: PeriodPartWords): boolean => {
|
|
216
|
+
const before = source.charAt(at - 1);
|
|
217
|
+
const joined = JA_LABEL_CHAR.test(before) && JA_LABEL_CHAR.test(label.charAt(0));
|
|
218
|
+
const inWord = LETTER.test(before) && LATIN.test(label.charAt(0));
|
|
219
|
+
return !joined && !inWord && !includesWord(source.slice(Math.max(0, at - NEAR), at), words.afterWords);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/** 一つの文か行で、全体の名前の後ろに書いた長さ。名前の後ろに長さが一つだけのとき。 */
|
|
223
|
+
const statedLength = (input: PeriodPartInput, unit: Span, label: string): PeriodLength | undefined => {
|
|
224
|
+
const { source, lengths, words } = input;
|
|
225
|
+
const named = occurrences(lower(source.slice(unit.start, unit.end)), lower(label))
|
|
226
|
+
.map((at) => unit.start + at)
|
|
227
|
+
.find((at) => isWholeName(source, at, label, words));
|
|
228
|
+
if (named === undefined) return undefined;
|
|
229
|
+
const after = lengthsIn(lengths, { start: named + label.length, end: unit.end });
|
|
230
|
+
const [only] = after;
|
|
231
|
+
return after.length === 1 && only !== undefined && !isRough(source, only, lengths, words) ? only : undefined;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/** the warranty runs for 12 months: 名前から期間の語を除いた語、長さを言う語、長さが続けて並ぶ。 */
|
|
235
|
+
const verbLength = (input: PeriodPartInput, unit: Span, label: string): PeriodLength | undefined => {
|
|
236
|
+
const { source, lengths, words } = input;
|
|
237
|
+
const end = words.periodWords.find((word) => lower(label).endsWith(lower(word)));
|
|
238
|
+
const stem = end === undefined ? "" : label.slice(0, -end.length).trim();
|
|
239
|
+
if (stem === "") return undefined;
|
|
240
|
+
const text = lower(source.slice(unit.start, unit.end));
|
|
241
|
+
return words.lengthVerbs.flatMap((verb) => {
|
|
242
|
+
const phrase = lower(`${stem} ${verb}`);
|
|
243
|
+
return occurrences(text, phrase).flatMap((at) => {
|
|
244
|
+
const from = unit.start + at + phrase.length;
|
|
245
|
+
const next = lengths.find((length) => length.start >= from && source.slice(from, length.start).trim() === "");
|
|
246
|
+
return next === undefined || isRough(source, next, lengths, words) ? [] : [next];
|
|
247
|
+
});
|
|
248
|
+
})[0];
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const hasMarker = (input: PeriodPartInput, unit: Span): boolean => markersIn(input.source, unit, input.words.markers).length > 0;
|
|
252
|
+
|
|
253
|
+
/** 同じ節で全体の名前に書いた長さ。違う長さが並べば一番長いもの(どれより長いときだけ言う)。 */
|
|
254
|
+
const wholeInSection = (input: PeriodPartInput, current: Span, label: string): PeriodLength[] => {
|
|
255
|
+
const section = sectionOf(input.sectionStarts, current.start);
|
|
256
|
+
return input.units
|
|
257
|
+
.filter((unit) => unit !== current && sectionOf(input.sectionStarts, unit.start) === section && !hasMarker(input, unit))
|
|
258
|
+
.flatMap((unit) => {
|
|
259
|
+
const stated = statedLength(input, unit, label) ?? verbLength(input, unit, label);
|
|
260
|
+
return stated === undefined ? [] : [stated];
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/** このうち: すぐ前の文が、期間の語と長さ一つを持つとき、その長さ。 */
|
|
265
|
+
const previousWhole = (input: PeriodPartInput, index: number): PeriodLength[] => {
|
|
266
|
+
const [previous, current] = [input.units[index - 1], input.units[index]];
|
|
267
|
+
if (previous === undefined || current === undefined) return [];
|
|
268
|
+
if (sectionOf(input.sectionStarts, previous.start) !== sectionOf(input.sectionStarts, current.start)) return [];
|
|
269
|
+
const inPrevious = lengthsIn(input.lengths, previous);
|
|
270
|
+
const [only] = inPrevious;
|
|
271
|
+
const named = includesWord(input.source.slice(previous.start, previous.end), input.words.periodWords);
|
|
272
|
+
return inPrevious.length === 1 && only !== undefined && named && !isRough(input.source, only, input.lengths, input.words) ? [only] : [];
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
const wholeOf = (input: PeriodPartInput, unit: Span, found: MarkerAt): Whole | undefined =>
|
|
276
|
+
found.marker.position === "after"
|
|
277
|
+
? wholeBefore(input.source, unit, found.start, input.lengths, input.words)
|
|
278
|
+
: wholeAfter(input.source, unit, found.end, input.lengths, input.words);
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* 全体と別の名前の付いた期間(無料交換期間、the free replacement period)。the period of 21 days のような名前の無い期間と、全体の名前を
|
|
282
|
+
* もう一度書いたもの(submit the warranty period claim form)は部分と読まない。
|
|
283
|
+
*/
|
|
284
|
+
const namesPeriod = (text: string, words: PeriodPartWords, wholeLabel: string): boolean =>
|
|
285
|
+
words.periodWords.some((word) =>
|
|
286
|
+
occurrences(lower(text), lower(word)).some((at) => {
|
|
287
|
+
const upTo = text.slice(0, at + word.length);
|
|
288
|
+
if (LATIN.test(word)) {
|
|
289
|
+
const before = wordAtEnd(text.slice(0, at));
|
|
290
|
+
const named = before !== "" && !LETTER.test(text.charAt(at - 1)) && !words.unnamed.some((unnamed) => lower(unnamed) === lower(before));
|
|
291
|
+
return named && (wholeLabel === "" || !lower(upTo).endsWith(lower(wholeLabel)));
|
|
292
|
+
}
|
|
293
|
+
return JA_LABEL_CHAR.test(text.charAt(at - 1)) && labelRunAtEnd(upTo) !== wholeLabel;
|
|
294
|
+
}),
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
/** 部分の長さ: 全体の句の外に長さがちょうど一つ。adjacent の印では印のすぐ前、他は全体の外に期間の語があること。 */
|
|
298
|
+
const partOf = (input: PeriodPartInput, unit: Span, whole: Whole, found: MarkerAt): PeriodLength | undefined => {
|
|
299
|
+
const { phrase } = whole;
|
|
300
|
+
const { source, words } = input;
|
|
301
|
+
const outside = lengthsIn(input.lengths, unit).filter((length) => length.end <= phrase.start || length.start >= phrase.end);
|
|
302
|
+
const [part] = outside;
|
|
303
|
+
if (outside.length !== 1 || part === undefined || isRough(source, part, input.lengths, words)) return undefined;
|
|
304
|
+
if (found.marker.group === ADJACENT) return source.slice(part.end, found.start).trim() === "" ? part : undefined;
|
|
305
|
+
const rest = source.slice(unit.start, phrase.start) + source.slice(phrase.end, unit.end);
|
|
306
|
+
return namesPeriod(rest, words, whole.label) ? part : undefined;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
const CLAUSE_COMMAS = ["、", ",", ","];
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* 全体の句が節を開く(保証期間のうち、… / Within the warranty period, …)。前に置く印は文の頭で句の後ろに読点、後ろに置く印は
|
|
313
|
+
* すぐ後ろが読点か期間の名前(保証期間内の無料修理期間)。Claims arising within the 12-month warranty period are subject to a
|
|
314
|
+
* limitation period of 18 months の句は請求を修飾していて、制限期間はその一部ではない。
|
|
315
|
+
*/
|
|
316
|
+
const opensClause = (input: PeriodPartInput, unit: Span, phrase: Span, found: MarkerAt): boolean => {
|
|
317
|
+
const { source, words } = input;
|
|
318
|
+
if (found.marker.position === "before") {
|
|
319
|
+
const followedByComma = CLAUSE_COMMAS.some((comma) => source.slice(phrase.end).trimStart().startsWith(comma));
|
|
320
|
+
return source.slice(unit.start, found.start).trim() === "" && followedByComma;
|
|
321
|
+
}
|
|
322
|
+
const after = source.slice(found.end, unit.end);
|
|
323
|
+
return CLAUSE_COMMAS.some((comma) => after.startsWith(comma)) || endsWithPeriodWord(labelRunAtStart(after), words);
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
const issuesAt = (input: PeriodPartInput, index: number, found: MarkerAt): PeriodPartIssue[] => {
|
|
327
|
+
const unit = input.units[index];
|
|
328
|
+
if (unit === undefined) return [];
|
|
329
|
+
const anaphor = found.marker.group === ANAPHOR;
|
|
330
|
+
const whole = anaphor ? { phrase: { start: found.start, end: found.end }, label: "", inline: undefined } : wholeOf(input, unit, found);
|
|
331
|
+
if (whole === undefined || (found.marker.group !== ADJACENT && !opensClause(input, unit, whole.phrase, found))) return [];
|
|
332
|
+
const part = partOf(input, unit, whole, found);
|
|
333
|
+
if (part === undefined) return [];
|
|
334
|
+
const inlineWholes = whole.inline === undefined || isRough(input.source, whole.inline, input.lengths, input.words) ? [] : [whole.inline];
|
|
335
|
+
const named = whole.inline === undefined ? wholeInSection(input, unit, whole.label) : inlineWholes;
|
|
336
|
+
const wholes = anaphor ? previousWhole(input, index) : named;
|
|
337
|
+
const [first] = wholes;
|
|
338
|
+
if (first === undefined || !wholes.every((candidate) => isLonger(part, candidate))) return [];
|
|
339
|
+
const longest = wholes.reduce((left, right) => (scaleOf(right).amount > scaleOf(left).amount ? right : left), first);
|
|
340
|
+
return [{ part, whole: longest }];
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
/** 全体より長い部分の期間。一つの文に印が二つあっても、言うのは一度。 */
|
|
344
|
+
export const periodPartIssues = (input: PeriodPartInput): PeriodPartIssue[] =>
|
|
345
|
+
input.units.flatMap((unit, index) => {
|
|
346
|
+
if (includesWord(input.source.slice(unit.start, unit.end), input.words.afterWords)) return [];
|
|
347
|
+
const [issue] = markersIn(input.source, unit, input.words.markers).flatMap((found) => issuesAt(input, index, found));
|
|
348
|
+
return issue === undefined ? [] : [issue];
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
const TABLE_ROW = /^\s*\|.*\|\s*$/u;
|
|
352
|
+
const TABLE_RULE = /^[\s|:-]+$/u;
|
|
353
|
+
|
|
354
|
+
const LINE = /^[^\n]*$/gmu;
|
|
355
|
+
|
|
356
|
+
/** 表の行(| 保証期間 | 1年 |)。区切りの行は除く。 */
|
|
357
|
+
export const tableRowsOf = (source: string): Span[] =>
|
|
358
|
+
[...source.matchAll(LINE)].flatMap((line) =>
|
|
359
|
+
TABLE_ROW.test(line[0]) && !TABLE_RULE.test(line[0]) ? [{ start: line.index, end: line.index + line[0].length }] : [],
|
|
360
|
+
);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A date chaff computed or read into a value (2026-06-30, 06-30, 2026-06), written for a message the way a reader writes it:
|
|
5
|
+
* 2026年6月30日, June 30, 2026, or 30 June 2026 when the document writes its English dates day first. Text a message quotes
|
|
6
|
+
* from the document never comes through here: it stays as written. Pure.
|
|
7
|
+
*/
|
|
8
|
+
export type DayOrder = "month-first" | "day-first";
|
|
9
|
+
|
|
10
|
+
/** months: the month names, January first. A language without them (or with fewer than twelve) keeps the value as it is. */
|
|
11
|
+
export type DateWords = { readonly language: string; readonly months: readonly string[]; readonly order: DayOrder };
|
|
12
|
+
|
|
13
|
+
type DateParts = { readonly year: string | undefined; readonly month: number; readonly day: number | undefined };
|
|
14
|
+
|
|
15
|
+
const FULL = /^(\d{4})-(\d{2})-(\d{2})$/u;
|
|
16
|
+
const MONTH_DAY = /^(\d{2})-(\d{2})$/u;
|
|
17
|
+
const YEAR_MONTH = /^(\d{4})-(\d{2})$/u;
|
|
18
|
+
const MONTHS_IN_YEAR = 12;
|
|
19
|
+
const LAST_DAY = 31;
|
|
20
|
+
|
|
21
|
+
const partsOf = (value: string): DateParts | undefined => {
|
|
22
|
+
const full = FULL.exec(value);
|
|
23
|
+
if (full !== null) return { year: full[1], month: Number(full[2]), day: Number(full[3]) };
|
|
24
|
+
const monthDay = MONTH_DAY.exec(value);
|
|
25
|
+
if (monthDay !== null) return { year: undefined, month: Number(monthDay[1]), day: Number(monthDay[2]) };
|
|
26
|
+
const yearMonth = YEAR_MONTH.exec(value);
|
|
27
|
+
return yearMonth === null ? undefined : { year: yearMonth[1], month: Number(yearMonth[2]), day: undefined };
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const inRange = (parts: DateParts): boolean =>
|
|
31
|
+
parts.month >= 1 && parts.month <= MONTHS_IN_YEAR && (parts.day === undefined || (parts.day >= 1 && parts.day <= LAST_DAY));
|
|
32
|
+
|
|
33
|
+
const japanese = ({ year, month, day }: DateParts): string =>
|
|
34
|
+
[year === undefined ? "" : `${year}年`, `${String(month)}月`, day === undefined ? "" : `${String(day)}日`].join("");
|
|
35
|
+
|
|
36
|
+
const english = ({ year, day }: DateParts, name: string, order: DayOrder): string => {
|
|
37
|
+
if (day === undefined) return `${name} ${year ?? ""}`.trim();
|
|
38
|
+
if (order === "day-first") return [String(day), name, ...(year === undefined ? [] : [year])].join(" ");
|
|
39
|
+
return year === undefined ? `${name} ${String(day)}` : `${name} ${String(day)}, ${year}`;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** The value as a reader writes the date; a value that is not a date (or a language without month names) is returned unchanged. */
|
|
43
|
+
export const readableDate = (value: string, words: DateWords): string => {
|
|
44
|
+
const parts = partsOf(value);
|
|
45
|
+
if (parts === undefined || !inRange(parts)) return value;
|
|
46
|
+
if (words.language === "ja") return japanese(parts);
|
|
47
|
+
const name = words.months.length >= MONTHS_IN_YEAR ? words.months[parts.month - 1] : undefined;
|
|
48
|
+
return name === undefined ? value : english(parts, name, words.order);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Whether the document writes its English dates day first ("30 June 2026") rather than month first ("June 30, 2026"): the
|
|
53
|
+
* order more of its written dates take. A tie, or no English date at all, is month first.
|
|
54
|
+
*/
|
|
55
|
+
export const dayOrderOf = (written: readonly string[], monthWords: readonly string[]): DayOrder => {
|
|
56
|
+
if (monthWords.length === 0) return "month-first";
|
|
57
|
+
const names = monthWords.map(escapeRegExp).join("|");
|
|
58
|
+
const dayFirst = new RegExp(`(?:^|[^\\d])\\d{1,2}(?:st|nd|rd|th)?\\s+(?:${names})\\b`, "u");
|
|
59
|
+
const monthFirst = new RegExp(`\\b(?:${names})\\.?\\s+\\d{1,2}(?!\\d)`, "u");
|
|
60
|
+
const dayFirstCount = written.filter((text) => dayFirst.test(text) && !monthFirst.test(text)).length;
|
|
61
|
+
const monthFirstCount = written.filter((text) => monthFirst.test(text) && !dayFirst.test(text)).length;
|
|
62
|
+
return dayFirstCount > monthFirstCount ? "day-first" : "month-first";
|
|
63
|
+
};
|
package/src/derived/stays.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Span } from "../plugin.ts";
|
|
2
2
|
import { bySentence } from "./sentence-buckets.ts";
|
|
3
3
|
import { calendarDateOf, dateOf, shifted } from "./date-arithmetic.ts";
|
|
4
|
-
import type
|
|
4
|
+
import { ATTRIBUTIVE_REACH, type DatedValue } from "./durations.ts";
|
|
5
5
|
import { cellsOf, tablesOf, type Cell } from "../facts/table-facts.ts";
|
|
6
6
|
import { linesOf } from "../structure/lines.ts";
|
|
7
7
|
import { withoutEdgeMarks } from "../facts/trim-marks.ts";
|
|
@@ -11,7 +11,11 @@ import { withoutEdgeMarks } from "../facts/trim-marks.ts";
|
|
|
11
11
|
* 一つの文に日付がちょうど二つと泊数がちょうど一つあるときと、チェックイン・チェックアウト・泊数の列がそろった表の行で比べる。
|
|
12
12
|
* 「2泊3日」のように泊数と日数を並べたものは、日数が泊数より一つ多いかを見る。Pure.
|
|
13
13
|
*/
|
|
14
|
-
export type Count = Span & {
|
|
14
|
+
export type Count = Span & {
|
|
15
|
+
readonly amount: number;
|
|
16
|
+
/** 名詞の前に書いた泊数(a 2-night package)。売り物の長さのことが多く、二つの日付の間の泊数とは限らない。 */
|
|
17
|
+
readonly attributive?: boolean;
|
|
18
|
+
};
|
|
15
19
|
|
|
16
20
|
export type NightsMismatch = { readonly start: DatedValue; readonly end: DatedValue; readonly nights: Span; readonly expected: number };
|
|
17
21
|
|
|
@@ -52,6 +56,7 @@ const nightsBetween = (first: DatedValue, second: DatedValue): Between | undefin
|
|
|
52
56
|
const mismatchOf = (first: DatedValue, second: DatedValue, nights: Count): NightsMismatch | undefined => {
|
|
53
57
|
const between = nightsBetween(first, second);
|
|
54
58
|
if (between === undefined || between.nights <= 0 || between.nights === nights.amount) return undefined;
|
|
59
|
+
if (nights.attributive === true && between.nights > nights.amount * ATTRIBUTIVE_REACH) return undefined;
|
|
55
60
|
return { start: between.start, end: between.end, nights, expected: between.nights };
|
|
56
61
|
};
|
|
57
62
|
|