chaffjs 0.31.0 → 0.33.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 +124 -255
- package/dist/cli-text.js +2 -2
- 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/cross-run.d.ts.map +1 -1
- package/dist/cross-run.js +1 -0
- package/dist/cross-run.js.map +1 -1
- 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/agreement-slip.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.js +4 -0
- package/dist/detectors/agreement-slip.js.map +1 -1
- package/dist/detectors/annual-holidays-mismatch.d.ts +3 -0
- package/dist/detectors/annual-holidays-mismatch.d.ts.map +1 -0
- package/dist/detectors/annual-holidays-mismatch.js +29 -0
- package/dist/detectors/annual-holidays-mismatch.js.map +1 -0
- package/dist/detectors/annual-pay-mismatch.d.ts +3 -0
- package/dist/detectors/annual-pay-mismatch.d.ts.map +1 -0
- package/dist/detectors/annual-pay-mismatch.js +52 -0
- package/dist/detectors/annual-pay-mismatch.js.map +1 -0
- package/dist/detectors/blank-structure.d.ts +3 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +45 -12
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/bmi-mismatch.d.ts +3 -0
- package/dist/detectors/bmi-mismatch.d.ts.map +1 -0
- package/dist/detectors/bmi-mismatch.js +70 -0
- package/dist/detectors/bmi-mismatch.js.map +1 -0
- package/dist/detectors/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/formula-amount.d.ts +3 -0
- package/dist/detectors/formula-amount.d.ts.map +1 -0
- package/dist/detectors/formula-amount.js +41 -0
- package/dist/detectors/formula-amount.js.map +1 -0
- 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 +68 -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 +37 -11
- 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/formula-amount.d.ts +3 -0
- package/dist/detectors/registry/formula-amount.d.ts.map +1 -0
- package/dist/detectors/registry/formula-amount.js +3 -0
- package/dist/detectors/registry/formula-amount.js.map +1 -0
- package/dist/detectors/registry/gpa-mismatch.d.ts +3 -0
- package/dist/detectors/registry/gpa-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/gpa-mismatch.js +3 -0
- package/dist/detectors/registry/gpa-mismatch.js.map +1 -0
- package/dist/detectors/registry/installment-total-mismatch.d.ts +3 -0
- package/dist/detectors/registry/installment-total-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/installment-total-mismatch.js +3 -0
- package/dist/detectors/registry/installment-total-mismatch.js.map +1 -0
- package/dist/detectors/registry/interest.d.ts +3 -0
- package/dist/detectors/registry/interest.d.ts.map +1 -0
- package/dist/detectors/registry/interest.js +3 -0
- package/dist/detectors/registry/interest.js.map +1 -0
- package/dist/detectors/registry/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 +1 -1
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +46 -12
- 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/eval.js +3 -3
- package/dist/eval.js.map +1 -1
- 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/fix-plan/text.js +2 -2
- package/dist/fix-plan/text.js.map +1 -1
- package/dist/lexicon-genres.d.ts +7 -0
- package/dist/lexicon-genres.d.ts.map +1 -0
- package/dist/lexicon-genres.js +8 -0
- package/dist/lexicon-genres.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 +8 -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/profile/parse.d.ts.map +1 -1
- package/dist/profile/parse.js +5 -0
- package/dist/profile/parse.js.map +1 -1
- package/dist/reference-numbers.d.ts +26 -0
- package/dist/reference-numbers.d.ts.map +1 -0
- package/dist/reference-numbers.js +43 -0
- package/dist/reference-numbers.js.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +1 -0
- package/dist/run.js.map +1 -1
- 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 +5 -3
- package/dist/structure/date-range.d.ts.map +1 -1
- package/dist/structure/date-range.js +7 -9
- 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/formula-amount.d.ts +38 -0
- package/dist/structure/formula-amount.d.ts.map +1 -0
- package/dist/structure/formula-amount.js +187 -0
- package/dist/structure/formula-amount.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-fee.d.ts +52 -0
- package/dist/structure/installment-fee.d.ts.map +1 -0
- package/dist/structure/installment-fee.js +110 -0
- package/dist/structure/installment-fee.js.map +1 -0
- package/dist/structure/installment-total.d.ts +117 -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/start-end-range.d.ts +30 -0
- package/dist/structure/start-end-range.d.ts.map +1 -0
- package/dist/structure/start-end-range.js +79 -0
- package/dist/structure/start-end-range.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 +5 -4
- package/profiles/property-sale.yaml +21 -0
- package/rules/absolute-exception.yaml +1 -1
- package/rules/ai-generated-composite.yaml +1 -1
- package/rules/ai-tell.yaml +1 -1
- package/rules/amount-range-reversed.yaml +1 -1
- package/rules/amount-scale-consistency.yaml +1 -1
- package/rules/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 +4 -4
- 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/formula-amount-mismatch.yaml +67 -0
- 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 +63 -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 +5 -5
- 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/cli-text.ts +2 -2
- 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/cross-run.ts +1 -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/agreement-slip.ts +3 -0
- package/src/detectors/annual-holidays-mismatch.ts +41 -0
- package/src/detectors/annual-pay-mismatch.ts +71 -0
- package/src/detectors/blank-structure.ts +54 -14
- package/src/detectors/bmi-mismatch.ts +82 -0
- package/src/detectors/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/formula-amount.ts +59 -0
- 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 +94 -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 +43 -11
- 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/formula-amount.ts +4 -0
- package/src/detectors/registry/gpa-mismatch.ts +4 -0
- package/src/detectors/registry/installment-total-mismatch.ts +4 -0
- package/src/detectors/registry/interest.ts +4 -0
- package/src/detectors/registry/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 +62 -12
- 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/eval.ts +3 -3
- 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/fix-plan/text.ts +2 -2
- package/src/lexicon-genres.ts +11 -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 +8 -0
- package/src/product-names.ts +98 -0
- package/src/profile/parse.ts +8 -0
- package/src/reference-numbers.ts +55 -0
- package/src/run.ts +1 -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 +9 -11
- 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/formula-amount.ts +236 -0
- package/src/structure/generic-role.ts +8 -0
- package/src/structure/gpa.ts +218 -0
- package/src/structure/installment-fee.ts +201 -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/start-end-range.ts +120 -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,22 @@
|
|
|
1
|
+
import type { DurationUnit } from "../derived/date-arithmetic.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 期間を、比べられる単位に揃えた大きさ。年は月に直す(1年 と 12か月 は同じ長さ、2年 と 12か月 は違う長さ)。
|
|
5
|
+
* 月と日、週と日は直さない: 1か月 は 28〜31日で、30日 と同じとは言えない。週と日はそのまま別の単位で、比べない。
|
|
6
|
+
*/
|
|
7
|
+
export type ScaledDuration = { readonly key: string; readonly unit: DurationUnit };
|
|
8
|
+
|
|
9
|
+
const MONTHS_PER_YEAR = 12;
|
|
10
|
+
/** 0.1年 × 12 の浮動小数の端(1.2000000000000002)を落とす桁。 */
|
|
11
|
+
const KEY_DIGITS = 1e6;
|
|
12
|
+
|
|
13
|
+
const scaledKey = (key: string, factor: number): string | undefined => {
|
|
14
|
+
const amount = key.trim() === "" ? Number.NaN : Number(key);
|
|
15
|
+
return Number.isFinite(amount) ? String(Math.round(amount * factor * KEY_DIGITS) / KEY_DIGITS) : undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const scaledDuration = (key: string, unit: DurationUnit): ScaledDuration => {
|
|
19
|
+
if (unit !== "year") return { key, unit };
|
|
20
|
+
const months = scaledKey(key, MONTHS_PER_YEAR);
|
|
21
|
+
return months === undefined ? { key, unit } : { key: months, unit: "month" };
|
|
22
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DurationUnit } from "../derived/date-arithmetic.ts";
|
|
2
|
+
import type { FactValue } from "./fact-values.ts";
|
|
3
|
+
import { scaledDuration } from "./duration-scale.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 期間の値(3 months、3ヶ月間)。木の数量は、英語では数だけ(3 の後ろの months は単位として持つ)、日本語では か月 までで 間 を含まない。
|
|
7
|
+
* 値を期間の単位の語の終わりまで延ばし、単位を期間の大きさ(month)に揃える(3ヶ月 と 6か月、1 month と 6 months を比べる)。
|
|
8
|
+
* 年は月に直して比べる(1年 と 12か月)。月と日のように長さの決まらない組は、別の単位のまま。後ろに語が続く期間(3 months ago、30 years old)は、名前付きの値の
|
|
9
|
+
* 終わり(fact-value-end)で落ちる。
|
|
10
|
+
*/
|
|
11
|
+
export type DurationWord = { readonly pattern: string; readonly unit: DurationUnit };
|
|
12
|
+
|
|
13
|
+
const folded = (text: string): string => text.normalize("NFKC").toLowerCase();
|
|
14
|
+
|
|
15
|
+
const UNIT_GAPS = new Set([" ", "\t"]);
|
|
16
|
+
|
|
17
|
+
/** 書いた単位の始まり。数のすぐ後ろか、空白一つの後ろ。木の値が単位まで含んでいれば、その単位の頭。 */
|
|
18
|
+
const unitStartOf = (source: string, value: FactValue): number | undefined => {
|
|
19
|
+
const written = folded(value.unit);
|
|
20
|
+
if (written === "") return undefined;
|
|
21
|
+
if (folded(source.slice(value.end - value.unit.length, value.end)) === written) return value.end - value.unit.length;
|
|
22
|
+
const gap = UNIT_GAPS.has(source.charAt(value.end)) ? 1 : 0;
|
|
23
|
+
return folded(source.slice(value.end + gap, value.end + gap + value.unit.length)) === written ? value.end + gap : undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const LATIN_LETTER = /[a-z]/iu;
|
|
27
|
+
|
|
28
|
+
/** 単位の頭から書いた、一番長い期間の語(ヶ月 より ヶ月間)。英字の語は語の途中で切らない。 */
|
|
29
|
+
const longestAt = (source: string, at: number, words: readonly DurationWord[]): DurationWord | undefined =>
|
|
30
|
+
words
|
|
31
|
+
.filter((word) => folded(source.slice(at, at + word.pattern.length)) === folded(word.pattern))
|
|
32
|
+
.filter((word) => !(LATIN_LETTER.test(word.pattern.slice(-1)) && LATIN_LETTER.test(source.charAt(at + word.pattern.length))))
|
|
33
|
+
.reduce<DurationWord | undefined>((longest, word) => (longest === undefined || word.pattern.length > longest.pattern.length ? word : longest), undefined);
|
|
34
|
+
|
|
35
|
+
const durationOf = (source: string, value: FactValue, words: readonly DurationWord[]): FactValue[] => {
|
|
36
|
+
if (value.kind !== "quantity" || !words.some((word) => folded(word.pattern) === folded(value.unit))) return [];
|
|
37
|
+
const at = unitStartOf(source, value);
|
|
38
|
+
const word = at === undefined ? undefined : longestAt(source, at, words);
|
|
39
|
+
return at === undefined || word === undefined ? [] : [{ ...value, end: at + word.pattern.length, ...scaledDuration(value.key, word.unit) }];
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** 期間の単位の付いた数量だけを、単位の語まで含む期間の値にして返す。 */
|
|
43
|
+
export const durationValues = (source: string, values: readonly FactValue[], words: readonly DurationWord[]): FactValue[] =>
|
|
44
|
+
values.flatMap((value) => durationOf(source, value, words));
|
package/src/facts/fact-values.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Span, StructureNode } from "../plugin.ts";
|
|
2
2
|
import { inDocumentOrder } from "../structure/issues.ts";
|
|
3
3
|
import { overlapsAny, spanIndex, type SpanIndex } from "../compare/spans.ts";
|
|
4
|
+
import { basesAgree, type RateBasis } from "./rate-values.ts";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* 値として読むもの。木の数量と日付(`chaff compare` と同じ読み)と、品詞の読める言語では固有名詞。
|
|
@@ -8,7 +9,18 @@ import { overlapsAny, spanIndex, type SpanIndex } from "../compare/spans.ts";
|
|
|
8
9
|
*/
|
|
9
10
|
export type ValueKind = "quantity" | "date" | "name";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* bound: upper なら key は上の端(満70歳まで、20 to 70 の 70)。lower は範囲の下の端(満20歳〜満70歳 の 20)。
|
|
14
|
+
* basis: 率に書いた基準(period:year、kind:fixed)。両方に書いた同じ種類の基準が違えば、別の量として比べない。
|
|
15
|
+
*/
|
|
16
|
+
export type FactValue = Span & {
|
|
17
|
+
readonly kind: ValueKind;
|
|
18
|
+
readonly key: string;
|
|
19
|
+
readonly unit: string;
|
|
20
|
+
readonly bound?: "upper";
|
|
21
|
+
readonly lower?: string;
|
|
22
|
+
readonly basis?: RateBasis;
|
|
23
|
+
};
|
|
12
24
|
|
|
13
25
|
const attr = (node: StructureNode, name: string): string => String(node.attrs[name] ?? "");
|
|
14
26
|
|
|
@@ -40,14 +52,27 @@ const nodeValue = (node: StructureNode, source: string): FactValue[] => {
|
|
|
40
52
|
|
|
41
53
|
/**
|
|
42
54
|
* 単位を書かない数(「Seats: 40」)。前後が字や数や時刻の : でないもの。1.2.3 のような版の番号は数にしない。
|
|
43
|
-
*
|
|
55
|
+
* 単位の無い数は、単位の無い数とだけ比べる。後ろのコンマは、空白と語が続くとき(2, as declared)だけ数の終わり。数が続けば
|
|
56
|
+
* 並べた数(2, 3 or 4)、一語の後ろに数が続けば別の値(3, or 4)で、空白が無ければ桁の区切りの書き損じかもしれない。
|
|
44
57
|
*/
|
|
45
|
-
const BARE_NUMBER = /(?<![\p{L}\p{N}.,:/-])[0-90-9]+(?:[,,][0-90-9]{3})*(?:[..][0-90-9]+)?(?![\p{L}\p{N}
|
|
58
|
+
const BARE_NUMBER = /(?<![\p{L}\p{N}.,:/-])[0-90-9]+(?:[,,][0-90-9]{3})*(?:[..][0-90-9]+)?(?![\p{L}\p{N}%:/-]|[..][0-90-9])/gu;
|
|
59
|
+
const COMMA = /^[,,]$/u;
|
|
60
|
+
const CLAUSE_AFTER_COMMA = /[,,]\s+\p{L}/uy;
|
|
61
|
+
const VALUE_AFTER_COMMA_WORD = /[,,]\s+\p{L}+\s+[0-90-9]/uy;
|
|
62
|
+
|
|
63
|
+
const matchesAt = (pattern: RegExp, source: string, offset: number): boolean => {
|
|
64
|
+
pattern.lastIndex = offset;
|
|
65
|
+
return pattern.test(source);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** 数の後ろのコンマが、文の続き(, as declared)の頭か。コンマが無ければ終わり。 */
|
|
69
|
+
const endsBeforeComma = (source: string, end: number): boolean =>
|
|
70
|
+
!COMMA.test(source.charAt(end)) || (matchesAt(CLAUSE_AFTER_COMMA, source, end) && !matchesAt(VALUE_AFTER_COMMA_WORD, source, end));
|
|
46
71
|
|
|
47
72
|
const bareValues = (source: string, taken: SpanIndex): FactValue[] =>
|
|
48
73
|
[...source.matchAll(BARE_NUMBER)].flatMap((match): FactValue[] => {
|
|
49
74
|
const span = { start: match.index, end: match.index + match[0].length };
|
|
50
|
-
if (overlapsAny(taken, span)) return [];
|
|
75
|
+
if (!endsBeforeComma(source, span.end) || overlapsAny(taken, span)) return [];
|
|
51
76
|
const key = String(Number(match[0].normalize("NFKC").replace(/,/gu, "")));
|
|
52
77
|
return [{ ...span, kind: "quantity", key, unit: "" }];
|
|
53
78
|
});
|
|
@@ -95,16 +120,20 @@ const comparableDates = (left: string, right: string): [string, string] | undefi
|
|
|
95
120
|
return pair === undefined ? undefined : [pair[1], pair[0]];
|
|
96
121
|
};
|
|
97
122
|
|
|
123
|
+
/** 範囲は、上の端を言う値(上限か範囲)とだけ比べる。範囲の中のどれかの数(一人の年齢)とは比べない。 */
|
|
124
|
+
const comparableBounds = (left: FactValue, right: FactValue): boolean =>
|
|
125
|
+
(left.lower === undefined || right.bound === "upper") && (right.lower === undefined || left.bound === "upper");
|
|
126
|
+
|
|
98
127
|
/** 同じ種類の値で、比べられるもの。数量は同じ単位どうし(単位の違いは別の rule が見る)。 */
|
|
99
128
|
export const comparable = (left: FactValue, right: FactValue): boolean => {
|
|
100
129
|
if (left.kind !== right.kind) return false;
|
|
101
|
-
if (left.kind === "quantity") return left.unit === right.unit;
|
|
130
|
+
if (left.kind === "quantity") return left.unit === right.unit && comparableBounds(left, right) && basesAgree(left.basis, right.basis);
|
|
102
131
|
return left.kind !== "date" || comparableDates(left.key, right.key) !== undefined;
|
|
103
132
|
};
|
|
104
133
|
|
|
105
|
-
/**
|
|
134
|
+
/** 比べられる二つの値が同じか。範囲どうしは下の端も比べる。月日だけの日付は、年まで書いた日付の月日と同じなら同じ。 */
|
|
106
135
|
export const sameValue = (left: FactValue, right: FactValue): boolean => {
|
|
107
|
-
if (left.kind !== "date") return left.key === right.key;
|
|
136
|
+
if (left.kind !== "date") return left.key === right.key && (left.lower === undefined || right.lower === undefined || left.lower === right.lower);
|
|
108
137
|
const pair = comparableDates(left.key, right.key);
|
|
109
138
|
return pair !== undefined && pair[0] === pair[1];
|
|
110
139
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { FactValue } from "./fact-values.ts";
|
|
2
2
|
import { EDGE_MARKS, trimEndOf, withoutEdgeMarks } from "./trim-marks.ts";
|
|
3
|
+
import { qualifiedLabelOf, type QualifierWords } from "./qualified-labels.ts";
|
|
4
|
+
import { isRate, joinsNextClause, rateHead, rateTail, type RateBasis, type RateWords } from "./rate-values.ts";
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* 名前の付いた値(「締切:10月5日」「参加費は3,000円です」"Fee: $300" "The deadline is May 3.")と、
|
|
@@ -22,12 +24,20 @@ export type FactWords = {
|
|
|
22
24
|
/** 名前の前に置かれる決定の前置き(協議の結果、, it was decided that)。読点を含んでも条件ではないので、外してから名前を読む。 */
|
|
23
25
|
readonly leads: readonly string[];
|
|
24
26
|
readonly attributes: readonly AttributePhrase[];
|
|
27
|
+
/** 率のまわりの、値を変えない語(年、per year、(固定金利))。 */
|
|
28
|
+
readonly rates?: RateWords;
|
|
25
29
|
/** 区切りと値のあいだに置ける目安の語(約、about)。あれば値を目安として読む。無ければ、区切りのすぐ後ろの値だけ。 */
|
|
26
30
|
readonly valueLeads?: readonly string[];
|
|
31
|
+
/** 名前に条件を付ける型((*)、*の、for *)。条件の付いた名前は、名前と条件をそれぞれ一つの名前の長さで測る。 */
|
|
32
|
+
readonly qualifiers?: QualifierWords;
|
|
33
|
+
/** 計器の読みを言う動詞(read, shows)、計器の名前(odometer, meter)、読みのあとに置ける時の節の頭(when)。 */
|
|
34
|
+
readonly readings?: ReadingWords;
|
|
27
35
|
};
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
export type ReadingWords = { readonly verbs: readonly string[]; readonly gauges: readonly string[]; readonly clauses: readonly string[] };
|
|
38
|
+
|
|
39
|
+
/** approximate: 値の前に目安の語(約、about)があった。table: 表の升の値。 */
|
|
40
|
+
export type Fact = { readonly label: string; readonly key: string; readonly value: FactValue; readonly approximate?: boolean; readonly table?: boolean };
|
|
31
41
|
|
|
32
42
|
const MAX_LABEL_LENGTH = 24;
|
|
33
43
|
const MAX_LABEL_WORDS = 5;
|
|
@@ -106,17 +116,23 @@ const containsSeparator = (label: string, words: FactWords): boolean =>
|
|
|
106
116
|
LATIN_WORD.test(separator) ? wordsOf(label.toLowerCase()).includes(separator.toLowerCase()) : label.includes(separator),
|
|
107
117
|
);
|
|
108
118
|
|
|
119
|
+
const isShort = (text: string): boolean => text.length <= MAX_LABEL_LENGTH && wordsOf(text).length <= MAX_LABEL_WORDS;
|
|
120
|
+
|
|
121
|
+
/** 名前の長さ。条件の付いた名前(waiting period for cancellation cover)は、名前と条件がそれぞれ短いこと。 */
|
|
122
|
+
const isShortLabel = (label: string, key: string, words: FactWords): boolean => {
|
|
123
|
+
const qualified = words.qualifiers === undefined ? undefined : qualifiedLabelOf(key, words.qualifiers);
|
|
124
|
+
return qualified === undefined ? isShort(label) : isShort(qualified.head) && isShort(qualified.qualifier);
|
|
125
|
+
};
|
|
126
|
+
|
|
109
127
|
/** 名前として使える書き方か。短く、字を含み、区切りを含まず、指すだけの語(それ、it)でない。 */
|
|
110
128
|
const isLabel = (label: string, key: string, words: FactWords): boolean =>
|
|
111
129
|
label.length > 0 &&
|
|
112
|
-
label
|
|
113
|
-
wordsOf(label).length <= MAX_LABEL_WORDS &&
|
|
130
|
+
isShortLabel(label, key, words) &&
|
|
114
131
|
LETTER.test(key) &&
|
|
115
132
|
!CODE_MARK.test(label) &&
|
|
116
133
|
!containsSeparator(label, words) &&
|
|
117
134
|
!words.vague.some((word) => word.toLowerCase() === key);
|
|
118
135
|
|
|
119
|
-
/** 値の後ろが文の切れ目か。行の終わり、表の升の終わり、語彙表の終わりの語。 */
|
|
120
136
|
/** 値の後ろが文の切れ目か。行の終わり、表の升の終わり、語彙表の終わりの語。半角の数のまわりに空白を置く書き方(「14 cm です」)もある。 */
|
|
121
137
|
const endsAfter = (source: string, value: FactValue, words: FactWords): boolean => {
|
|
122
138
|
const after = source.slice(value.end, lineEndOf(source, value.end)).replace(MARKS_AFTER_VALUE, "").trimStart();
|
|
@@ -124,8 +140,25 @@ const endsAfter = (source: string, value: FactValue, words: FactWords): boolean
|
|
|
124
140
|
return words.valueEnds.some((end) => after.startsWith(end));
|
|
125
141
|
};
|
|
126
142
|
|
|
127
|
-
|
|
128
|
-
|
|
143
|
+
/** 値の終わりまで読めた値。率は、後ろの値を変えない語を越えた所で終わってもよく、そこに書いた基準を持つ。 */
|
|
144
|
+
const endedValue = (source: string, value: FactValue, words: FactWords): FactValue | undefined => {
|
|
145
|
+
if (words.rates === undefined || !isRate(value, words.rates)) return endsAfter(source, value, words) ? value : undefined;
|
|
146
|
+
const tail = rateTail(source, value, words.rates);
|
|
147
|
+
const ended = endsAfter(source, { ...value, end: tail.end }, words) || joinsNextClause(source, tail.end, words.rates);
|
|
148
|
+
return ended ? withBasis(value, tail.basis) : undefined;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const withBasis = (value: FactValue, basis: RateBasis): FactValue => (basis.length === 0 ? value : { ...value, basis: [...(value.basis ?? []), ...basis] });
|
|
152
|
+
|
|
153
|
+
/** 率の前の期間の語(年3.6% の 年)は名前の側に入れない。値の基準になる。 */
|
|
154
|
+
const headOfRate = (written: string, value: FactValue, words: FactWords): { readonly head: string; readonly value: FactValue } => {
|
|
155
|
+
if (words.rates === undefined || !isRate(value, words.rates)) return { head: written, value };
|
|
156
|
+
const { head, basis } = rateHead(written, words.rates);
|
|
157
|
+
return { head, value: withBasis(value, basis) };
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const labelledFact = (source: string, read: FactValue, words: FactWords): Fact | undefined => {
|
|
161
|
+
const { head: written, value } = headOfRate(trimEndOf(source.slice(lineStartOf(source, read.start), read.start), EDGE_MARKS), read, words);
|
|
129
162
|
const head = withoutValueLead(written, words.valueLeads ?? []);
|
|
130
163
|
const approximate = head.length < written.length ? { approximate: true } : {};
|
|
131
164
|
for (const separator of words.separators) {
|
|
@@ -154,12 +187,36 @@ const attributeFact = (source: string, value: FactValue, words: FactWords): Fact
|
|
|
154
187
|
return { label: found.pattern, key: keyOf(found.pattern, words), value };
|
|
155
188
|
};
|
|
156
189
|
|
|
190
|
+
/** 単位の語彙表の量か("45,210 km")。金額、率、ただの数は、読む動詞のあとでも読まない("He read 3 chapters")。 */
|
|
191
|
+
const isMeasured = (value: FactValue): boolean => "dimension" in value;
|
|
192
|
+
|
|
193
|
+
/** 値の後ろが、空白と時の節の頭の語と空白か("45,210 km when the car came in")。 */
|
|
194
|
+
const startsClause = (source: string, end: number, clauses: readonly string[]): boolean => {
|
|
195
|
+
const after = source.slice(end, lineEndOf(source, end)).toLowerCase();
|
|
196
|
+
return /^\s/u.test(after) && clauses.some((clause) => after.trimStart().startsWith(`${clause.toLowerCase()} `));
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/** 名前の最後の語が計器か(odometer、fuel gauge)。"The chart showed 5 kg" の chart は計器ではない。 */
|
|
200
|
+
const namesGauge = (key: string, gauges: readonly string[]): boolean => {
|
|
201
|
+
const last = wordsOf(key).at(-1);
|
|
202
|
+
return last !== undefined && gauges.some((gauge) => gauge.toLowerCase() === last);
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/** 計器が示した量("The odometer read 45,210 km.")。読む動詞を区切りにし、値の後ろの時の節も値の終わりにする。 */
|
|
206
|
+
const readingFact = (source: string, value: FactValue, words: FactWords): Fact | undefined => {
|
|
207
|
+
const readings = words.readings;
|
|
208
|
+
if (readings === undefined || !isMeasured(value)) return undefined;
|
|
209
|
+
if (!endsAfter(source, value, words) && !startsClause(source, value.end, readings.clauses)) return undefined;
|
|
210
|
+
const fact = labelledFact(source, value, { ...words, separators: readings.verbs });
|
|
211
|
+
return fact !== undefined && namesGauge(fact.key, readings.gauges) ? fact : undefined;
|
|
212
|
+
};
|
|
213
|
+
|
|
157
214
|
/** 文に書いた名前付きの値。値ごとに、属性の言い回しか、区切りの前の名前を探す。 */
|
|
158
215
|
export const labelledFacts = (source: string, values: readonly FactValue[], words: FactWords): Fact[] =>
|
|
159
216
|
values.flatMap((value) => {
|
|
160
217
|
const attribute = attributeFact(source, value, words);
|
|
161
218
|
if (attribute !== undefined) return [attribute];
|
|
162
|
-
|
|
163
|
-
const fact = labelledFact(source, value, words);
|
|
219
|
+
const ended = endedValue(source, value, words);
|
|
220
|
+
const fact = (ended === undefined ? undefined : labelledFact(source, ended, words)) ?? readingFact(source, value, words);
|
|
164
221
|
return fact === undefined ? [] : [fact];
|
|
165
222
|
});
|
|
@@ -1,25 +1,43 @@
|
|
|
1
|
-
import type { ProseDocument } from "../plugin.ts";
|
|
1
|
+
import type { LexiconEntry, ProseDocument } from "../plugin.ts";
|
|
2
2
|
import type { MeasureUnit } from "./measures.ts";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* 量の種類ごとの語彙表。weight が基準の単位への倍率で、同じ単位を二度書けば倍率が二つ(GB の 10^9 と 2^30)。
|
|
6
|
+
* group のある語は、語彙表の中の別の種類(mg/dL と mmol/L は換算が物質で違うので、組をまたいで比べない)。
|
|
7
|
+
*/
|
|
8
|
+
const MEASURE_DIMENSIONS = [
|
|
9
|
+
"unit-length",
|
|
10
|
+
"unit-mass",
|
|
11
|
+
"unit-time",
|
|
12
|
+
"unit-volume",
|
|
13
|
+
"unit-data",
|
|
14
|
+
"unit-temperature",
|
|
15
|
+
"unit-pressure",
|
|
16
|
+
"unit-area",
|
|
17
|
+
"unit-concentration",
|
|
18
|
+
] as const;
|
|
6
19
|
|
|
7
|
-
const
|
|
20
|
+
const dimensionOf = (lexicon: string, entry: LexiconEntry): string => (entry.group === undefined ? lexicon : `${lexicon}:${entry.group}`);
|
|
21
|
+
|
|
22
|
+
const unitKey = (dimension: string, pattern: string, before: boolean): string => `${dimension}\u0000${before ? "<" : ">"}${pattern}`;
|
|
23
|
+
|
|
24
|
+
type Factors = { readonly pattern: string; readonly dimension: string; readonly before: boolean; readonly weights: readonly number[] };
|
|
8
25
|
|
|
9
26
|
/** 単位ごとの、零点(unit-zero)と、要る文脈の語(unit-context の group がその単位の語)。 */
|
|
10
27
|
export const measureUnitsOf = (doc: ProseDocument): MeasureUnit[] => {
|
|
11
28
|
const zeros = new Map((doc.lexicons["unit-zero"] ?? []).map((entry) => [entry.pattern, entry.weight ?? 0]));
|
|
12
29
|
const contexts = doc.lexicons["unit-context"] ?? [];
|
|
13
|
-
return MEASURE_DIMENSIONS.flatMap((
|
|
14
|
-
const factors = new Map<string,
|
|
15
|
-
(doc.lexicons[
|
|
30
|
+
return MEASURE_DIMENSIONS.flatMap((lexicon) => {
|
|
31
|
+
const factors = new Map<string, Factors>();
|
|
32
|
+
(doc.lexicons[lexicon] ?? []).forEach((entry) => {
|
|
16
33
|
if (entry.weight === undefined) return;
|
|
17
34
|
const before = entry.position === "before";
|
|
18
|
-
const
|
|
19
|
-
const
|
|
35
|
+
const dimension = dimensionOf(lexicon, entry);
|
|
36
|
+
const key = unitKey(dimension, entry.pattern, before);
|
|
37
|
+
const found = factors.get(key) ?? { pattern: entry.pattern, dimension, before, weights: [] };
|
|
20
38
|
factors.set(key, { ...found, weights: [...found.weights, entry.weight] });
|
|
21
39
|
});
|
|
22
|
-
return [...factors.values()].map(({ pattern, before, weights }) => ({
|
|
40
|
+
return [...factors.values()].map(({ pattern, dimension, before, weights }) => ({
|
|
23
41
|
pattern,
|
|
24
42
|
dimension,
|
|
25
43
|
factors: weights,
|
package/src/facts/measures.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FactValue } from "./fact-values.ts";
|
|
2
|
-
import { lineHasContext, standsAsUnitWord } from "./unit-word.ts";
|
|
2
|
+
import { lineHasContext, runsIntoWord, standsAsUnitWord } from "./unit-word.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 単位の付いた量(5 km、3000 m、1.5時間、2 GB、180℃、大さじ1)。単位は言語パッケージの語彙表から取り、量の種類(長さ、重さ…)と、基準の単位への
|
|
@@ -30,10 +30,10 @@ export type Measured = FactValue & {
|
|
|
30
30
|
export type Tolerance = { readonly relative: number; readonly absolute: number };
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* 前に英字や数が続く数(v2、A4、1.2.3 の 2)と、分数の分母(1/2 の 2)は量ではない。日本語は数の前に空白を置かないので、仮名や漢字の後ろはよい。
|
|
33
|
+
* 前に英字や数が続く数(v2、A4、1.2.3 の 2)と、分数の分母(1/2 の 2)と、冪の指数(×10^4/µL の 4)は量ではない。日本語は数の前に空白を置かないので、仮名や漢字の後ろはよい。
|
|
34
34
|
* 字や数のすぐ後ろでない負の符号は数に含める(-20 °C)。20-25°C の - は範囲の印。
|
|
35
35
|
*/
|
|
36
|
-
const NUMBER = /(?<![\p{Script=Latin}\p{N}
|
|
36
|
+
const NUMBER = /(?<![\p{Script=Latin}\p{N}.,^])(?<![0-90-9][//])[0-90-9]+(?:[,,][0-90-9]{3})*(?:[..][0-90-9]+)?/gu;
|
|
37
37
|
const MINUS_SIGNS = new Set(["-", "−", "-"]);
|
|
38
38
|
const BEFORE_SIGN = /[\p{L}\p{N}.,]/u;
|
|
39
39
|
|
|
@@ -60,18 +60,18 @@ const GAPS = new Set([" ", "-"]);
|
|
|
60
60
|
type Found = { readonly unit: MeasureUnit; readonly start: number; readonly end: number };
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* 数のすぐ後ろ(空白かハイフン一つまで)の単位。長い単位から試す(「5分間」を 分 で切らない、min を m
|
|
64
|
-
*
|
|
63
|
+
* 数のすぐ後ろ(空白かハイフン一つまで)の単位。長い単位から試す(「5分間」を 分 で切らない、min を m にしない)。一番長く書かれた単位が
|
|
64
|
+
* 語に続いていれば、短い単位にも読み替えない("5 g/dLs" を 5 g にしない)。
|
|
65
65
|
*/
|
|
66
66
|
const unitAfter = (source: string, start: number, end: number, units: readonly MeasureUnit[]): Found | undefined => {
|
|
67
67
|
const gap = GAPS.has(source.charAt(end)) ? 1 : 0;
|
|
68
68
|
const rest = source.slice(end + gap, end + gap + MAX_UNIT_LENGTH);
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
const afterUnit = (candidate: MeasureUnit): string => source.slice(end + gap + candidate.pattern.length);
|
|
70
|
+
const written = units.filter((candidate) => !candidate.before && rest.startsWith(candidate.pattern));
|
|
71
|
+
const [longest] = written;
|
|
72
|
+
if (longest === undefined || runsIntoWord(longest.pattern, afterUnit(longest))) return undefined;
|
|
73
|
+
const unit = written.find(
|
|
74
|
+
(candidate) => standsAsUnitWord(candidate.pattern, candidate.context.length > 0, afterUnit(candidate)) && inContext(candidate, source, end),
|
|
75
75
|
);
|
|
76
76
|
return unit === undefined ? undefined : { unit, start, end: end + gap + unit.pattern.length };
|
|
77
77
|
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 条件の付いた名前(「待機期間(旅行キャンセル費用)」「旅行キャンセル費用の待機期間」"waiting period for cancellation cover")を
|
|
3
|
+
* 一つの書き方(名前と条件)にする。語彙表の型は * が条件の位置: 「(*)」「*の」"(*)" "for *"。
|
|
4
|
+
* 条件の違う名前(待機期間(疾病)と待機期間(けが))と、条件の無い名前(待機期間)は別の名前のまま。
|
|
5
|
+
* 英語の "cancellation cover waiting period" は、同じ文書が "waiting period (cancellation cover)" とも書いたときだけ同じ名前。
|
|
6
|
+
*/
|
|
7
|
+
export type QualifierWords = {
|
|
8
|
+
/** 条件を書く型。* が条件。* が頭なら条件は名前の前(*の)、そうでなければ後ろ((*)、for *)。 */
|
|
9
|
+
readonly templates: readonly string[];
|
|
10
|
+
/** 名前と条件の頭から落とす語(the, our)。 */
|
|
11
|
+
readonly determiners: readonly string[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type QualifiedLabel = { readonly head: string; readonly qualifier: string };
|
|
15
|
+
|
|
16
|
+
const PLACEHOLDER = "*";
|
|
17
|
+
const LETTER = /\p{L}/u;
|
|
18
|
+
const LATIN_WORD = /^[a-z]+(?: [a-z]+)*$/u;
|
|
19
|
+
|
|
20
|
+
const folded = (text: string): string => text.normalize("NFKC").toLowerCase();
|
|
21
|
+
|
|
22
|
+
const wordsOf = (text: string): string[] => text.split(/\s+/u).filter((word) => word !== "");
|
|
23
|
+
|
|
24
|
+
const withoutDeterminers = (text: string, determiners: readonly string[]): string => {
|
|
25
|
+
const words = wordsOf(text);
|
|
26
|
+
const start = words.findIndex((word) => !determiners.includes(word));
|
|
27
|
+
return start === -1 ? "" : words.slice(start).join(" ");
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const labelOf = (head: string, qualifier: string, words: QualifierWords): QualifiedLabel | undefined => {
|
|
31
|
+
const determiners = words.determiners.map(folded);
|
|
32
|
+
const label = { head: withoutDeterminers(head, determiners), qualifier: withoutDeterminers(qualifier, determiners) };
|
|
33
|
+
return LETTER.test(label.head) && LETTER.test(label.qualifier) ? label : undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** 英字の語の区切り(for、of)は、前後が空白のときだけ。最初のものから後ろが条件。 */
|
|
37
|
+
const splitAtWord = (key: string, joiner: string): [string, string] | undefined => {
|
|
38
|
+
const at = key.indexOf(` ${joiner} `);
|
|
39
|
+
return at === -1 ? undefined : [key.slice(0, at), key.slice(at + joiner.length + 2)];
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** 記号の区切り(()は、最後のものから後ろが条件。 */
|
|
43
|
+
const splitAtMark = (key: string, open: string): [string, string] | undefined => {
|
|
44
|
+
const at = key.lastIndexOf(open);
|
|
45
|
+
return at <= 0 ? undefined : [key.slice(0, at), key.slice(at + open.length)];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** 条件が名前の後ろの型((*)、for *)。 */
|
|
49
|
+
const qualifierAfter = (key: string, open: string, close: string): [string, string] | undefined => {
|
|
50
|
+
if (!key.endsWith(close)) return undefined;
|
|
51
|
+
const body = key.slice(0, key.length - close.length);
|
|
52
|
+
const trimmed = open.trim();
|
|
53
|
+
return LATIN_WORD.test(trimmed) ? splitAtWord(body, trimmed) : splitAtMark(body, open);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** 条件が名前の前の型(*の)。最後のつなぎの語から後ろが名前。 */
|
|
57
|
+
const qualifierBefore = (key: string, joiner: string): [string, string] | undefined => {
|
|
58
|
+
const at = key.lastIndexOf(joiner);
|
|
59
|
+
return at <= 0 ? undefined : [key.slice(at + joiner.length), key.slice(0, at)];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const splitBy = (key: string, template: string): [string, string] | undefined => {
|
|
63
|
+
const at = template.indexOf(PLACEHOLDER);
|
|
64
|
+
if (at === -1) return undefined;
|
|
65
|
+
const open = template.slice(0, at);
|
|
66
|
+
const close = template.slice(at + PLACEHOLDER.length);
|
|
67
|
+
if (open === "") return close === "" ? undefined : qualifierBefore(key, close);
|
|
68
|
+
return qualifierAfter(key, open, close);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** 名前の key を、名前と条件に分ける。型に合わなければ undefined。語彙表の順に試す。 */
|
|
72
|
+
export const qualifiedLabelOf = (key: string, words: QualifierWords): QualifiedLabel | undefined => {
|
|
73
|
+
const trimmed = folded(key).trim();
|
|
74
|
+
for (const template of words.templates.map(folded)) {
|
|
75
|
+
const parts = splitBy(trimmed, template);
|
|
76
|
+
const label = parts === undefined ? undefined : labelOf(parts[0], parts[1], words);
|
|
77
|
+
if (label !== undefined) return label;
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const keyOfLabel = ({ head, qualifier }: QualifiedLabel): string => `${head} (${qualifier})`;
|
|
83
|
+
|
|
84
|
+
/** 名前と条件を別々に持つ値(表の列の見出しと行の見出し)の key。どちらかに字が無ければ undefined。 */
|
|
85
|
+
export const keyOfParts = (head: string, qualifier: string, words: QualifierWords): string | undefined => {
|
|
86
|
+
const spaced = (text: string): string => folded(text).replace(/\s+/gu, " ").trim();
|
|
87
|
+
const label = labelOf(spaced(head), spaced(qualifier), words);
|
|
88
|
+
return label === undefined ? undefined : keyOfLabel(label);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** 条件の付いた名前は「名前 (条件)」に。条件の無い名前は書いたまま。 */
|
|
92
|
+
export const qualifiedKeyOf = (key: string, words: QualifierWords): string => {
|
|
93
|
+
const label = qualifiedLabelOf(key, words);
|
|
94
|
+
return label === undefined ? key : keyOfLabel(label);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** 前に置いた条件(cancellation cover waiting period)として読める条件か。語だけで、冠詞もつなぎの語も含まない。 */
|
|
98
|
+
const isPremodifier = (qualifier: string, words: QualifierWords): boolean => {
|
|
99
|
+
const joiners = words.templates.map((template) => folded(template).replace(PLACEHOLDER, "").trim());
|
|
100
|
+
const determiners = words.determiners.map(folded);
|
|
101
|
+
return LATIN_WORD.test(qualifier) && wordsOf(qualifier).every((word) => !determiners.includes(word) && !joiners.includes(word));
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** 前に置いた書き方が、二つの名前と条件(claim limit (baggage) と limit (baggage claim))に読めるものは、どちらにもしない。 */
|
|
105
|
+
const unambiguous = (pairs: readonly [string, string][]): Map<string, string> => {
|
|
106
|
+
const targets = new Map<string, Set<string>>();
|
|
107
|
+
pairs.forEach(([surface, key]) => targets.set(surface, (targets.get(surface) ?? new Set<string>()).add(key)));
|
|
108
|
+
return new Map(pairs.filter(([surface]) => targets.get(surface)?.size === 1));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 文書の名前の key を一つの書き方に。条件を前に置いた名前("cancellation cover waiting period")は、同じ文書に同じ名前と条件の
|
|
113
|
+
* 型の書き方があるときだけ、それと同じ key にする。
|
|
114
|
+
*/
|
|
115
|
+
export const qualifiedKeys = (keys: readonly string[], words: QualifierWords): string[] => {
|
|
116
|
+
const labels = keys.map((key) => qualifiedLabelOf(key, words));
|
|
117
|
+
const premodified = unambiguous(
|
|
118
|
+
labels.flatMap((label): [string, string][] =>
|
|
119
|
+
label === undefined || !isPremodifier(label.qualifier, words) ? [] : [[`${label.qualifier} ${label.head}`, keyOfLabel(label)]],
|
|
120
|
+
),
|
|
121
|
+
);
|
|
122
|
+
return keys.map((key, index) => {
|
|
123
|
+
const label = labels[index];
|
|
124
|
+
return label === undefined ? (premodified.get(key.trim()) ?? key) : keyOfLabel(label);
|
|
125
|
+
});
|
|
126
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { FactValue } from "./fact-values.ts";
|
|
2
|
+
import { EDGE_MARKS, trimEndOf } from "./trim-marks.ts";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 率(百分率)の値のまわりに書く、値を変えない語。期間(年3.6%、4.8% per year)、種類(固定、variable)、何に対する率
|
|
6
|
+
* (of the purchase price)、括弧の注記(3.6%(固定金利))。これらを越えた所で値が終わっていれば、率は名前の値として読む。
|
|
7
|
+
* 語彙表に無い語が続く率(3.6% of applicants、3.6%増)は、別の量の一部なので読まない。
|
|
8
|
+
* 期間・種類・対象は値の基準(basis)になり、両方に書いてあって違えば別の量として比べない(月0.5% と 年6%)。
|
|
9
|
+
* 語彙表に無い括弧の注記((of applicants)、(men))は、同じ注記の率とだけ比べる。何の率かを言っているかもしれない。
|
|
10
|
+
*/
|
|
11
|
+
export type RateWord = { readonly pattern: string; readonly group?: string | undefined; readonly position: "before" | "after" };
|
|
12
|
+
|
|
13
|
+
export type RateWords = {
|
|
14
|
+
/** 百分率の単位(%、パーセント)。 */
|
|
15
|
+
readonly units: readonly string[];
|
|
16
|
+
/** 基準の語彙表ごとの語。鍵は基準の種類(period、kind、base)。 */
|
|
17
|
+
readonly notes: Readonly<Record<string, readonly RateWord[]>>;
|
|
18
|
+
/** 率のすぐ後ろで、値を言い終えて次の節を始める語句(and stays、and does not)。 */
|
|
19
|
+
readonly joiners: readonly string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** 基準の種類と、その値(period:year)。 */
|
|
23
|
+
export type RateBasis = readonly string[];
|
|
24
|
+
|
|
25
|
+
const OPEN_BRACKETS: ReadonlySet<string> = new Set(["(", "("]);
|
|
26
|
+
const CLOSE_BRACKETS = /[))]/u;
|
|
27
|
+
const NESTED_OR_LINE = /[((\n]/u;
|
|
28
|
+
const SPACES = /^[ \t]*/u;
|
|
29
|
+
const LATIN_LETTER = /[a-z]/iu;
|
|
30
|
+
/** 語彙表に無い括弧の注記の基準。この基準だけは、片方に無くても食い違いとする。 */
|
|
31
|
+
const NOTE = "note:";
|
|
32
|
+
|
|
33
|
+
const normalized = (text: string): string => text.normalize("NFKC").toLowerCase();
|
|
34
|
+
|
|
35
|
+
export const isRate = (value: FactValue, words: RateWords): boolean =>
|
|
36
|
+
value.kind === "quantity" && words.units.some((unit) => normalized(unit) === normalized(value.unit));
|
|
37
|
+
|
|
38
|
+
const basisOf = (dimension: string, word: RateWord): RateBasis => (word.group === undefined ? [] : [`${dimension}:${word.group}`]);
|
|
39
|
+
|
|
40
|
+
type NoteMatch = { readonly length: number; readonly basis: RateBasis };
|
|
41
|
+
|
|
42
|
+
/** 英字で終わる語は、語の途中で切れていないこと(a year を a yearly の頭として読まない)。 */
|
|
43
|
+
const endsWord = (text: string, length: number): boolean => !(LATIN_LETTER.test(text.charAt(length - 1)) && LATIN_LETTER.test(text.charAt(length)));
|
|
44
|
+
|
|
45
|
+
const longestOf = (matches: readonly NoteMatch[]): NoteMatch | undefined =>
|
|
46
|
+
matches.reduce<NoteMatch | undefined>((longest, match) => (longest === undefined || match.length > longest.length ? match : longest), undefined);
|
|
47
|
+
|
|
48
|
+
/** 基準の語のうち、置く側が position のもの(undefined ならどちらでも)を、語彙表の種類と組にして。 */
|
|
49
|
+
const notesAt = (words: RateWords, position: RateWord["position"] | undefined): { readonly dimension: string; readonly word: RateWord }[] =>
|
|
50
|
+
Object.entries(words.notes).flatMap(([dimension, entries]) =>
|
|
51
|
+
entries.filter((word) => position === undefined || word.position === position).map((word) => ({ dimension, word })),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
/** text の頭に置いた基準の語のうち一番長いもの。 */
|
|
55
|
+
const noteAtStart = (text: string, words: RateWords, position: RateWord["position"] | undefined): NoteMatch | undefined =>
|
|
56
|
+
longestOf(
|
|
57
|
+
notesAt(words, position)
|
|
58
|
+
.filter(({ word }) => normalized(text.slice(0, word.pattern.length)) === normalized(word.pattern) && endsWord(text, word.pattern.length))
|
|
59
|
+
.map(({ dimension, word }): NoteMatch => ({ length: word.pattern.length, basis: basisOf(dimension, word) })),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
/** 頭の括弧の注記。中身が基準の語そのもの((固定金利)、(fixed))なら、その基準も。行をまたぐ括弧や入れ子は注記にしない。 */
|
|
63
|
+
const bracketAtStart = (text: string, words: RateWords): NoteMatch | undefined => {
|
|
64
|
+
if (!OPEN_BRACKETS.has(text.charAt(0))) return undefined;
|
|
65
|
+
const close = text.search(CLOSE_BRACKETS);
|
|
66
|
+
const inside = close === -1 ? "" : text.slice(1, close);
|
|
67
|
+
if (close === -1 || NESTED_OR_LINE.test(inside)) return undefined;
|
|
68
|
+
const whole = noteAtStart(inside, words, undefined);
|
|
69
|
+
return { length: close + 1, basis: whole?.length === inside.length ? whole.basis : [`${NOTE}${normalized(inside).trim()}`] };
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type RateTail = { readonly end: number; readonly basis: RateBasis };
|
|
73
|
+
|
|
74
|
+
/** 率の後ろの、値を変えない語と括弧の注記を越えた所と、そこまでに書いた基準。 */
|
|
75
|
+
const tailFrom = (source: string, tail: RateTail, words: RateWords): RateTail => {
|
|
76
|
+
const text = source.slice(tail.end).replace(SPACES, "");
|
|
77
|
+
const note = bracketAtStart(text, words) ?? noteAtStart(text, words, "after");
|
|
78
|
+
if (note === undefined) return tail;
|
|
79
|
+
return tailFrom(source, { end: source.length - text.length + note.length, basis: [...tail.basis, ...note.basis] }, words);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const rateTail = (source: string, value: FactValue, words: RateWords): RateTail => tailFrom(source, { end: value.end, basis: [] }, words);
|
|
83
|
+
|
|
84
|
+
export type RateHead = { readonly head: string; readonly basis: RateBasis };
|
|
85
|
+
|
|
86
|
+
/** 率の前の期間の語(年3.6% の 年)を、名前の側から外したものと、その基準。 */
|
|
87
|
+
export const rateHead = (head: string, words: RateWords): RateHead => {
|
|
88
|
+
const trimmed = trimEndOf(head, EDGE_MARKS);
|
|
89
|
+
const found = longestOf(
|
|
90
|
+
notesAt(words, "before")
|
|
91
|
+
.filter(({ word }) => normalized(trimmed.slice(-word.pattern.length)) === normalized(word.pattern))
|
|
92
|
+
.map(({ dimension, word }): NoteMatch => ({ length: word.pattern.length, basis: basisOf(dimension, word) })),
|
|
93
|
+
);
|
|
94
|
+
if (found === undefined) return { head, basis: [] };
|
|
95
|
+
return { head: trimEndOf(trimmed.slice(0, trimmed.length - found.length), EDGE_MARKS), basis: found.basis };
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/** 率の後ろが、値を言い終えて次の節を始める語句(4.5% and does not change)。語句の後ろは語の切れ目。 */
|
|
99
|
+
export const joinsNextClause = (source: string, end: number, words: RateWords): boolean => {
|
|
100
|
+
const text = source.slice(end).replace(SPACES, "");
|
|
101
|
+
return words.joiners.some((phrase) => normalized(text.slice(0, phrase.length)) === normalized(phrase) && endsWord(text, phrase.length));
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const dimensionOf = (entry: string): string => entry.slice(0, entry.indexOf(":") + 1);
|
|
105
|
+
|
|
106
|
+
const notesOf = (basis: RateBasis): string =>
|
|
107
|
+
basis
|
|
108
|
+
.filter((entry) => entry.startsWith(NOTE))
|
|
109
|
+
.toSorted((left, right) => left.localeCompare(right, "en"))
|
|
110
|
+
.join("\u0000");
|
|
111
|
+
|
|
112
|
+
/** 二つの値の基準が食い違わないか。同じ種類の基準を両方に書いて違うか、語彙表に無い注記が揃わないときに食い違う。 */
|
|
113
|
+
export const basesAgree = (left: RateBasis | undefined, right: RateBasis | undefined): boolean => {
|
|
114
|
+
const [ours, theirs] = [left ?? [], right ?? []];
|
|
115
|
+
if (notesOf(ours) !== notesOf(theirs)) return false;
|
|
116
|
+
return ours.every((entry) => !theirs.some((other) => dimensionOf(other) === dimensionOf(entry) && other !== entry));
|
|
117
|
+
};
|