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,239 @@
|
|
|
1
|
+
import { cellsOf, tablesOf, type Cell } from "../facts/table-facts.ts";
|
|
2
|
+
import { withoutEdgeMarks } from "../facts/trim-marks.ts";
|
|
3
|
+
import { linesOf, type Line } from "./lines.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A results table that mixes scales without saying so: a cell written in another scale unit than the table's (110,000千円 among
|
|
7
|
+
* 百万円), or, under a stated unit, one row entered a thousand times too large (52,000 among 1,200 and 84 under 単位:百万円).
|
|
8
|
+
* The scale units, the caption marks and the total labels come from the language packages. Pure.
|
|
9
|
+
*/
|
|
10
|
+
export type ScaleUnit = { readonly word: string; readonly value: number };
|
|
11
|
+
|
|
12
|
+
export type TableScaleWords = {
|
|
13
|
+
/** Words of scale written in a cell or a caption (百万円, million, millions), with the number they multiply by. */
|
|
14
|
+
readonly units: readonly ScaleUnit[];
|
|
15
|
+
/** What marks a line as a table's caption of unit (単位, in, of). */
|
|
16
|
+
readonly captionMarks: readonly string[];
|
|
17
|
+
/** Row labels of a total (合計, Total): a total row is large by nature. */
|
|
18
|
+
readonly totalLabels: readonly string[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type TableScaleSlip = {
|
|
22
|
+
/** "unit": the cell is written in another scale unit; "row": the row is a thousand times its neighbours. */
|
|
23
|
+
readonly kind: "unit" | "row";
|
|
24
|
+
readonly item: string;
|
|
25
|
+
readonly cell: Cell;
|
|
26
|
+
/** The table's scale as written: the caption's word, or the word most cells carry. */
|
|
27
|
+
readonly tableUnit: string;
|
|
28
|
+
/** For "row": the row's first figure divided by the factor, as it would read in the table's unit. */
|
|
29
|
+
readonly reading?: number | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** A cell read as one number with, at most, a scale unit after it. */
|
|
33
|
+
export type ScaleCell = { readonly number: number; readonly digits: string; readonly unit: ScaleUnit | undefined };
|
|
34
|
+
|
|
35
|
+
/** A row a thousand times its neighbours: the factor between thousands and millions, or millions and billions. */
|
|
36
|
+
export const ROW_FACTOR = 1000;
|
|
37
|
+
/** The row's figure must be at least this many times the largest of the other rows in its column. */
|
|
38
|
+
const LARGER_THAN_OTHERS = 10;
|
|
39
|
+
/** A row is compared on at least this many columns, and with at least this many other rows. */
|
|
40
|
+
const MIN_COLUMNS = 2;
|
|
41
|
+
const MIN_OTHER_ROWS = 2;
|
|
42
|
+
/** A caption of unit is a short line; a longer one is a sentence about the figures. */
|
|
43
|
+
const MAX_CAPTION_LENGTH = 40;
|
|
44
|
+
/** How many blank lines may stand between the caption and the table. */
|
|
45
|
+
const CAPTION_REACH = 2;
|
|
46
|
+
|
|
47
|
+
const LATIN = /\p{Script=Latin}/u;
|
|
48
|
+
const LETTER = /\p{L}/u;
|
|
49
|
+
const DIGIT = /\p{Nd}/u;
|
|
50
|
+
/** Currency marks and minus signs written before the figure ($, ¥, △52, -$52). */
|
|
51
|
+
const LEAD = /^(?:US\$|[$¥€£\-−△▲\s])+/u;
|
|
52
|
+
const NEGATIVE = /[-−△▲]/u;
|
|
53
|
+
const DIGITS = /^(?:\d{1,3}(?:,\d{3})+|\d+)(?:\.\d+)?/u;
|
|
54
|
+
/** An accounting negative: the figure in brackets, (52,000). */
|
|
55
|
+
const BRACKETED = /^[((]([^()()]+)[))]$/u;
|
|
56
|
+
const CURRENCY_TAIL = /^[\p{L} ]*$/u;
|
|
57
|
+
|
|
58
|
+
const boundaryAt = (text: string, index: number): boolean => {
|
|
59
|
+
const char = text[index];
|
|
60
|
+
return char === undefined || !LETTER.test(char);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** The longest unit written at index, when it is a whole word (a Latin word must not run on: million in millions is not). */
|
|
64
|
+
const unitAt = (text: string, index: number, units: readonly ScaleUnit[]): ScaleUnit | undefined => {
|
|
65
|
+
const lower = text.toLowerCase();
|
|
66
|
+
return units
|
|
67
|
+
.filter((unit) => lower.startsWith(unit.word.toLowerCase(), index))
|
|
68
|
+
.filter((unit) => !LATIN.test(unit.word) || (boundaryAt(text, index - 1) && boundaryAt(text, index + unit.word.length)))
|
|
69
|
+
.toSorted((left, right) => right.word.length - left.word.length)[0];
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** Every unit written in the text, longest first at each place, without overlaps (百万円 is not also 万円). */
|
|
73
|
+
export const unitsIn = (text: string, units: readonly ScaleUnit[]): ScaleUnit[] => {
|
|
74
|
+
const found: ScaleUnit[] = [];
|
|
75
|
+
const step = (index: number): void => {
|
|
76
|
+
if (index >= text.length) return;
|
|
77
|
+
const unit = unitAt(text, index, units);
|
|
78
|
+
if (unit !== undefined) found.push(unit);
|
|
79
|
+
step(index + (unit?.word.length ?? 1));
|
|
80
|
+
};
|
|
81
|
+
step(0);
|
|
82
|
+
return found;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** The unit after a figure, with nothing after it but a currency word (円, US dollars); null when there is no unit. */
|
|
86
|
+
const unitAfter = (rest: string, units: readonly ScaleUnit[]): ScaleUnit | null | undefined => {
|
|
87
|
+
if (rest === "") return null;
|
|
88
|
+
const unit = unitAt(rest, 0, units);
|
|
89
|
+
return unit !== undefined && CURRENCY_TAIL.test(rest.slice(unit.word.length)) ? unit : undefined;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const negated = (cell: ScaleCell | undefined): ScaleCell | undefined => (cell === undefined || cell.number < 0 ? undefined : { ...cell, number: -cell.number });
|
|
93
|
+
|
|
94
|
+
/** A cell's number and its scale unit; undefined when the cell is not one figure (7.0%, 1,200人, —). */
|
|
95
|
+
export const scaleCellOf = (text: string, units: readonly ScaleUnit[]): ScaleCell | undefined => {
|
|
96
|
+
const plain = withoutEdgeMarks(text.trim());
|
|
97
|
+
const bracketed = BRACKETED.exec(plain)?.[1];
|
|
98
|
+
if (bracketed !== undefined) return negated(scaleCellOf(bracketed, units));
|
|
99
|
+
const lead = LEAD.exec(plain)?.[0] ?? "";
|
|
100
|
+
const digits = DIGITS.exec(plain.slice(lead.length))?.[0];
|
|
101
|
+
if (digits === undefined) return undefined;
|
|
102
|
+
const unit = unitAfter(plain.slice(lead.length + digits.length).trim(), units);
|
|
103
|
+
if (unit === undefined) return undefined;
|
|
104
|
+
const number = Number(digits.replaceAll(",", "")) * (NEGATIVE.test(lead) ? -1 : 1);
|
|
105
|
+
return { number, digits, unit: unit ?? undefined };
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const hasMark = (text: string, mark: string): boolean => {
|
|
109
|
+
const lower = text.toLowerCase();
|
|
110
|
+
const word = mark.toLowerCase();
|
|
111
|
+
const at = lower.indexOf(word);
|
|
112
|
+
if (at === -1) return false;
|
|
113
|
+
return !LATIN.test(mark) || (boundaryAt(text, at - 1) && boundaryAt(text, at + word.length)) || hasMark(text.slice(at + word.length), mark);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** The unit a line states for the table under it: a short line with no figure, a caption mark and one scale unit. */
|
|
117
|
+
export const captionUnitOf = (text: string, words: TableScaleWords): ScaleUnit | undefined => {
|
|
118
|
+
const line = text.trim();
|
|
119
|
+
if (line.length === 0 || line.length > MAX_CAPTION_LENGTH || DIGIT.test(line) || line.startsWith("|")) return undefined;
|
|
120
|
+
if (!words.captionMarks.some((mark) => hasMark(line, mark))) return undefined;
|
|
121
|
+
const found = unitsIn(line, words.units);
|
|
122
|
+
const values = new Set(found.map((unit) => unit.value));
|
|
123
|
+
return values.size === 1 ? found[0] : undefined;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const captionOf = (lines: readonly Line[], header: Line, words: TableScaleWords): ScaleUnit | undefined => {
|
|
127
|
+
const index = lines.indexOf(header);
|
|
128
|
+
const before = lines.slice(Math.max(0, index - CAPTION_REACH - 1), index).toReversed();
|
|
129
|
+
const caption = before.find((line) => line.text.trim() !== "");
|
|
130
|
+
return caption === undefined ? undefined : captionUnitOf(caption.text, words);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
type ReadCell = { readonly cell: Cell; readonly read: ScaleCell; readonly column: number };
|
|
134
|
+
type ReadRow = { readonly item: string; readonly cells: readonly ReadCell[] };
|
|
135
|
+
|
|
136
|
+
const rowsOf = (rows: readonly Line[], units: readonly ScaleUnit[]): ReadRow[] =>
|
|
137
|
+
rows.map((row) => {
|
|
138
|
+
const [first, ...rest] = cellsOf(row);
|
|
139
|
+
const cells = rest.flatMap((cell, column): ReadCell[] => {
|
|
140
|
+
const read = scaleCellOf(cell.text, units);
|
|
141
|
+
return read === undefined ? [] : [{ cell, read, column }];
|
|
142
|
+
});
|
|
143
|
+
return { item: withoutEdgeMarks((first?.text ?? "").trim()), cells };
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
/** The unit most cells carry, when at least two do and no other unit is as common. */
|
|
147
|
+
const usualUnitOf = (rows: readonly ReadRow[]): ScaleUnit | undefined => {
|
|
148
|
+
const counts = new Map<number, { unit: ScaleUnit; count: number }>();
|
|
149
|
+
rows.forEach((row) =>
|
|
150
|
+
row.cells.forEach(({ read }) => {
|
|
151
|
+
if (read.unit === undefined) return;
|
|
152
|
+
const seen = counts.get(read.unit.value);
|
|
153
|
+
counts.set(read.unit.value, { unit: seen?.unit ?? read.unit, count: (seen?.count ?? 0) + 1 });
|
|
154
|
+
}),
|
|
155
|
+
);
|
|
156
|
+
const [top, second] = [...counts.values()].toSorted((left, right) => right.count - left.count);
|
|
157
|
+
return top !== undefined && top.count >= MIN_OTHER_ROWS && (second === undefined || second.count < top.count) ? top.unit : undefined;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Whether a cell's unit departs from the table's. Under a stated unit, any other unit does. Without one, only a smaller unit
|
|
162
|
+
* with a figure of one table unit or more (110,000千円 among 百万円): a larger unit for a large figure ($2.4 billion among
|
|
163
|
+
* $130 million) is a normal way of writing.
|
|
164
|
+
*/
|
|
165
|
+
const departs = (read: ScaleCell, table: ScaleUnit, stated: boolean): boolean => {
|
|
166
|
+
if (read.unit === undefined || read.unit.value === table.value) return false;
|
|
167
|
+
if (stated) return true;
|
|
168
|
+
return read.unit.value < table.value && Math.abs(read.number) * read.unit.value >= table.value;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const unitSlips = (rows: readonly ReadRow[], table: ScaleUnit, stated: boolean): TableScaleSlip[] =>
|
|
172
|
+
rows.flatMap((row) => {
|
|
173
|
+
const odd = row.cells.find(({ read }) => departs(read, table, stated));
|
|
174
|
+
return odd === undefined ? [] : [{ kind: "unit" as const, item: row.item, cell: odd.cell, tableUnit: table.word }];
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
const isTotal = (item: string, labels: readonly string[]): boolean => labels.some((label) => item.toLowerCase().startsWith(label.toLowerCase()));
|
|
178
|
+
|
|
179
|
+
/** A row's figure that reads as entered in a unit a thousand times smaller: whole thousands, at least one thousand. */
|
|
180
|
+
const wholeThousands = (read: ScaleCell): boolean =>
|
|
181
|
+
read.unit === undefined && !read.digits.includes(".") && Math.abs(read.number) >= ROW_FACTOR && read.number % ROW_FACTOR === 0;
|
|
182
|
+
|
|
183
|
+
type BareRow = { readonly row: ReadRow; readonly figures: ReadonlyMap<number, ReadCell> };
|
|
184
|
+
|
|
185
|
+
const bareRowsOf = (rows: readonly ReadRow[]): BareRow[] =>
|
|
186
|
+
rows.map((row) => ({ row, figures: new Map(row.cells.filter((entry) => entry.read.unit === undefined).map((entry) => [entry.column, entry])) }));
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Whether one figure stands a thousand times above its column: at least ten times the largest other figure, and a thousandth
|
|
190
|
+
* of it no larger than that figure, so it reads as one of them once divided.
|
|
191
|
+
*/
|
|
192
|
+
const standsAbove = (figure: ScaleCell, others: readonly number[]): boolean => {
|
|
193
|
+
const largest = Math.max(...others.map((value) => Math.abs(value)));
|
|
194
|
+
return others.length >= MIN_OTHER_ROWS && Math.abs(figure.number) >= LARGER_THAN_OTHERS * largest && Math.abs(figure.number) / ROW_FACTOR <= largest;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const rowStandsAbove = (candidate: BareRow, rows: readonly BareRow[]): boolean => {
|
|
198
|
+
const figures = [...candidate.figures.entries()];
|
|
199
|
+
return (
|
|
200
|
+
figures.length >= MIN_COLUMNS &&
|
|
201
|
+
figures.every(([column, figure]) => {
|
|
202
|
+
const others = rows.flatMap((row) => {
|
|
203
|
+
const other = row === candidate ? undefined : row.figures.get(column);
|
|
204
|
+
return other === undefined ? [] : [other.read.number];
|
|
205
|
+
});
|
|
206
|
+
return wholeThousands(figure.read) && standsAbove(figure.read, others);
|
|
207
|
+
})
|
|
208
|
+
);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The one row, under a stated unit, entered a thousand times too large. Every figure of the row must be whole thousands (a row
|
|
213
|
+
* multiplied by a thousand always is; a genuinely large row, such as total assets, almost never is in every column), stand ten
|
|
214
|
+
* times above every other row of its column, and fall among them once divided. A total row and a row whose label carries its
|
|
215
|
+
* own unit in brackets (従業員数(人)) are left alone, and so is a table where more than one row stands out (each in its own columns).
|
|
216
|
+
*/
|
|
217
|
+
const rowSlips = (rows: readonly ReadRow[], table: ScaleUnit, words: TableScaleWords): TableScaleSlip[] => {
|
|
218
|
+
const bare = bareRowsOf(rows);
|
|
219
|
+
const standing = bare.filter((row) => !isTotal(row.row.item, words.totalLabels) && !/[((]/u.test(row.row.item) && rowStandsAbove(row, bare));
|
|
220
|
+
const [only] = standing;
|
|
221
|
+
if (only === undefined || standing.length > 1) return [];
|
|
222
|
+
const first = [...only.figures.values()][0];
|
|
223
|
+
return first === undefined ? [] : [{ kind: "row", item: only.row.item, cell: first.cell, tableUnit: table.word, reading: first.read.number / ROW_FACTOR }];
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
const tableSlips = (lines: readonly Line[], table: { header: Line; rows: Line[] }, words: TableScaleWords): TableScaleSlip[] => {
|
|
227
|
+
const rows = rowsOf(table.rows, words.units);
|
|
228
|
+
const caption = captionOf(lines, table.header, words);
|
|
229
|
+
const unit = caption ?? usualUnitOf(rows);
|
|
230
|
+
if (unit === undefined) return [];
|
|
231
|
+
const units = unitSlips(rows, unit, caption !== undefined);
|
|
232
|
+
return caption === undefined ? units : [...units, ...rowSlips(rows, caption, words)];
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/** Every table of the text that mixes scales, and the cells or rows that depart. */
|
|
236
|
+
export const tableScaleSlips = (text: string, words: TableScaleWords): TableScaleSlip[] => {
|
|
237
|
+
const lines = linesOf(text);
|
|
238
|
+
return tablesOf(lines).flatMap((table) => tableSlips(lines, table, words));
|
|
239
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// tax-mismatch in a price list: one row's tax-included price that is not its tax-excluded price plus the rate. The two
|
|
2
|
+
// columns are the ones whose headings are the same apart from the excluded / included words and a rate (「1箱の価格(税抜)」,
|
|
3
|
+
// 「1箱の価格(税込・10%)」); the rate is the included heading's, else the one rate the document states beside a tax word. Pure.
|
|
4
|
+
import type { StructureIssue } from "./issues.ts";
|
|
5
|
+
import { holds, plain, valueIn, type ChangeTable, type TableCell } from "./change-rate-table.ts";
|
|
6
|
+
import { withoutWord } from "./net-gross-weight.ts";
|
|
7
|
+
import { bodyRows, offsetOf } from "./order-quantity.ts";
|
|
8
|
+
import { roundedMatches } from "./tax.ts";
|
|
9
|
+
|
|
10
|
+
/** excluded: a price before tax. included: a price with tax. rate: a word beside which a rate in a sentence is the tax rate. */
|
|
11
|
+
export type TaxPriceRole = "excluded" | "included" | "rate";
|
|
12
|
+
export type TaxPriceWord = { readonly pattern: string; readonly role: TaxPriceRole };
|
|
13
|
+
/** The document's tables and its lines outside tables. */
|
|
14
|
+
export type TaxPriceText = { readonly tables: readonly ChangeTable[]; readonly lines: readonly string[] };
|
|
15
|
+
export type TaxPricePair = { readonly excluded: number; readonly included: number; readonly rate: number | undefined };
|
|
16
|
+
|
|
17
|
+
const RATE = /(\d{1,2}(?:\.\d{1,2})?)[ \t]?%/gu;
|
|
18
|
+
const MAX_RATE = 100;
|
|
19
|
+
const CENTS = 100;
|
|
20
|
+
const SPACES = /\s+/gu;
|
|
21
|
+
/** Spaces and punctuation: 「(税込・10%)」 and "(incl. 8% tax)" say nothing besides once the words are out; $ and € still do. */
|
|
22
|
+
const SPACES_AND_MARKS = /[\s\p{P}]+/gu;
|
|
23
|
+
/** What may stand between a tax word and its rate: 「消費税率は10%」, "sales tax of 8%", "VAT: 20%". */
|
|
24
|
+
const FILLER_MARKS: ReadonlySet<string> = new Set([":", ":", "=", "(", "(", "は", "が", "の"]);
|
|
25
|
+
const FILLER_WORDS: readonly string[] = [" of", " at", " is"];
|
|
26
|
+
const AFTER_RATE = /^[\s))]+/u;
|
|
27
|
+
const NUMBER = /\d[\d,]*(?:\.\d+)?/u;
|
|
28
|
+
const LATIN_LETTER = /[a-z]/u;
|
|
29
|
+
|
|
30
|
+
const ratesIn = (text: string): number[] =>
|
|
31
|
+
[...text.matchAll(RATE)].map((match) => Number(match[1])).filter((rate) => Number.isFinite(rate) && rate > 0 && rate < MAX_RATE);
|
|
32
|
+
|
|
33
|
+
type Heading = { readonly role: "excluded" | "included"; readonly rest: string; readonly rate: number | undefined };
|
|
34
|
+
|
|
35
|
+
const heldWords = (key: string, words: readonly TaxPriceWord[], role: TaxPriceRole): string[] =>
|
|
36
|
+
words
|
|
37
|
+
.filter((word) => word.role === role && holds(key, word.pattern))
|
|
38
|
+
.map((word) => word.pattern)
|
|
39
|
+
.toSorted((left, right) => right.length - left.length);
|
|
40
|
+
|
|
41
|
+
/** The role a heading names, what it says besides, and its one rate. A heading naming both roles is not read. */
|
|
42
|
+
const headingOf = (heading: string, words: readonly TaxPriceWord[]): Heading | undefined => {
|
|
43
|
+
const key = plain(heading).toLowerCase();
|
|
44
|
+
const rates = ratesIn(key);
|
|
45
|
+
const withoutRate = key.replace(RATE, " ").replace(SPACES, " ");
|
|
46
|
+
const [excluded, included] = [heldWords(withoutRate, words, "excluded"), heldWords(withoutRate, words, "included")];
|
|
47
|
+
if (excluded.length > 0 === included.length > 0) return undefined;
|
|
48
|
+
const role = excluded.length > 0 ? "excluded" : "included";
|
|
49
|
+
const rest = [...excluded, ...included].reduce((left, word) => withoutWord(left, word), withoutRate);
|
|
50
|
+
return { role, rest: rest.replace(SPACES_AND_MARKS, ""), rate: rates.length === 1 ? rates[0] : undefined };
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** Each included column with the one excluded column whose heading says the same besides, and the included heading's rate. */
|
|
54
|
+
export const taxPricePairsOf = (headings: readonly string[], words: readonly TaxPriceWord[]): TaxPricePair[] => {
|
|
55
|
+
const read = headings.map((heading) => headingOf(heading, words));
|
|
56
|
+
const columnsOf = (role: Heading["role"], rest: string): number[] =>
|
|
57
|
+
read.flatMap((found, index) => (found?.role === role && found.rest === rest ? [index] : []));
|
|
58
|
+
return read.flatMap((found, included) => {
|
|
59
|
+
if (found?.role !== "included" || columnsOf("included", found.rest).length !== 1) return [];
|
|
60
|
+
const [excluded, ...others] = columnsOf("excluded", found.rest);
|
|
61
|
+
return excluded === undefined || others.length > 0 ? [] : [{ excluded, included, rate: found.rate }];
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const withoutFillers = (text: string): string => {
|
|
66
|
+
const trimmed = text.trimEnd();
|
|
67
|
+
const last = trimmed.at(-1);
|
|
68
|
+
if (last !== undefined && FILLER_MARKS.has(last)) return withoutFillers(trimmed.slice(0, -1));
|
|
69
|
+
const word = FILLER_WORDS.find((filler) => trimmed.endsWith(filler));
|
|
70
|
+
return word === undefined ? trimmed : withoutFillers(trimmed.slice(0, -word.length));
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const besideWord = (line: string, at: number, end: number, word: string): boolean => {
|
|
74
|
+
const written = plain(word).toLowerCase();
|
|
75
|
+
const before = withoutFillers(line.slice(0, at).toLowerCase());
|
|
76
|
+
const after = line.slice(end).toLowerCase().replace(AFTER_RATE, "");
|
|
77
|
+
const standsAlone = (next: string | undefined): boolean => !LATIN_LETTER.test(written) || next === undefined || !LATIN_LETTER.test(next);
|
|
78
|
+
return (before.endsWith(written) && standsAlone(before.at(-written.length - 1))) || (after.startsWith(written) && standsAlone(after[written.length]));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** The distinct rates the lines state right beside a rate word: 「消費税10%」, "8% sales tax", "tax rate of 8%". */
|
|
82
|
+
export const statedTaxRates = (lines: readonly string[], words: readonly TaxPriceWord[]): number[] => {
|
|
83
|
+
const rateWords = words.filter((word) => word.role === "rate").map((word) => word.pattern);
|
|
84
|
+
const rates = lines.flatMap((written) => {
|
|
85
|
+
const line = plain(written);
|
|
86
|
+
return [...line.matchAll(RATE)].flatMap((match) => {
|
|
87
|
+
const end = match.index + match[0].length;
|
|
88
|
+
return rateWords.some((word) => besideWord(line, match.index, end, word)) ? ratesIn(match[0]) : [];
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
return [...new Set(rates)];
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** The tax-included price as the cell writes it: its unit, its grouping and its decimals. */
|
|
95
|
+
const shownLike = (written: string, exactCents: number, decimals: number): string => {
|
|
96
|
+
const number = (Math.round(exactCents) / CENTS).toLocaleString("en-US", {
|
|
97
|
+
minimumFractionDigits: decimals,
|
|
98
|
+
maximumFractionDigits: decimals,
|
|
99
|
+
useGrouping: written.includes(","),
|
|
100
|
+
});
|
|
101
|
+
return written.replace(NUMBER, number);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const decimalsOf = (text: string): number => NUMBER.exec(text)?.[0].split(".")[1]?.length ?? 0;
|
|
105
|
+
|
|
106
|
+
const rowIssue = (excludedCell: TableCell | undefined, includedCell: TableCell | undefined, rate: number): StructureIssue[] => {
|
|
107
|
+
const [excluded, included] = [excludedCell && valueIn(excludedCell.text), includedCell && valueIn(includedCell.text)];
|
|
108
|
+
if (includedCell === undefined || excluded === undefined || included === undefined || excluded.marks !== included.marks) return [];
|
|
109
|
+
if (excluded.value <= 0) return [];
|
|
110
|
+
// price × (100 + rate)% in cents is price × (100 + rate); the price is not rounded first ($0.335 at 10% is $0.3685).
|
|
111
|
+
const exactCents = excluded.value * (CENTS + rate);
|
|
112
|
+
if (roundedMatches(Math.round(included.value * CENTS), exactCents, included.step >= 1)) return [];
|
|
113
|
+
const written = plain(includedCell.text);
|
|
114
|
+
const values = { written, expected: shownLike(written, exactCents, decimalsOf(written)), rate: `${String(rate)}%`, base: plain(excludedCell?.text ?? "") };
|
|
115
|
+
return [{ offset: offsetOf(includedCell), values }];
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Each row of a price list whose tax-included price is not its tax-excluded price plus the rate, rounded down, to nearest or
|
|
120
|
+
* up. A pair is not read when the document states a rate other than its own (a reduced rate beside the standard one): which
|
|
121
|
+
* items take which is not written in the columns.
|
|
122
|
+
*/
|
|
123
|
+
export const taxIncludedPriceMismatches = (text: TaxPriceText, words: readonly TaxPriceWord[]): StructureIssue[] => {
|
|
124
|
+
if (words.length === 0) return [];
|
|
125
|
+
const stated = statedTaxRates(text.lines, words);
|
|
126
|
+
return text.tables.flatMap((table) =>
|
|
127
|
+
taxPricePairsOf(
|
|
128
|
+
table.header.map((cell) => cell.text),
|
|
129
|
+
words,
|
|
130
|
+
).flatMap((pair) => {
|
|
131
|
+
const rate = pair.rate ?? stated[0];
|
|
132
|
+
if (rate === undefined || stated.some((other) => other !== rate)) return [];
|
|
133
|
+
return bodyRows(table).flatMap((row) => rowIssue(row[pair.excluded], row[pair.included], rate));
|
|
134
|
+
}),
|
|
135
|
+
);
|
|
136
|
+
};
|
package/src/structure/tax.ts
CHANGED
|
@@ -15,6 +15,8 @@ export type TaxWords = {
|
|
|
15
15
|
readonly totals: readonly string[];
|
|
16
16
|
/** 税の行が内税だと分かる語(うち、included)。 */
|
|
17
17
|
readonly included: readonly string[];
|
|
18
|
+
/** 率で掛かる料金の行の頭の語(サービス料、Service charge)。税はその料金を足した額に掛かってもよい。 */
|
|
19
|
+
readonly charges: readonly string[];
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
const RATE = /(\d{1,2}(?:\.\d{1,2})?)[ \t]?[%%]/u;
|
|
@@ -22,6 +24,8 @@ const PERCENT = new Set(["%", "%"]);
|
|
|
22
24
|
/** A sign or an opening bracket right before an amount (-$200, ▲500, (1,200)): the amount may be negative. */
|
|
23
25
|
const SIGNED = /[-−▲△((][ \t]?(?:[$€£¥¥][ \t]?)?$/u;
|
|
24
26
|
const CENTS = 100;
|
|
27
|
+
/** More charge rows than this in a row give too many ways to tax them, so there is no base. */
|
|
28
|
+
const MAX_CHARGES = 4;
|
|
25
29
|
const MAX_RATE = 100;
|
|
26
30
|
|
|
27
31
|
type Row = { readonly line: Line; readonly text: string; readonly amounts: readonly Amount[] };
|
|
@@ -41,6 +45,8 @@ const rateOf = (text: string): number | undefined => {
|
|
|
41
45
|
const isTaxRow = (row: Row, words: TaxWords): boolean =>
|
|
42
46
|
isTotalLabel(row.text, words.labels) && !words.included.some((word) => row.text.toLowerCase().includes(word.toLowerCase()));
|
|
43
47
|
|
|
48
|
+
const isChargeRow = (row: Row, words: TaxWords): boolean => isTotalLabel(row.text, words.charges) && rateOf(row.text) !== undefined;
|
|
49
|
+
|
|
44
50
|
/** The list marker at the start of a line (- $500) is not a sign. */
|
|
45
51
|
const isSigned = (source: string, row: Row, amount: Amount): boolean => {
|
|
46
52
|
const before = source.slice(row.line.start, amount.offset);
|
|
@@ -58,21 +64,40 @@ const amountAt = (source: string, row: Row, column: number, unit: string): Amoun
|
|
|
58
64
|
return matching.length === 1 && only !== undefined && !isSigned(source, row, only) ? only : undefined;
|
|
59
65
|
};
|
|
60
66
|
|
|
67
|
+
const sumOf = (values: readonly number[]): number => values.reduce((sum, value) => sum + value, 0);
|
|
68
|
+
|
|
69
|
+
/** The amounts of the rows in the column and unit of the tax, undefined when a row has none (or more than one). */
|
|
70
|
+
const valuesAt = (source: string, rows: readonly Row[], column: number, unit: string): number[] | undefined => {
|
|
71
|
+
const amounts = rows.map((row) => amountAt(source, row, column, unit));
|
|
72
|
+
return amounts.some((amount) => amount === undefined) ? undefined : amounts.flatMap((amount) => (amount === undefined ? [] : [amount.value]));
|
|
73
|
+
};
|
|
74
|
+
|
|
61
75
|
/**
|
|
62
|
-
* The base
|
|
63
|
-
*
|
|
76
|
+
* The base with each set of the charges above it added, the full sum last: a tax may be on the subtotal alone or with some
|
|
77
|
+
* charges (hotels tax the service charge; a gratuity may be untaxed).
|
|
64
78
|
*/
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
79
|
+
const withCharges = (base: number, charges: readonly number[]): number[] =>
|
|
80
|
+
charges.length > MAX_CHARGES ? [] : charges.reduce<number[]>((sums, charge) => [...sums, ...sums.map((sum) => sum + charge)], [0]).map((sum) => base + sum);
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The bases the rate may be on: the last total row above, or the sum of the item rows above when there is no total row,
|
|
84
|
+
* each with and without the rate charge rows (a service charge) right above the row. Any other row with an amount between
|
|
85
|
+
* the total and the row (a discount, shipping) may or may not be taxed, so there is no base.
|
|
86
|
+
*/
|
|
87
|
+
const basesOf = (source: string, above: readonly Row[], tax: Amount, column: number, words: TaxWords): number[] => {
|
|
88
|
+
const chargeStart = above.findLastIndex((row) => !isChargeRow(row, words)) + 1;
|
|
89
|
+
const charges = valuesAt(source, above.slice(chargeStart), column, tax.unit);
|
|
90
|
+
if (charges === undefined) return [];
|
|
91
|
+
const before = above.slice(0, chargeStart);
|
|
92
|
+
const lastTotalIndex = before.findLastIndex((row) => isTotalLabel(row.text, words.totals));
|
|
93
|
+
const lastTotal = before[lastTotalIndex];
|
|
68
94
|
if (lastTotal !== undefined) {
|
|
69
|
-
const
|
|
70
|
-
|
|
95
|
+
const total = amountAt(source, lastTotal, column, tax.unit);
|
|
96
|
+
const between = before.slice(lastTotalIndex + 1);
|
|
97
|
+
return total === undefined || between.some((row) => row.amounts.length > 0) ? [] : withCharges(total.value, charges);
|
|
71
98
|
}
|
|
72
|
-
const items =
|
|
73
|
-
|
|
74
|
-
const values = items.flatMap((item) => (item === undefined ? [] : [item.value]));
|
|
75
|
-
return { offset: tax.offset, end: tax.end, unit: tax.unit, value: values.reduce((sum, value) => sum + value, 0) };
|
|
99
|
+
const items = valuesAt(source, before, column, tax.unit);
|
|
100
|
+
return items === undefined || items.length === 0 ? [] : withCharges(sumOf(items), charges);
|
|
76
101
|
};
|
|
77
102
|
|
|
78
103
|
/**
|
|
@@ -94,21 +119,31 @@ const issueOf = (source: string, rows: readonly Row[], index: number, rate: numb
|
|
|
94
119
|
const tax = row?.amounts.length === 1 ? row.amounts[0] : undefined;
|
|
95
120
|
if (row === undefined || tax === undefined || isSigned(source, row, tax)) return [];
|
|
96
121
|
const column = columnOf(source, row.line, tax.offset);
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
122
|
+
const bases = basesOf(source, rows.slice(0, index), tax, column, words);
|
|
123
|
+
const base = bases.at(-1);
|
|
124
|
+
if (base === undefined || bases.some((candidate) => taxMatches(Math.round(tax.value * CENTS), candidate, rate))) return [];
|
|
125
|
+
const expectedCents = Math.round(base * rate);
|
|
100
126
|
const shown = shownTotal(source, tax, expectedCents);
|
|
101
127
|
return [{ offset: tax.offset, values: { written: shown.written ?? "", expected: shown.sum ?? "", rate: `${String(rate)}%` } }];
|
|
102
128
|
};
|
|
103
129
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
130
|
+
type RateRow = { readonly index: number; readonly rate: number };
|
|
131
|
+
|
|
132
|
+
const rateRowsOf = (rows: readonly Row[], isRateRow: (row: Row) => boolean): RateRow[] =>
|
|
133
|
+
rows.flatMap((row, index) => {
|
|
134
|
+
const rate = isRateRow(row) ? rateOf(row.text) : undefined;
|
|
107
135
|
return rate === undefined ? [] : [{ index, rate }];
|
|
108
136
|
});
|
|
109
|
-
|
|
110
|
-
|
|
137
|
+
|
|
138
|
+
/** Tax rows of different rates split the base (a reduced rate), so none is compared; a charge row is not a tax row. */
|
|
139
|
+
const runIssues = (source: string, rows: readonly Row[], words: TaxWords): StructureIssue[] => {
|
|
140
|
+
const taxRows = rateRowsOf(rows, (row) => isTaxRow(row, words) && !isChargeRow(row, words));
|
|
141
|
+
const firstTax = taxRows[0]?.index ?? rows.length;
|
|
142
|
+
// A charge below a tax row (a suggested gratuity under the total) is often on the amount before tax, so it is not read.
|
|
143
|
+
const chargeRows = rateRowsOf(rows, (row) => isChargeRow(row, words)).filter((row) => row.index < firstTax);
|
|
144
|
+
const comparable = new Set(taxRows.map((row) => row.rate)).size > 1 ? chargeRows : [...taxRows, ...chargeRows];
|
|
145
|
+
return comparable.flatMap(({ index, rate }) => issueOf(source, rows, index, rate, words));
|
|
111
146
|
};
|
|
112
147
|
|
|
113
148
|
export const taxMismatches = (source: string, amounts: readonly Amount[], words: TaxWords): StructureIssue[] =>
|
|
114
|
-
words.labels.length === 0 ? [] : runsOf(source).flatMap((run) => runIssues(source, rowsOf(source, run, amounts), words));
|
|
149
|
+
words.labels.length + words.charges.length === 0 ? [] : runsOf(source).flatMap((run) => runIssues(source, rowsOf(source, run, amounts), words));
|