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,209 @@
|
|
|
1
|
+
// discount-rate-mismatch: a volume-tier price list whose discount is not what its tier price and its list price give (list
|
|
2
|
+
// 8.0円 a sheet, 7.2円 at 1,000 sheets is 10% off, and the row says 15%). The list price is a column of the table, else the
|
|
3
|
+
// one price the document states as the list price: a sentence (「定価は1枚8.0円」, "The list price is $0.080 per envelope")
|
|
4
|
+
// or a row (| 定価 | 8.0円 |). Pure.
|
|
5
|
+
import type { StructureIssue } from "./issues.ts";
|
|
6
|
+
import { holds, plain, valueIn, type ChangeTable, type TableCell } from "./change-rate-table.ts";
|
|
7
|
+
import { bodyRows, offsetOf, sameUnit } from "./order-quantity.ts";
|
|
8
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
9
|
+
|
|
10
|
+
/** rate: the discount column. price: the price after the discount. list: the list price. not: a rate that is no discount (tax). per: a unit mark. */
|
|
11
|
+
export type DiscountRole = "rate" | "price" | "list" | "not" | "per";
|
|
12
|
+
export type DiscountWord = { readonly pattern: string; readonly role: DiscountRole };
|
|
13
|
+
/** A line outside tables and the amounts of money written in it, each at its offset in the line. */
|
|
14
|
+
export type MoneyLine = { readonly text: string; readonly amounts: readonly { readonly offset: number; readonly written: string }[] };
|
|
15
|
+
export type DiscountText = { readonly tables: readonly ChangeTable[]; readonly lines: readonly MoneyLine[] };
|
|
16
|
+
|
|
17
|
+
type Price = { readonly value: number; readonly marks: string; readonly unit: string | undefined; readonly text: string };
|
|
18
|
+
type StatedRate = { readonly value: number; readonly decimals: number; readonly written: string };
|
|
19
|
+
type Columns = {
|
|
20
|
+
readonly rate: number;
|
|
21
|
+
readonly price: number;
|
|
22
|
+
readonly list: number | undefined;
|
|
23
|
+
readonly priceUnit: string | undefined;
|
|
24
|
+
readonly listUnit: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** A discount written 10%, 12.5 %, -10%, △10%, or in tenths 1割 / 1割5分 (15%). */
|
|
28
|
+
const PERCENT_RATE = /^[-−▲△]?\s*(\d{1,3})(?:\.(\d+))?\s*%$/u;
|
|
29
|
+
const TENTHS_RATE = /^([1-9])割(?:([1-9])分)?$/u;
|
|
30
|
+
const TENTH = 10;
|
|
31
|
+
const HUNDRED = 100;
|
|
32
|
+
const DECIMAL_BASE = 10;
|
|
33
|
+
/** A unit after its mark: 枚 in 1枚, envelope in "per envelope", box in /box. Hiragana ends it (1枚の単価, 1枚あたり). */
|
|
34
|
+
const UNIT_WORD = /^\s*([\p{Script=Han}\p{Script=Katakana}\p{Script=Latin}ー]+)/u;
|
|
35
|
+
const DIGIT_BEFORE = /[\d.,]$/u;
|
|
36
|
+
/** What may stand between a list-price word and its amount once a unit is out: 「定価は1枚8.0円」, "List price: $0.080", "is". */
|
|
37
|
+
const GAP_MARKS = /[\s::=、,(())*_.]/gu;
|
|
38
|
+
const GAP_WORDS: readonly string[] = ["あたり", "当たり", "につき", "税抜き", "税抜", "税込み", "税込", "税別", "は", "が", "の"];
|
|
39
|
+
const GAP_LATIN = /^(?:is|was|of|at|each|excl|excluding|incl|including|tax)$/u;
|
|
40
|
+
/** A sentence ends at 。 or at a full stop before a space or the line's end ($0.080 is one amount). */
|
|
41
|
+
const SENTENCE_END = /。|\.(?=\s|$)/u;
|
|
42
|
+
/** A unit after the amount belongs to it up to the next comma: "$0.080 per envelope, excluding tax". */
|
|
43
|
+
const CLAUSE_END = /[,、,]/u;
|
|
44
|
+
const KEY_VALUE_CELLS = 2;
|
|
45
|
+
const ROLE_ORDER: readonly DiscountRole[] = ["list", "price"];
|
|
46
|
+
|
|
47
|
+
const wordsOf = (words: readonly DiscountWord[], role: DiscountRole): string[] => words.filter((word) => word.role === role).map((word) => word.pattern);
|
|
48
|
+
|
|
49
|
+
const LATIN_END = /[a-z]$/u;
|
|
50
|
+
|
|
51
|
+
/** A word as it stands in a lowercased text: a Latin word whole (per is not in "upper"), anything else as written. */
|
|
52
|
+
const wordPattern = (word: string): string => {
|
|
53
|
+
const written = escapeRegExp(plain(word).toLowerCase());
|
|
54
|
+
return LATIN_END.test(word.toLowerCase()) ? `(?<![a-z0-9])${written}(?![a-z0-9])` : written;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A discount column heading holds a rate word outside its price words (割引 is not read in 割引後の単価) and no not word;
|
|
59
|
+
* else it is a list price, then a price.
|
|
60
|
+
*/
|
|
61
|
+
const roleOf = (heading: string, words: readonly DiscountWord[]): DiscountRole | undefined => {
|
|
62
|
+
const key = plain(heading).toLowerCase();
|
|
63
|
+
const held = (role: DiscountRole, text = key): boolean => wordsOf(words, role).some((word) => holds(text, word));
|
|
64
|
+
const outsidePrices = wordsOf(words, "price").reduce((left, word) => left.replace(new RegExp(wordPattern(word), "gu"), " "), key);
|
|
65
|
+
if (held("rate", outsidePrices)) return held("not") ? "not" : "rate";
|
|
66
|
+
return ROLE_ORDER.find((role) => held(role));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** The discount as written: 10%, 1割5分. Undefined for anything else and for 100% and more. */
|
|
70
|
+
export const discountIn = (text: string): StatedRate | undefined => {
|
|
71
|
+
const written = plain(text);
|
|
72
|
+
const percent = PERCENT_RATE.exec(written);
|
|
73
|
+
const tenths = TENTHS_RATE.exec(written);
|
|
74
|
+
if (percent !== null) {
|
|
75
|
+
const value = Number(`${percent[1] ?? ""}.${percent[2] ?? "0"}`);
|
|
76
|
+
return value < HUNDRED ? { value, decimals: percent[2]?.length ?? 0, written } : undefined;
|
|
77
|
+
}
|
|
78
|
+
if (tenths === null) return undefined;
|
|
79
|
+
const value = Number(tenths[1]) * TENTH + Number(tenths[2] ?? 0);
|
|
80
|
+
return { value, decimals: 0, written };
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** Each unit after a per mark that is not part of a number (1枚, not the 1 of 10枚): where it starts, where it ends, and the unit. */
|
|
84
|
+
const unitsIn = (text: string, words: readonly DiscountWord[]): { readonly start: number; readonly end: number; readonly unit: string }[] => {
|
|
85
|
+
const key = text.toLowerCase();
|
|
86
|
+
return wordsOf(words, "per").flatMap((mark) =>
|
|
87
|
+
[...key.matchAll(new RegExp(wordPattern(mark), "gu"))].flatMap((match) => {
|
|
88
|
+
const after = match.index + match[0].length;
|
|
89
|
+
const unit = UNIT_WORD.exec(key.slice(after));
|
|
90
|
+
if (unit?.[1] === undefined || DIGIT_BEFORE.test(key.slice(0, match.index))) return [];
|
|
91
|
+
return [{ start: match.index, end: after + unit[0].length, unit: unit[1] }];
|
|
92
|
+
}),
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** The one unit a price is of (1枚, "per envelope", 円/枚); undefined when none or two. */
|
|
97
|
+
export const unitOf = (text: string, words: readonly DiscountWord[]): string | undefined => {
|
|
98
|
+
const units = [...new Set(unitsIn(text, words).map((found) => found.unit))];
|
|
99
|
+
return units.length === 1 ? units[0] : undefined;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const priceIn = (text: string, unit: string | undefined): Price | undefined => {
|
|
103
|
+
const value = valueIn(text);
|
|
104
|
+
return value === undefined || value.value <= 0 ? undefined : { value: value.value, marks: value.marks, unit, text: plain(text) };
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/** Only marks and filler words: 「は」, ": ", " is ", " (excl. tax): ". */
|
|
108
|
+
const isGap = (text: string): boolean =>
|
|
109
|
+
text
|
|
110
|
+
.toLowerCase()
|
|
111
|
+
.split(GAP_MARKS)
|
|
112
|
+
.every((part) => part === "" || GAP_LATIN.test(part) || GAP_WORDS.reduce((left, word) => left.replaceAll(word, ""), part) === "");
|
|
113
|
+
|
|
114
|
+
const withoutUnits = (text: string, words: readonly DiscountWord[]): string =>
|
|
115
|
+
unitsIn(text, words)
|
|
116
|
+
.toSorted((left, right) => right.start - left.start)
|
|
117
|
+
.reduce((left, found) => left.slice(0, found.start) + left.slice(found.end), text);
|
|
118
|
+
|
|
119
|
+
/** Each price a line states as the list price: the amount right after a list word, with only fillers and a unit between. */
|
|
120
|
+
const sentencePrices = (line: MoneyLine, words: readonly DiscountWord[]): Price[] => {
|
|
121
|
+
const key = line.text.toLowerCase();
|
|
122
|
+
return wordsOf(words, "list").flatMap((word) =>
|
|
123
|
+
[...key.matchAll(new RegExp(wordPattern(word), "gu"))].flatMap((match) => {
|
|
124
|
+
const from = match.index + match[0].length;
|
|
125
|
+
const amount = line.amounts.find((found) => found.offset >= from);
|
|
126
|
+
if (amount === undefined) return [];
|
|
127
|
+
const gap = line.text.slice(from, amount.offset);
|
|
128
|
+
if (!isGap(withoutUnits(gap, words))) return [];
|
|
129
|
+
const rest = line.text.slice(amount.offset + amount.written.length).split(SENTENCE_END)[0] ?? "";
|
|
130
|
+
const price = priceIn(amount.written, unitOf(gap, words) ?? unitOf(rest.split(CLAUSE_END)[0] ?? "", words));
|
|
131
|
+
return price === undefined ? [] : [price];
|
|
132
|
+
}),
|
|
133
|
+
);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/** A table row that is a list price: its first cell holds a list word; the price is the price column's cell, or a two-cell row's second. */
|
|
137
|
+
const rowPrice = (row: readonly TableCell[], words: readonly DiscountWord[], priceColumn: number | undefined, unit: string | undefined): Price[] => {
|
|
138
|
+
const [label] = row;
|
|
139
|
+
if (label === undefined || roleOf(label.text, words) !== "list") return [];
|
|
140
|
+
const keyValue = row.length === KEY_VALUE_CELLS ? row[1] : undefined;
|
|
141
|
+
const cell = priceColumn === undefined ? keyValue : row[priceColumn];
|
|
142
|
+
const price = cell === undefined ? undefined : priceIn(cell.text, unitOf(label.text, words) ?? unit);
|
|
143
|
+
return price === undefined ? [] : [price];
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const onlyIndex = (indexes: readonly number[]): number | undefined => (indexes.length === 1 ? indexes[0] : undefined);
|
|
147
|
+
|
|
148
|
+
const columnsOf = (table: ChangeTable, words: readonly DiscountWord[]): Columns | undefined => {
|
|
149
|
+
const roles = table.header.map((cell) => roleOf(cell.text, words));
|
|
150
|
+
const at = (role: DiscountRole): number[] => roles.flatMap((found, index) => (found === role ? [index] : []));
|
|
151
|
+
const [rate, price, lists] = [onlyIndex(at("rate")), onlyIndex(at("price")), at("list")];
|
|
152
|
+
if (rate === undefined || price === undefined || lists.length > 1) return undefined;
|
|
153
|
+
const list = lists[0];
|
|
154
|
+
const [priceUnit, listUnit] = [
|
|
155
|
+
unitOf(table.header[price]?.text ?? "", words),
|
|
156
|
+
list === undefined ? undefined : unitOf(table.header[list]?.text ?? "", words),
|
|
157
|
+
];
|
|
158
|
+
return { rate, price, list, priceUnit, listUnit };
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/** The one list price the document states in a sentence or a table row; undefined when none, or two different ones. */
|
|
162
|
+
const statedListPrice = (text: DiscountText, words: readonly DiscountWord[]): Price | undefined => {
|
|
163
|
+
const fromTables = text.tables.flatMap((table) => {
|
|
164
|
+
const columns = columnsOf(table, words);
|
|
165
|
+
return bodyRows(table).flatMap((row) => rowPrice(row, words, columns?.price, columns?.priceUnit));
|
|
166
|
+
});
|
|
167
|
+
const prices = [...text.lines.flatMap((line) => sentencePrices(line, words)), ...fromTables];
|
|
168
|
+
const distinct = new Set(prices.map((price) => `${String(price.value)}|${price.marks}|${price.unit ?? ""}`));
|
|
169
|
+
return distinct.size === 1 ? prices[0] : undefined;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/** Whether the stated rate is the discount within its own rounding, or the tier price is the list less the rate within the price's. */
|
|
173
|
+
export const discountMatches = (list: number, tier: number, stated: number, decimals: number, tierStep: number): boolean => {
|
|
174
|
+
const computed = (1 - tier / list) * HUNDRED;
|
|
175
|
+
const rateStep = DECIMAL_BASE ** -decimals;
|
|
176
|
+
const epsilon = 1e-9;
|
|
177
|
+
return Math.abs(computed - stated) < rateStep - epsilon || Math.abs(list * (1 - stated / HUNDRED) - tier) < tierStep - epsilon;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/** The row's list price: its list column's cell, else the stated one; undefined when its unit is not the tier price's. */
|
|
181
|
+
const listPriceOf = (row: readonly TableCell[], columns: Columns, stated: Price | undefined): Price | undefined => {
|
|
182
|
+
const listCell = columns.list === undefined ? undefined : row[columns.list];
|
|
183
|
+
const list = listCell === undefined ? stated : priceIn(listCell.text, columns.listUnit);
|
|
184
|
+
const otherUnit = list?.unit !== undefined && columns.priceUnit !== undefined && !sameUnit(list.unit, columns.priceUnit);
|
|
185
|
+
return otherUnit ? undefined : list;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const rowIssue = (row: readonly TableCell[], columns: Columns, stated: Price | undefined): StructureIssue[] => {
|
|
189
|
+
const [rateCell, priceCell] = [row[columns.rate], row[columns.price]];
|
|
190
|
+
const list = listPriceOf(row, columns, stated);
|
|
191
|
+
const rate = rateCell === undefined ? undefined : discountIn(rateCell.text);
|
|
192
|
+
const tier = priceCell === undefined ? undefined : valueIn(priceCell.text);
|
|
193
|
+
if (rateCell === undefined || list === undefined || rate === undefined || tier === undefined || tier.marks !== list.marks) return [];
|
|
194
|
+
// A price not below the list price is no tier price: an invoice's price before its discount, another unit, a surcharge.
|
|
195
|
+
if (tier.value >= list.value || discountMatches(list.value, tier.value, rate.value, rate.decimals, tier.step)) return [];
|
|
196
|
+
const computed = ((1 - tier.value / list.value) * HUNDRED).toFixed(rate.decimals);
|
|
197
|
+
const values = { written: rate.written, expected: `${computed}%`, list: list.text, price: plain(priceCell?.text ?? "") };
|
|
198
|
+
return [{ offset: offsetOf(rateCell), values }];
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/** Each discount in a tier table that its row's price and the list price do not give. */
|
|
202
|
+
export const discountRateMismatches = (text: DiscountText, words: readonly DiscountWord[]): StructureIssue[] => {
|
|
203
|
+
if (words.length === 0) return [];
|
|
204
|
+
const stated = statedListPrice(text, words);
|
|
205
|
+
return text.tables.flatMap((table) => {
|
|
206
|
+
const columns = columnsOf(table, words);
|
|
207
|
+
return columns === undefined ? [] : bodyRows(table).flatMap((row) => rowIssue(row, columns, stated));
|
|
208
|
+
});
|
|
209
|
+
};
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { StructureIssue } from "./issues.ts";
|
|
2
|
+
import { linesOf, type Line } from "./lines.ts";
|
|
3
|
+
import { alternation, intervalOf, type Interval, type StatedAmount } from "./stated-multiple.ts";
|
|
4
|
+
import { statedTaxRates, type TaxPriceWord } from "./tax-price.ts";
|
|
5
|
+
import { roundedMatches } from "./tax.ts";
|
|
6
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* formula-amount-mismatch: a row whose label writes the formula of its amount (仲介手数料(売買代金の3%+60,000円、消費税込み)
|
|
10
|
+
* | 1,650,000円, "Commission (5% of the sale price) | $16,200.00") is worked out from the amount the document labels with that
|
|
11
|
+
* name (売買代金 | 48,000,000円) and compared with the row's amount. A label that says the tax is included adds the rate
|
|
12
|
+
* the label states, else the one rate the document states beside a tax word, else the profile's rate. The words come from the
|
|
13
|
+
* lexicons. Pure.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export type FormulaWords = {
|
|
17
|
+
/** Words between a name and its rate (売買代金の3%). */
|
|
18
|
+
readonly nameRate: readonly string[];
|
|
19
|
+
/** Words between a rate and its name (3% of the sale price). */
|
|
20
|
+
readonly rateName: readonly string[];
|
|
21
|
+
/** Words before a fixed amount added to the rate's part (+60,000円, plus $500). */
|
|
22
|
+
readonly plus: readonly string[];
|
|
23
|
+
/** The marks of a percent (%, %, percent). */
|
|
24
|
+
readonly percent: readonly string[];
|
|
25
|
+
/** The words of a price with tax and of a tax rate (税込み, 消費税), as tax-mismatch reads them. */
|
|
26
|
+
readonly tax: readonly TaxPriceWord[];
|
|
27
|
+
/** The names of a tax (消費税, VAT) and the words that say it is included (込み, included): 消費税8%込み, VAT included. */
|
|
28
|
+
readonly taxNames: readonly string[];
|
|
29
|
+
readonly includedWords: readonly string[];
|
|
30
|
+
/** Words that say a tax is left out although a word of inclusion stands in them (not included, 含まない). */
|
|
31
|
+
readonly notIncluded: readonly string[];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type FormulaText = {
|
|
35
|
+
readonly text: string;
|
|
36
|
+
readonly amounts: readonly StatedAmount[];
|
|
37
|
+
/** The tax rate a label's tax-included word means when neither the label nor the document states one (the profile's). */
|
|
38
|
+
readonly defaultTaxRate: number | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** The rate and the name it is of, with where they stand in the label. */
|
|
42
|
+
type Formula = { readonly start: number; readonly end: number; readonly rate: number; readonly name: string };
|
|
43
|
+
type Named = Omit<Formula, "rate">;
|
|
44
|
+
|
|
45
|
+
/** A line ending in one amount after a separator, and the label before that separator. */
|
|
46
|
+
type Row = { readonly line: Line; readonly label: string; readonly amount: StatedAmount };
|
|
47
|
+
|
|
48
|
+
/** What the row's amount is worked out from. */
|
|
49
|
+
type Terms = { readonly formula: Formula; readonly base: StatedAmount; readonly fixed: StatedAmount | undefined; readonly tax: number };
|
|
50
|
+
|
|
51
|
+
const CENTS = 100;
|
|
52
|
+
const HUNDRED = 100;
|
|
53
|
+
const NAME_MAX = 40;
|
|
54
|
+
const AFTER_AMOUNT = /^[\s||]*$/u;
|
|
55
|
+
const SEPARATOR = /[||::]\s*$/u;
|
|
56
|
+
const NAME_EDGE = "()()、,,;;||::「」『』";
|
|
57
|
+
const LAST_EDGE = new RegExp(`[${escapeRegExp(NAME_EDGE)}][^${escapeRegExp(NAME_EDGE)}]*$`, "u");
|
|
58
|
+
const LIST_MARK = /^(?:[-*+・]|\d+[.)])\s+/u;
|
|
59
|
+
const DIGITS = /[0-90-9]/u;
|
|
60
|
+
const NUMBER = /\d[\d,]*(?:\.\d+)?/u;
|
|
61
|
+
/** Four digits or more with no comma: the row groups none, so the expected amount is not grouped either. */
|
|
62
|
+
const UNGROUPED = /\d{4}/u;
|
|
63
|
+
|
|
64
|
+
const numberOf = (written: string): number => Number(written.normalize("NFKC"));
|
|
65
|
+
|
|
66
|
+
const percentPattern = (words: FormulaWords): RegExp | undefined => {
|
|
67
|
+
const marks = alternation(words.percent);
|
|
68
|
+
return marks === undefined ? undefined : new RegExp(`(?<![0-90-9.,.,])([0-90-9]+(?:[..][0-90-9]+)?)\\s?(?:${marks})`, "giu");
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const amountsWithin = (amounts: readonly StatedAmount[], start: number, end: number): StatedAmount[] =>
|
|
72
|
+
amounts.filter((amount) => amount.offset >= start && amount.end <= end);
|
|
73
|
+
|
|
74
|
+
/** The line's last amount, with only a separator before it and nothing after it, and the text before that separator. */
|
|
75
|
+
const rowOf = (text: string, line: Line, amounts: readonly StatedAmount[]): Row | undefined => {
|
|
76
|
+
const end = line.start + line.text.length;
|
|
77
|
+
const amount = amountsWithin(amounts, line.start, end).at(-1);
|
|
78
|
+
if (amount === undefined || amount.scale !== undefined || !AFTER_AMOUNT.test(text.slice(amount.end, end))) return undefined;
|
|
79
|
+
const before = text.slice(line.start, amount.offset);
|
|
80
|
+
const separator = SEPARATOR.exec(before);
|
|
81
|
+
return separator === null ? undefined : { line, label: before.slice(0, separator.index), amount };
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const isName = (name: string): boolean => name !== "" && name.length <= NAME_MAX && !DIGITS.test(name);
|
|
85
|
+
|
|
86
|
+
/** 売買代金の3%: the name runs back from the word to the nearest bracket, comma or cell edge. */
|
|
87
|
+
const nameBefore = (label: string, rateStart: number, words: FormulaWords): Named | undefined => {
|
|
88
|
+
const head = label.slice(0, rateStart).trimEnd();
|
|
89
|
+
const word = words.nameRate.find((each) => head.toLowerCase().endsWith(each.toLowerCase()));
|
|
90
|
+
if (word === undefined) return undefined;
|
|
91
|
+
const upTo = head.slice(0, head.length - word.length);
|
|
92
|
+
const edge = LAST_EDGE.exec(upTo);
|
|
93
|
+
const from = edge === null ? 0 : edge.index + 1;
|
|
94
|
+
const raw = upTo.slice(from).replace(LIST_MARK, "");
|
|
95
|
+
const name = raw.trim();
|
|
96
|
+
return isName(name) ? { start: upTo.length - raw.trimStart().length, end: rateStart, name } : undefined;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** 3% of the sale price: the name runs on from the word to a bracket, a comma, a plus word or a tax phrase (incl. tax). */
|
|
100
|
+
const nameAfter = (label: string, rateEnd: number, words: FormulaWords): Named | undefined => {
|
|
101
|
+
const joiner = alternation(words.rateName);
|
|
102
|
+
const word = joiner === undefined ? null : new RegExp(`^\\s*(?:${joiner})\\s+`, "iu").exec(label.slice(rateEnd));
|
|
103
|
+
if (word === null) return undefined;
|
|
104
|
+
const from = rateEnd + word[0].length;
|
|
105
|
+
const taxPhrases = words.tax.filter((each) => each.role !== "rate").map((each) => each.pattern);
|
|
106
|
+
const stops = [`[${escapeRegExp(NAME_EDGE)}]`, alternation([...words.plus, ...taxPhrases]) ?? "(?!)"];
|
|
107
|
+
const stop = new RegExp(stops.join("|"), "iu").exec(label.slice(from));
|
|
108
|
+
const name = label.slice(from, stop === null ? label.length : from + stop.index).trim();
|
|
109
|
+
return isName(name) ? { start: from, end: from + name.length, name } : undefined;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/** The one rate in the label that names what it is of; two such rates are not read. */
|
|
113
|
+
const formulaIn = (label: string, words: FormulaWords): Formula | undefined => {
|
|
114
|
+
const pattern = percentPattern(words);
|
|
115
|
+
if (pattern === undefined) return undefined;
|
|
116
|
+
const found = [...label.matchAll(pattern)].flatMap((match) => {
|
|
117
|
+
const rateEnd = match.index + match[0].length;
|
|
118
|
+
const named = nameBefore(label, match.index, words) ?? nameAfter(label, rateEnd, words);
|
|
119
|
+
if (named === undefined) return [];
|
|
120
|
+
return [{ start: Math.min(named.start, match.index), end: Math.max(named.end, rateEnd), rate: numberOf(match[1] ?? ""), name: named.name }];
|
|
121
|
+
});
|
|
122
|
+
const others = [...label.matchAll(pattern)].length - found.length;
|
|
123
|
+
return found.length === 1 && others <= statedTaxRates([label], words.tax).length ? found[0] : undefined;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The amount right after a plus word after the formula (+60,000円), or none. Undefined when the label holds any other
|
|
128
|
+
* amount, or a plus word with no amount after it: the formula is then not all written in the label.
|
|
129
|
+
*/
|
|
130
|
+
const fixedOf = (text: string, row: Row, formula: Formula, amounts: readonly StatedAmount[], words: FormulaWords): StatedAmount[] | undefined => {
|
|
131
|
+
const inLabel = amountsWithin(amounts, row.line.start, row.line.start + row.label.length);
|
|
132
|
+
const plus = alternation(words.plus);
|
|
133
|
+
const after = row.line.start + formula.end;
|
|
134
|
+
const gap = plus === undefined ? null : new RegExp(`^\\s*(?:${plus})\\s*`, "iu").exec(text.slice(after, row.line.start + row.label.length));
|
|
135
|
+
const fixed = gap === null ? undefined : inLabel.find((amount) => amount.offset === after + gap[0].length);
|
|
136
|
+
if (gap !== null && fixed === undefined) return undefined;
|
|
137
|
+
const parts = fixed === undefined ? [] : [fixed];
|
|
138
|
+
return inLabel.length === parts.length ? parts : undefined;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* A word of a price with tax (税込み, incl. tax), or a tax's name with a word of inclusion (消費税8%込み, VAT included); not
|
|
143
|
+
* when the label also says the tax is left out (税別, excl. tax, tax not included).
|
|
144
|
+
*/
|
|
145
|
+
const isTaxIncluded = (label: string, words: FormulaWords): boolean => {
|
|
146
|
+
const lower = label.normalize("NFKC").toLowerCase();
|
|
147
|
+
const holds = (word: string): boolean => lower.includes(word.normalize("NFKC").toLowerCase());
|
|
148
|
+
const roleHeld = (role: TaxPriceWord["role"]): boolean => words.tax.some((word) => word.role === role && holds(word.pattern));
|
|
149
|
+
if (roleHeld("excluded") || words.notIncluded.some(holds)) return false;
|
|
150
|
+
return roleHeld("included") || (words.taxNames.some(holds) && words.includedWords.some(holds));
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/** 0 without a tax-included word; else the label's one rate, the document's one rate, or the profile's. Undefined when unknown. */
|
|
154
|
+
const taxRateOf = (row: Row, others: readonly string[], text: FormulaText, words: FormulaWords): number | undefined => {
|
|
155
|
+
if (!isTaxIncluded(row.label, words)) return 0;
|
|
156
|
+
const inLabel = statedTaxRates([row.label], words.tax);
|
|
157
|
+
if (inLabel.length > 0) return inLabel.length === 1 ? inLabel[0] : undefined;
|
|
158
|
+
const stated = statedTaxRates(others, words.tax);
|
|
159
|
+
if (stated.length > 0) return stated.length === 1 ? stated[0] : undefined;
|
|
160
|
+
return text.defaultTaxRate;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/** The amount the document labels with the name (売買代金 | 48,000,000円, Sale price: $324,000), when every such label agrees. */
|
|
164
|
+
const baseOf = (text: string, lines: readonly Line[], row: Row, name: string, amounts: readonly StatedAmount[]): StatedAmount | undefined => {
|
|
165
|
+
const label = new RegExp(`^[ \\t]*(?:[-*+][ \\t]+)?(?:[||][ \\t]*)?(?:\\*\\*)?${escapeRegExp(name)}(?:\\*\\*)?[ \\t]*[||::][ \\t]*`, "iu");
|
|
166
|
+
const found = lines.flatMap((line) => {
|
|
167
|
+
const match = line === row.line ? null : label.exec(line.text);
|
|
168
|
+
const amount = match === null ? undefined : amounts.find((each) => each.offset === line.start + match[0].length);
|
|
169
|
+
return amount === undefined || amount.currency !== row.amount.currency ? [] : [amount];
|
|
170
|
+
});
|
|
171
|
+
const [first] = found;
|
|
172
|
+
return found.every((amount) => amount.value === first?.value && amount.scale === first.scale) ? first : undefined;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/** Before tax: rate × base + fixed. The base is the interval its written digits allow; a formula's fixed part is exact (+6万円 is 60,000). */
|
|
176
|
+
const beforeTax = (text: string, terms: Terms): Interval => {
|
|
177
|
+
const base = intervalOf(terms.base, text.slice(terms.base.offset, terms.base.end));
|
|
178
|
+
const fixed = terms.fixed?.value ?? 0;
|
|
179
|
+
return { low: (base.low * terms.formula.rate) / HUNDRED + fixed, high: (base.high * terms.formula.rate) / HUNDRED + fixed };
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const ROUNDINGS: readonly ((value: number) => number)[] = [(value) => value, Math.floor, Math.round, Math.ceil];
|
|
183
|
+
|
|
184
|
+
/** Whether the written amount is the formula's, rounded down, to nearest or up, before tax or after it, to the unit or the cent. */
|
|
185
|
+
export const formulaMatches = (written: number, before: Interval, tax: number): boolean => {
|
|
186
|
+
const withTax = (value: number): number => (value * (HUNDRED + tax)) / HUNDRED;
|
|
187
|
+
// A base written with a word of scale (4,800万円) is a range; any amount in it, rounded to the unit, is right.
|
|
188
|
+
if (before.low < before.high && written >= Math.floor(withTax(before.low)) && written <= Math.ceil(withTax(before.high))) return true;
|
|
189
|
+
const candidates = [before.low, before.high].flatMap((value) => ROUNDINGS.map((round) => withTax(round(value))));
|
|
190
|
+
return candidates.some((candidate) => roundedMatches(Math.round(written * CENTS), candidate * CENTS));
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/** The expected amount as the row writes it: its unit, its grouping and its decimals. */
|
|
194
|
+
const shownLike = (written: string, value: number): string => {
|
|
195
|
+
const decimals = NUMBER.exec(written.normalize("NFKC"))?.[0].split(".")[1]?.length ?? 0;
|
|
196
|
+
const grouped = written.includes(",") || !UNGROUPED.test(written.normalize("NFKC"));
|
|
197
|
+
const number = value.toLocaleString("en-US", { minimumFractionDigits: decimals, maximumFractionDigits: decimals, useGrouping: grouped });
|
|
198
|
+
return written.normalize("NFKC").replace(NUMBER, number);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const issueOf = (text: string, row: Row, terms: Terms): StructureIssue[] => {
|
|
202
|
+
const before = beforeTax(text, terms);
|
|
203
|
+
if (formulaMatches(row.amount.value, before, terms.tax)) return [];
|
|
204
|
+
const expected = (((before.low + before.high) / 2) * (HUNDRED + terms.tax)) / HUNDRED;
|
|
205
|
+
const values = {
|
|
206
|
+
written: text.slice(row.amount.offset, row.amount.end),
|
|
207
|
+
expected: shownLike(text.slice(row.amount.offset, row.amount.end), Math.round(expected)),
|
|
208
|
+
formula: text.slice(row.line.start + terms.formula.start, terms.fixed?.end ?? row.line.start + terms.formula.end),
|
|
209
|
+
name: terms.formula.name,
|
|
210
|
+
base: text.slice(terms.base.offset, terms.base.end),
|
|
211
|
+
};
|
|
212
|
+
return [{ offset: row.amount.offset, values }];
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const termsOf = (input: FormulaText, lines: readonly Line[], row: Row, words: FormulaWords): Terms | undefined => {
|
|
216
|
+
const formula = formulaIn(row.label, words);
|
|
217
|
+
if (formula === undefined) return undefined;
|
|
218
|
+
const fixedList = fixedOf(input.text, row, formula, input.amounts, words);
|
|
219
|
+
const [fixed] = fixedList ?? [];
|
|
220
|
+
if (fixedList === undefined || (fixed !== undefined && fixed.currency !== row.amount.currency)) return undefined;
|
|
221
|
+
const base = baseOf(input.text, lines, row, formula.name, input.amounts);
|
|
222
|
+
const others = lines.filter((line) => line !== row.line).map((line) => line.text);
|
|
223
|
+
const tax = taxRateOf(row, others, input, words);
|
|
224
|
+
return base === undefined || tax === undefined ? undefined : { formula, base, fixed, tax };
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/** Every row whose label writes its formula and whose amount is not what the formula gives on the named amount. */
|
|
228
|
+
export const formulaAmountMismatches = (input: FormulaText, words: FormulaWords): StructureIssue[] => {
|
|
229
|
+
if (words.percent.length === 0 || words.nameRate.length + words.rateName.length === 0) return [];
|
|
230
|
+
const lines = linesOf(input.text);
|
|
231
|
+
return lines.flatMap((line) => {
|
|
232
|
+
const row = rowOf(input.text, line, input.amounts);
|
|
233
|
+
const terms = row === undefined ? undefined : termsOf(input, lines, row, words);
|
|
234
|
+
return row === undefined || terms === undefined ? [] : issueOf(input.text, row, terms);
|
|
235
|
+
});
|
|
236
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A role word in the plural with nothing before it at the head of a sentence (Customers who register …, Buyers may …) is
|
|
3
|
+
* the ordinary noun, capitalised because it opens the sentence. A contract that calls a party by its role writes it in the
|
|
4
|
+
* singular (Vendor shall …) or with an article (the Vendors).
|
|
5
|
+
*/
|
|
6
|
+
const PLURAL = /^s(?![\p{L}\p{N}'’])/u;
|
|
7
|
+
|
|
8
|
+
export const isGenericPlural = (bare: boolean, after: string): boolean => bare && PLURAL.test(after);
|