chaffjs 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +330 -0
- package/README.md +119 -257
- package/dist/company-kana-spelling.d.ts +31 -0
- package/dist/company-kana-spelling.d.ts.map +1 -0
- package/dist/company-kana-spelling.js +79 -0
- package/dist/company-kana-spelling.js.map +1 -0
- package/dist/company-names.d.ts +32 -1
- package/dist/company-names.d.ts.map +1 -1
- package/dist/company-names.js +129 -22
- package/dist/company-names.js.map +1 -1
- package/dist/contacts/table-rows.d.ts +7 -0
- package/dist/contacts/table-rows.d.ts.map +1 -0
- package/dist/contacts/table-rows.js +42 -0
- package/dist/contacts/table-rows.js.map +1 -0
- package/dist/derived/age-on-date.d.ts +53 -0
- package/dist/derived/age-on-date.d.ts.map +1 -0
- package/dist/derived/age-on-date.js +114 -0
- package/dist/derived/age-on-date.js.map +1 -0
- package/dist/derived/durations.d.ts +17 -2
- package/dist/derived/durations.d.ts.map +1 -1
- package/dist/derived/durations.js +61 -10
- package/dist/derived/durations.js.map +1 -1
- package/dist/derived/hours-and-minutes.d.ts +26 -0
- package/dist/derived/hours-and-minutes.d.ts.map +1 -0
- package/dist/derived/hours-and-minutes.js +24 -0
- package/dist/derived/hours-and-minutes.js.map +1 -0
- package/dist/derived/hyphenated-counts.d.ts +15 -0
- package/dist/derived/hyphenated-counts.d.ts.map +1 -0
- package/dist/derived/hyphenated-counts.js +31 -0
- package/dist/derived/hyphenated-counts.js.map +1 -0
- package/dist/derived/marked-dates.d.ts +15 -0
- package/dist/derived/marked-dates.d.ts.map +1 -0
- package/dist/derived/marked-dates.js +41 -0
- package/dist/derived/marked-dates.js.map +1 -0
- package/dist/derived/money-span.d.ts +9 -0
- package/dist/derived/money-span.d.ts.map +1 -0
- package/dist/derived/money-span.js +6 -0
- package/dist/derived/money-span.js.map +1 -0
- package/dist/derived/period-parts.d.ts +55 -0
- package/dist/derived/period-parts.d.ts.map +1 -0
- package/dist/derived/period-parts.js +283 -0
- package/dist/derived/period-parts.js.map +1 -0
- package/dist/derived/readable-date.d.ts +20 -0
- package/dist/derived/readable-date.d.ts.map +1 -0
- package/dist/derived/readable-date.js +50 -0
- package/dist/derived/readable-date.js.map +1 -0
- package/dist/derived/stays.d.ts +3 -1
- package/dist/derived/stays.d.ts.map +1 -1
- package/dist/derived/stays.js +3 -0
- package/dist/derived/stays.js.map +1 -1
- package/dist/derived/timesheet-hours.d.ts +27 -0
- package/dist/derived/timesheet-hours.d.ts.map +1 -0
- package/dist/derived/timesheet-hours.js +86 -0
- package/dist/derived/timesheet-hours.js.map +1 -0
- package/dist/derived/use-maximum.d.ts +27 -0
- package/dist/derived/use-maximum.d.ts.map +1 -0
- package/dist/derived/use-maximum.js +104 -0
- package/dist/derived/use-maximum.js.map +1 -0
- package/dist/derived/working-hours.d.ts +4 -5
- package/dist/derived/working-hours.d.ts.map +1 -1
- package/dist/detectors/annual-holidays-mismatch.d.ts +3 -0
- package/dist/detectors/annual-holidays-mismatch.d.ts.map +1 -0
- package/dist/detectors/annual-holidays-mismatch.js +29 -0
- package/dist/detectors/annual-holidays-mismatch.js.map +1 -0
- package/dist/detectors/annual-pay-mismatch.d.ts +3 -0
- package/dist/detectors/annual-pay-mismatch.d.ts.map +1 -0
- package/dist/detectors/annual-pay-mismatch.js +52 -0
- package/dist/detectors/annual-pay-mismatch.js.map +1 -0
- package/dist/detectors/blank-structure.d.ts +3 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +45 -12
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/bmi-mismatch.d.ts +3 -0
- package/dist/detectors/bmi-mismatch.d.ts.map +1 -0
- package/dist/detectors/bmi-mismatch.js +70 -0
- package/dist/detectors/bmi-mismatch.js.map +1 -0
- package/dist/detectors/change-rate.d.ts.map +1 -1
- package/dist/detectors/change-rate.js +24 -9
- package/dist/detectors/change-rate.js.map +1 -1
- package/dist/detectors/closing-balance-mismatch.d.ts +3 -0
- package/dist/detectors/closing-balance-mismatch.d.ts.map +1 -0
- package/dist/detectors/closing-balance-mismatch.js +42 -0
- package/dist/detectors/closing-balance-mismatch.js.map +1 -0
- package/dist/detectors/contact-variant.d.ts.map +1 -1
- package/dist/detectors/contact-variant.js +6 -2
- package/dist/detectors/contact-variant.js.map +1 -1
- package/dist/detectors/cumulative-below-current.d.ts +3 -0
- package/dist/detectors/cumulative-below-current.d.ts.map +1 -0
- package/dist/detectors/cumulative-below-current.js +25 -0
- package/dist/detectors/cumulative-below-current.js.map +1 -0
- package/dist/detectors/currency-column.d.ts +3 -0
- package/dist/detectors/currency-column.d.ts.map +1 -0
- package/dist/detectors/currency-column.js +32 -0
- package/dist/detectors/currency-column.js.map +1 -0
- package/dist/detectors/date-any-year.d.ts +24 -0
- package/dist/detectors/date-any-year.d.ts.map +1 -0
- package/dist/detectors/date-any-year.js +103 -0
- package/dist/detectors/date-any-year.js.map +1 -0
- package/dist/detectors/date-outside-period.d.ts.map +1 -1
- package/dist/detectors/date-outside-period.js +4 -10
- package/dist/detectors/date-outside-period.js.map +1 -1
- package/dist/detectors/date-stamp-order.d.ts.map +1 -1
- package/dist/detectors/date-stamp-order.js +2 -1
- package/dist/detectors/date-stamp-order.js.map +1 -1
- package/dist/detectors/date-year.d.ts +18 -6
- package/dist/detectors/date-year.d.ts.map +1 -1
- package/dist/detectors/date-year.js +39 -11
- package/dist/detectors/date-year.js.map +1 -1
- package/dist/detectors/deductible-exceeds-limit.d.ts +4 -0
- package/dist/detectors/deductible-exceeds-limit.d.ts.map +1 -0
- package/dist/detectors/deductible-exceeds-limit.js +46 -0
- package/dist/detectors/deductible-exceeds-limit.js.map +1 -0
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +6 -20
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/derived-numbers.d.ts +4 -3
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +43 -70
- package/dist/detectors/derived-numbers.js.map +1 -1
- package/dist/detectors/discount-rate.d.ts +3 -0
- package/dist/detectors/discount-rate.d.ts.map +1 -0
- package/dist/detectors/discount-rate.js +35 -0
- package/dist/detectors/discount-rate.js.map +1 -0
- package/dist/detectors/due-date.d.ts.map +1 -1
- package/dist/detectors/due-date.js +11 -4
- package/dist/detectors/due-date.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +10 -2
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +24 -5
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/event-deadline.d.ts.map +1 -1
- package/dist/detectors/event-deadline.js +11 -2
- package/dist/detectors/event-deadline.js.map +1 -1
- package/dist/detectors/fact-consistency.d.ts.map +1 -1
- package/dist/detectors/fact-consistency.js +112 -5
- package/dist/detectors/fact-consistency.js.map +1 -1
- package/dist/detectors/gloss-year.d.ts +11 -0
- package/dist/detectors/gloss-year.d.ts.map +1 -0
- package/dist/detectors/gloss-year.js +14 -0
- package/dist/detectors/gloss-year.js.map +1 -0
- package/dist/detectors/gpa-mismatch.d.ts +3 -0
- package/dist/detectors/gpa-mismatch.d.ts.map +1 -0
- package/dist/detectors/gpa-mismatch.js +39 -0
- package/dist/detectors/gpa-mismatch.js.map +1 -0
- package/dist/detectors/impossible-date.d.ts.map +1 -1
- package/dist/detectors/impossible-date.js +22 -6
- package/dist/detectors/impossible-date.js.map +1 -1
- package/dist/detectors/installment-total-mismatch.d.ts +3 -0
- package/dist/detectors/installment-total-mismatch.d.ts.map +1 -0
- package/dist/detectors/installment-total-mismatch.js +49 -0
- package/dist/detectors/installment-total-mismatch.js.map +1 -0
- package/dist/detectors/interest.d.ts +3 -0
- package/dist/detectors/interest.d.ts.map +1 -0
- package/dist/detectors/interest.js +38 -0
- package/dist/detectors/interest.js.map +1 -0
- package/dist/detectors/lab-columns.d.ts +4 -0
- package/dist/detectors/lab-columns.d.ts.map +1 -0
- package/dist/detectors/lab-columns.js +3 -0
- package/dist/detectors/lab-columns.js.map +1 -0
- package/dist/detectors/labelled-age.d.ts +4 -0
- package/dist/detectors/labelled-age.d.ts.map +1 -0
- package/dist/detectors/labelled-age.js +110 -0
- package/dist/detectors/labelled-age.js.map +1 -0
- package/dist/detectors/line-amount.d.ts.map +1 -1
- package/dist/detectors/line-amount.js +45 -2
- package/dist/detectors/line-amount.js.map +1 -1
- package/dist/detectors/measured-facts.d.ts +1 -1
- package/dist/detectors/measured-facts.d.ts.map +1 -1
- package/dist/detectors/measured-facts.js.map +1 -1
- package/dist/detectors/meter-usage.d.ts +3 -0
- package/dist/detectors/meter-usage.d.ts.map +1 -0
- package/dist/detectors/meter-usage.js +37 -0
- package/dist/detectors/meter-usage.js.map +1 -0
- package/dist/detectors/name-field.d.ts +13 -0
- package/dist/detectors/name-field.d.ts.map +1 -0
- package/dist/detectors/name-field.js +38 -0
- package/dist/detectors/name-field.js.map +1 -0
- package/dist/detectors/name-variant.d.ts.map +1 -1
- package/dist/detectors/name-variant.js +128 -14
- package/dist/detectors/name-variant.js.map +1 -1
- package/dist/detectors/net-amount-mismatch.d.ts +10 -0
- package/dist/detectors/net-amount-mismatch.d.ts.map +1 -0
- package/dist/detectors/net-amount-mismatch.js +70 -0
- package/dist/detectors/net-amount-mismatch.js.map +1 -0
- package/dist/detectors/net-gross-weight.d.ts +3 -0
- package/dist/detectors/net-gross-weight.d.ts.map +1 -0
- package/dist/detectors/net-gross-weight.js +35 -0
- package/dist/detectors/net-gross-weight.js.map +1 -0
- package/dist/detectors/nominal-step.d.ts +3 -0
- package/dist/detectors/nominal-step.d.ts.map +1 -0
- package/dist/detectors/nominal-step.js +28 -0
- package/dist/detectors/nominal-step.js.map +1 -0
- package/dist/detectors/number-style.d.ts +2 -0
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +8 -2
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/order-quantity.d.ts +10 -0
- package/dist/detectors/order-quantity.d.ts.map +1 -0
- package/dist/detectors/order-quantity.js +35 -0
- package/dist/detectors/order-quantity.js.map +1 -0
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +35 -10
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +15 -7
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/period-label-conflict.d.ts +4 -0
- package/dist/detectors/period-label-conflict.d.ts.map +1 -0
- package/dist/detectors/period-label-conflict.js +34 -0
- package/dist/detectors/period-label-conflict.js.map +1 -0
- package/dist/detectors/period-multiple-mismatch.d.ts +3 -0
- package/dist/detectors/period-multiple-mismatch.d.ts.map +1 -0
- package/dist/detectors/period-multiple-mismatch.js +36 -0
- package/dist/detectors/period-multiple-mismatch.js.map +1 -0
- package/dist/detectors/period-part.d.ts +4 -0
- package/dist/detectors/period-part.d.ts.map +1 -0
- package/dist/detectors/period-part.js +58 -0
- package/dist/detectors/period-part.js.map +1 -0
- package/dist/detectors/range-words.d.ts +5 -0
- package/dist/detectors/range-words.d.ts.map +1 -0
- package/dist/detectors/range-words.js +14 -0
- package/dist/detectors/range-words.js.map +1 -0
- package/dist/detectors/ratio-mismatch.d.ts +7 -0
- package/dist/detectors/ratio-mismatch.d.ts.map +1 -0
- package/dist/detectors/ratio-mismatch.js +89 -0
- package/dist/detectors/ratio-mismatch.js.map +1 -0
- package/dist/detectors/readable-dates.d.ts +9 -0
- package/dist/detectors/readable-dates.d.ts.map +1 -0
- package/dist/detectors/readable-dates.js +23 -0
- package/dist/detectors/readable-dates.js.map +1 -0
- package/dist/detectors/reference-flag.d.ts +3 -0
- package/dist/detectors/reference-flag.d.ts.map +1 -0
- package/dist/detectors/reference-flag.js +31 -0
- package/dist/detectors/reference-flag.js.map +1 -0
- package/dist/detectors/reference-number-repeated.d.ts +3 -0
- package/dist/detectors/reference-number-repeated.d.ts.map +1 -0
- package/dist/detectors/reference-number-repeated.js +22 -0
- package/dist/detectors/reference-number-repeated.js.map +1 -0
- package/dist/detectors/reference-number-variant.d.ts +3 -0
- package/dist/detectors/reference-number-variant.d.ts.map +1 -0
- package/dist/detectors/reference-number-variant.js +40 -0
- package/dist/detectors/reference-number-variant.js.map +1 -0
- package/dist/detectors/reference-unit.d.ts +3 -0
- package/dist/detectors/reference-unit.d.ts.map +1 -0
- package/dist/detectors/reference-unit.js +19 -0
- package/dist/detectors/reference-unit.js.map +1 -0
- package/dist/detectors/registry/annual-holidays-mismatch.d.ts +3 -0
- package/dist/detectors/registry/annual-holidays-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/annual-holidays-mismatch.js +3 -0
- package/dist/detectors/registry/annual-holidays-mismatch.js.map +1 -0
- package/dist/detectors/registry/annual-pay-mismatch.d.ts +3 -0
- package/dist/detectors/registry/annual-pay-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/annual-pay-mismatch.js +3 -0
- package/dist/detectors/registry/annual-pay-mismatch.js.map +1 -0
- package/dist/detectors/registry/backorder-mismatch.d.ts +3 -0
- package/dist/detectors/registry/backorder-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/backorder-mismatch.js +3 -0
- package/dist/detectors/registry/backorder-mismatch.js.map +1 -0
- package/dist/detectors/registry/bmi-mismatch.d.ts +3 -0
- package/dist/detectors/registry/bmi-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/bmi-mismatch.js +3 -0
- package/dist/detectors/registry/bmi-mismatch.js.map +1 -0
- package/dist/detectors/registry/closing-balance-mismatch.d.ts +3 -0
- package/dist/detectors/registry/closing-balance-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/closing-balance-mismatch.js +3 -0
- package/dist/detectors/registry/closing-balance-mismatch.js.map +1 -0
- package/dist/detectors/registry/cumulative-below-current.d.ts +3 -0
- package/dist/detectors/registry/cumulative-below-current.d.ts.map +1 -0
- package/dist/detectors/registry/cumulative-below-current.js +3 -0
- package/dist/detectors/registry/cumulative-below-current.js.map +1 -0
- package/dist/detectors/registry/currency-column-mix.d.ts +3 -0
- package/dist/detectors/registry/currency-column-mix.d.ts.map +1 -0
- package/dist/detectors/registry/currency-column-mix.js +3 -0
- package/dist/detectors/registry/currency-column-mix.js.map +1 -0
- package/dist/detectors/registry/deductible-exceeds-limit.d.ts +3 -0
- package/dist/detectors/registry/deductible-exceeds-limit.d.ts.map +1 -0
- package/dist/detectors/registry/deductible-exceeds-limit.js +3 -0
- package/dist/detectors/registry/deductible-exceeds-limit.js.map +1 -0
- package/dist/detectors/registry/delivered-over-ordered.d.ts +3 -0
- package/dist/detectors/registry/delivered-over-ordered.d.ts.map +1 -0
- package/dist/detectors/registry/delivered-over-ordered.js +3 -0
- package/dist/detectors/registry/delivered-over-ordered.js.map +1 -0
- package/dist/detectors/registry/discount-rate.d.ts +3 -0
- package/dist/detectors/registry/discount-rate.d.ts.map +1 -0
- package/dist/detectors/registry/discount-rate.js +3 -0
- package/dist/detectors/registry/discount-rate.js.map +1 -0
- package/dist/detectors/registry/elapsed-years-mismatch.js +1 -1
- package/dist/detectors/registry/elapsed-years-mismatch.js.map +1 -1
- package/dist/detectors/registry/gpa-mismatch.d.ts +3 -0
- package/dist/detectors/registry/gpa-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/gpa-mismatch.js +3 -0
- package/dist/detectors/registry/gpa-mismatch.js.map +1 -0
- package/dist/detectors/registry/installment-total-mismatch.d.ts +3 -0
- package/dist/detectors/registry/installment-total-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/installment-total-mismatch.js +3 -0
- package/dist/detectors/registry/installment-total-mismatch.js.map +1 -0
- package/dist/detectors/registry/interest.d.ts +3 -0
- package/dist/detectors/registry/interest.d.ts.map +1 -0
- package/dist/detectors/registry/interest.js +3 -0
- package/dist/detectors/registry/interest.js.map +1 -0
- package/dist/detectors/registry/meter-usage.d.ts +3 -0
- package/dist/detectors/registry/meter-usage.d.ts.map +1 -0
- package/dist/detectors/registry/meter-usage.js +3 -0
- package/dist/detectors/registry/meter-usage.js.map +1 -0
- package/dist/detectors/registry/net-amount-mismatch.d.ts +3 -0
- package/dist/detectors/registry/net-amount-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/net-amount-mismatch.js +3 -0
- package/dist/detectors/registry/net-amount-mismatch.js.map +1 -0
- package/dist/detectors/registry/net-over-gross.d.ts +3 -0
- package/dist/detectors/registry/net-over-gross.d.ts.map +1 -0
- package/dist/detectors/registry/net-over-gross.js +3 -0
- package/dist/detectors/registry/net-over-gross.js.map +1 -0
- package/dist/detectors/registry/period-label-conflict.d.ts +3 -0
- package/dist/detectors/registry/period-label-conflict.d.ts.map +1 -0
- package/dist/detectors/registry/period-label-conflict.js +3 -0
- package/dist/detectors/registry/period-label-conflict.js.map +1 -0
- package/dist/detectors/registry/period-multiple-mismatch.d.ts +3 -0
- package/dist/detectors/registry/period-multiple-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/period-multiple-mismatch.js +3 -0
- package/dist/detectors/registry/period-multiple-mismatch.js.map +1 -0
- package/dist/detectors/registry/period-part-exceeds-whole.d.ts +3 -0
- package/dist/detectors/registry/period-part-exceeds-whole.d.ts.map +1 -0
- package/dist/detectors/registry/period-part-exceeds-whole.js +3 -0
- package/dist/detectors/registry/period-part-exceeds-whole.js.map +1 -0
- package/dist/detectors/registry/product-exceeds-maximum.d.ts +3 -0
- package/dist/detectors/registry/product-exceeds-maximum.d.ts.map +1 -0
- package/dist/detectors/registry/product-exceeds-maximum.js +3 -0
- package/dist/detectors/registry/product-exceeds-maximum.js.map +1 -0
- package/dist/detectors/registry/ratio-mismatch.d.ts +3 -0
- package/dist/detectors/registry/ratio-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/ratio-mismatch.js +3 -0
- package/dist/detectors/registry/ratio-mismatch.js.map +1 -0
- package/dist/detectors/registry/reference-flag-mismatch.d.ts +3 -0
- package/dist/detectors/registry/reference-flag-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/reference-flag-mismatch.js +3 -0
- package/dist/detectors/registry/reference-flag-mismatch.js.map +1 -0
- package/dist/detectors/registry/reference-number-repeated.d.ts +3 -0
- package/dist/detectors/registry/reference-number-repeated.d.ts.map +1 -0
- package/dist/detectors/registry/reference-number-repeated.js +3 -0
- package/dist/detectors/registry/reference-number-repeated.js.map +1 -0
- package/dist/detectors/registry/reference-number-variant.d.ts +3 -0
- package/dist/detectors/registry/reference-number-variant.d.ts.map +1 -0
- package/dist/detectors/registry/reference-number-variant.js +3 -0
- package/dist/detectors/registry/reference-number-variant.js.map +1 -0
- package/dist/detectors/registry/reference-unit.d.ts +3 -0
- package/dist/detectors/registry/reference-unit.d.ts.map +1 -0
- package/dist/detectors/registry/reference-unit.js +3 -0
- package/dist/detectors/registry/reference-unit.js.map +1 -0
- package/dist/detectors/registry/revision-direction.d.ts +3 -0
- package/dist/detectors/registry/revision-direction.d.ts.map +1 -0
- package/dist/detectors/registry/revision-direction.js +3 -0
- package/dist/detectors/registry/revision-direction.js.map +1 -0
- package/dist/detectors/registry/running-balance.d.ts +3 -0
- package/dist/detectors/registry/running-balance.d.ts.map +1 -0
- package/dist/detectors/registry/running-balance.js +3 -0
- package/dist/detectors/registry/running-balance.js.map +1 -0
- package/dist/detectors/registry/serial-range.d.ts +3 -0
- package/dist/detectors/registry/serial-range.d.ts.map +1 -0
- package/dist/detectors/registry/serial-range.js +3 -0
- package/dist/detectors/registry/serial-range.js.map +1 -0
- package/dist/detectors/registry/share-amount.d.ts +3 -0
- package/dist/detectors/registry/share-amount.d.ts.map +1 -0
- package/dist/detectors/registry/share-amount.js +3 -0
- package/dist/detectors/registry/share-amount.js.map +1 -0
- package/dist/detectors/registry/table-unit-mix.d.ts +3 -0
- package/dist/detectors/registry/table-unit-mix.d.ts.map +1 -0
- package/dist/detectors/registry/table-unit-mix.js +3 -0
- package/dist/detectors/registry/table-unit-mix.js.map +1 -0
- package/dist/detectors/registry/tier-threshold.d.ts +3 -0
- package/dist/detectors/registry/tier-threshold.d.ts.map +1 -0
- package/dist/detectors/registry/tier-threshold.js +3 -0
- package/dist/detectors/registry/tier-threshold.js.map +1 -0
- package/dist/detectors/registry/variance-mismatch.d.ts +3 -0
- package/dist/detectors/registry/variance-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/variance-mismatch.js +3 -0
- package/dist/detectors/registry/variance-mismatch.js.map +1 -0
- package/dist/detectors/relative-dates.d.ts.map +1 -1
- package/dist/detectors/relative-dates.js +2 -1
- package/dist/detectors/relative-dates.js.map +1 -1
- package/dist/detectors/relative-day-words.d.ts.map +1 -1
- package/dist/detectors/relative-day-words.js +2 -1
- package/dist/detectors/relative-day-words.js.map +1 -1
- package/dist/detectors/rent-multiple-mismatch.d.ts.map +1 -1
- package/dist/detectors/rent-multiple-mismatch.js.map +1 -1
- package/dist/detectors/request-owner.d.ts +3 -1
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +5 -2
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/revision-direction.d.ts +3 -0
- package/dist/detectors/revision-direction.d.ts.map +1 -0
- package/dist/detectors/revision-direction.js +32 -0
- package/dist/detectors/revision-direction.js.map +1 -0
- package/dist/detectors/row-sentence-amounts.d.ts +5 -0
- package/dist/detectors/row-sentence-amounts.d.ts.map +1 -0
- package/dist/detectors/row-sentence-amounts.js +71 -0
- package/dist/detectors/row-sentence-amounts.js.map +1 -0
- package/dist/detectors/running-balance.d.ts +3 -0
- package/dist/detectors/running-balance.d.ts.map +1 -0
- package/dist/detectors/running-balance.js +26 -0
- package/dist/detectors/running-balance.js.map +1 -0
- package/dist/detectors/scaled-quantity.js +1 -1
- package/dist/detectors/scaled-quantity.js.map +1 -1
- package/dist/detectors/serial-range.d.ts +3 -0
- package/dist/detectors/serial-range.d.ts.map +1 -0
- package/dist/detectors/serial-range.js +29 -0
- package/dist/detectors/serial-range.js.map +1 -0
- package/dist/detectors/share-amount.d.ts +3 -0
- package/dist/detectors/share-amount.d.ts.map +1 -0
- package/dist/detectors/share-amount.js +45 -0
- package/dist/detectors/share-amount.js.map +1 -0
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +42 -10
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/table-scale.d.ts +3 -0
- package/dist/detectors/table-scale.d.ts.map +1 -0
- package/dist/detectors/table-scale.js +32 -0
- package/dist/detectors/table-scale.js.map +1 -0
- package/dist/detectors/tax-amount.d.ts.map +1 -1
- package/dist/detectors/tax-amount.js +34 -10
- package/dist/detectors/tax-amount.js.map +1 -1
- package/dist/detectors/technical-docs.d.ts +1 -1
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +3 -2
- package/dist/detectors/technical-docs.js.map +1 -1
- package/dist/detectors/tier-threshold.d.ts +3 -0
- package/dist/detectors/tier-threshold.d.ts.map +1 -0
- package/dist/detectors/tier-threshold.js +86 -0
- package/dist/detectors/tier-threshold.js.map +1 -0
- package/dist/detectors/time-order.d.ts +1 -0
- package/dist/detectors/time-order.d.ts.map +1 -1
- package/dist/detectors/time-order.js +43 -13
- package/dist/detectors/time-order.js.map +1 -1
- package/dist/detectors/use-maximum.d.ts +3 -0
- package/dist/detectors/use-maximum.d.ts.map +1 -0
- package/dist/detectors/use-maximum.js +32 -0
- package/dist/detectors/use-maximum.js.map +1 -0
- package/dist/detectors/variance.d.ts +3 -0
- package/dist/detectors/variance.d.ts.map +1 -0
- package/dist/detectors/variance.js +28 -0
- package/dist/detectors/variance.js.map +1 -0
- package/dist/detectors/whole-count-findings.d.ts +4 -0
- package/dist/detectors/whole-count-findings.d.ts.map +1 -0
- package/dist/detectors/whole-count-findings.js +38 -0
- package/dist/detectors/whole-count-findings.js.map +1 -0
- package/dist/detectors/working-hours-findings.d.ts +9 -0
- package/dist/detectors/working-hours-findings.d.ts.map +1 -0
- package/dist/detectors/working-hours-findings.js +79 -0
- package/dist/detectors/working-hours-findings.js.map +1 -0
- package/dist/facts/age-values.d.ts +22 -0
- package/dist/facts/age-values.d.ts.map +1 -0
- package/dist/facts/age-values.js +76 -0
- package/dist/facts/age-values.js.map +1 -0
- package/dist/facts/cell-keys.d.ts +12 -0
- package/dist/facts/cell-keys.d.ts.map +1 -0
- package/dist/facts/cell-keys.js +19 -0
- package/dist/facts/cell-keys.js.map +1 -0
- package/dist/facts/count-labels.d.ts +15 -0
- package/dist/facts/count-labels.d.ts.map +1 -0
- package/dist/facts/count-labels.js +19 -0
- package/dist/facts/count-labels.js.map +1 -0
- package/dist/facts/document-terms.d.ts +43 -0
- package/dist/facts/document-terms.d.ts.map +1 -0
- package/dist/facts/document-terms.js +74 -0
- package/dist/facts/document-terms.js.map +1 -0
- package/dist/facts/duration-scale.d.ts +11 -0
- package/dist/facts/duration-scale.d.ts.map +1 -0
- package/dist/facts/duration-scale.js +14 -0
- package/dist/facts/duration-scale.js.map +1 -0
- package/dist/facts/duration-values.d.ts +15 -0
- package/dist/facts/duration-values.d.ts.map +1 -0
- package/dist/facts/duration-values.js +29 -0
- package/dist/facts/duration-values.js.map +1 -0
- package/dist/facts/fact-values.d.ts +9 -1
- package/dist/facts/fact-values.d.ts.map +1 -1
- package/dist/facts/fact-values.js +19 -6
- package/dist/facts/fact-values.js.map +1 -1
- package/dist/facts/labelled-facts.d.ts +15 -1
- package/dist/facts/labelled-facts.d.ts.map +1 -1
- package/dist/facts/labelled-facts.js +51 -8
- package/dist/facts/labelled-facts.js.map +1 -1
- package/dist/facts/measure-units.d.ts.map +1 -1
- package/dist/facts/measure-units.js +23 -8
- package/dist/facts/measure-units.js.map +1 -1
- package/dist/facts/measures.js +11 -9
- package/dist/facts/measures.js.map +1 -1
- package/dist/facts/qualified-labels.d.ts +28 -0
- package/dist/facts/qualified-labels.d.ts.map +1 -0
- package/dist/facts/qualified-labels.js +96 -0
- package/dist/facts/qualified-labels.js.map +1 -0
- package/dist/facts/rate-values.d.ts +40 -0
- package/dist/facts/rate-values.d.ts.map +1 -0
- package/dist/facts/rate-values.js +68 -0
- package/dist/facts/rate-values.js.map +1 -0
- package/dist/facts/row-sentence-amounts.d.ts +51 -0
- package/dist/facts/row-sentence-amounts.d.ts.map +1 -0
- package/dist/facts/row-sentence-amounts.js +71 -0
- package/dist/facts/row-sentence-amounts.js.map +1 -0
- package/dist/facts/superscript-power.d.ts +3 -0
- package/dist/facts/superscript-power.d.ts.map +1 -0
- package/dist/facts/superscript-power.js +5 -0
- package/dist/facts/superscript-power.js.map +1 -0
- package/dist/facts/table-facts.d.ts +18 -2
- package/dist/facts/table-facts.d.ts.map +1 -1
- package/dist/facts/table-facts.js +16 -6
- package/dist/facts/table-facts.js.map +1 -1
- package/dist/facts/term-values.d.ts +34 -0
- package/dist/facts/term-values.d.ts.map +1 -0
- package/dist/facts/term-values.js +195 -0
- package/dist/facts/term-values.js.map +1 -0
- package/dist/facts/unit-word.d.ts +5 -0
- package/dist/facts/unit-word.d.ts.map +1 -1
- package/dist/facts/unit-word.js +9 -0
- package/dist/facts/unit-word.js.map +1 -1
- package/dist/facts/verb-quantity-facts.d.ts +22 -0
- package/dist/facts/verb-quantity-facts.d.ts.map +1 -0
- package/dist/facts/verb-quantity-facts.js +58 -0
- package/dist/facts/verb-quantity-facts.js.map +1 -0
- package/dist/facts/whole-counts.d.ts +58 -0
- package/dist/facts/whole-counts.d.ts.map +1 -0
- package/dist/facts/whole-counts.js +118 -0
- package/dist/facts/whole-counts.js.map +1 -0
- package/dist/name-char-reading.d.ts +16 -0
- package/dist/name-char-reading.d.ts.map +1 -0
- package/dist/name-char-reading.js +18 -0
- package/dist/name-char-reading.js.map +1 -0
- package/dist/name-line-block.d.ts +6 -0
- package/dist/name-line-block.d.ts.map +1 -0
- package/dist/name-line-block.js +35 -0
- package/dist/name-line-block.js.map +1 -0
- package/dist/name-lookalike-chars.d.ts +16 -0
- package/dist/name-lookalike-chars.d.ts.map +1 -0
- package/dist/name-lookalike-chars.js +41 -0
- package/dist/name-lookalike-chars.js.map +1 -0
- package/dist/name-neighbours.d.ts +7 -0
- package/dist/name-neighbours.d.ts.map +1 -0
- package/dist/name-neighbours.js +55 -0
- package/dist/name-neighbours.js.map +1 -0
- package/dist/name-ordinary-word.d.ts +13 -0
- package/dist/name-ordinary-word.d.ts.map +1 -0
- package/dist/name-ordinary-word.js +54 -0
- package/dist/name-ordinary-word.js.map +1 -0
- package/dist/name-person.d.ts +9 -0
- package/dist/name-person.d.ts.map +1 -0
- package/dist/name-person.js +25 -0
- package/dist/name-person.js.map +1 -0
- package/dist/name-separator.d.ts +14 -0
- package/dist/name-separator.d.ts.map +1 -0
- package/dist/name-separator.js +33 -0
- package/dist/name-separator.js.map +1 -0
- package/dist/name-variants.d.ts +8 -8
- package/dist/name-variants.d.ts.map +1 -1
- package/dist/name-variants.js +28 -81
- package/dist/name-variants.js.map +1 -1
- package/dist/name-weight.d.ts +10 -0
- package/dist/name-weight.d.ts.map +1 -0
- package/dist/name-weight.js +7 -0
- package/dist/name-weight.js.map +1 -0
- package/dist/person-field.d.ts +6 -0
- package/dist/person-field.d.ts.map +1 -0
- package/dist/person-field.js +40 -0
- package/dist/person-field.js.map +1 -0
- package/dist/person-full-name.d.ts +12 -0
- package/dist/person-full-name.d.ts.map +1 -0
- package/dist/person-full-name.js +52 -0
- package/dist/person-full-name.js.map +1 -0
- package/dist/phone-numbers.d.ts +23 -3
- package/dist/phone-numbers.d.ts.map +1 -1
- package/dist/phone-numbers.js +49 -21
- package/dist/phone-numbers.js.map +1 -1
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/product-names.d.ts +33 -0
- package/dist/product-names.d.ts.map +1 -0
- package/dist/product-names.js +74 -0
- package/dist/product-names.js.map +1 -0
- package/dist/reference-numbers.d.ts +26 -0
- package/dist/reference-numbers.d.ts.map +1 -0
- package/dist/reference-numbers.js +43 -0
- package/dist/reference-numbers.js.map +1 -0
- package/dist/spaced-person-name.d.ts +17 -0
- package/dist/spaced-person-name.d.ts.map +1 -0
- package/dist/spaced-person-name.js +82 -0
- package/dist/spaced-person-name.js.map +1 -0
- package/dist/spacing-code.d.ts +1 -0
- package/dist/spacing-code.d.ts.map +1 -1
- package/dist/spacing-code.js +15 -1
- package/dist/spacing-code.js.map +1 -1
- package/dist/structure/annual-holidays.d.ts +56 -0
- package/dist/structure/annual-holidays.d.ts.map +1 -0
- package/dist/structure/annual-holidays.js +159 -0
- package/dist/structure/annual-holidays.js.map +1 -0
- package/dist/structure/annual-pay.d.ts +97 -0
- package/dist/structure/annual-pay.d.ts.map +1 -0
- package/dist/structure/annual-pay.js +236 -0
- package/dist/structure/annual-pay.js.map +1 -0
- package/dist/structure/bmi.d.ts +63 -0
- package/dist/structure/bmi.d.ts.map +1 -0
- package/dist/structure/bmi.js +106 -0
- package/dist/structure/bmi.js.map +1 -0
- package/dist/structure/change-rate-table.d.ts +46 -0
- package/dist/structure/change-rate-table.d.ts.map +1 -0
- package/dist/structure/change-rate-table.js +110 -0
- package/dist/structure/change-rate-table.js.map +1 -0
- package/dist/structure/change-rate.d.ts +13 -1
- package/dist/structure/change-rate.d.ts.map +1 -1
- package/dist/structure/change-rate.js +51 -19
- package/dist/structure/change-rate.js.map +1 -1
- package/dist/structure/closing-balance.d.ts +24 -0
- package/dist/structure/closing-balance.d.ts.map +1 -0
- package/dist/structure/closing-balance.js +79 -0
- package/dist/structure/closing-balance.js.map +1 -0
- package/dist/structure/column-date-order.d.ts +5 -0
- package/dist/structure/column-date-order.d.ts.map +1 -0
- package/dist/structure/column-date-order.js +57 -0
- package/dist/structure/column-date-order.js.map +1 -0
- package/dist/structure/compound-hours.d.ts +5 -0
- package/dist/structure/compound-hours.d.ts.map +1 -0
- package/dist/structure/compound-hours.js +45 -0
- package/dist/structure/compound-hours.js.map +1 -0
- package/dist/structure/cumulative-below-current.d.ts +21 -0
- package/dist/structure/cumulative-below-current.d.ts.map +1 -0
- package/dist/structure/cumulative-below-current.js +48 -0
- package/dist/structure/cumulative-below-current.js.map +1 -0
- package/dist/structure/currency-column.d.ts +21 -0
- package/dist/structure/currency-column.d.ts.map +1 -0
- package/dist/structure/currency-column.js +74 -0
- package/dist/structure/currency-column.js.map +1 -0
- package/dist/structure/date-deadline-mark.d.ts +15 -0
- package/dist/structure/date-deadline-mark.d.ts.map +1 -0
- package/dist/structure/date-deadline-mark.js +22 -0
- package/dist/structure/date-deadline-mark.js.map +1 -0
- package/dist/structure/date-outside-period.d.ts +5 -1
- package/dist/structure/date-outside-period.d.ts.map +1 -1
- package/dist/structure/date-outside-period.js +13 -9
- package/dist/structure/date-outside-period.js.map +1 -1
- package/dist/structure/date-range.d.ts +2 -1
- package/dist/structure/date-range.d.ts.map +1 -1
- package/dist/structure/date-range.js +4 -6
- package/dist/structure/date-range.js.map +1 -1
- package/dist/structure/deadline-after-event.d.ts +35 -2
- package/dist/structure/deadline-after-event.d.ts.map +1 -1
- package/dist/structure/deadline-after-event.js +77 -6
- package/dist/structure/deadline-after-event.js.map +1 -1
- package/dist/structure/deductible-limit.d.ts +69 -0
- package/dist/structure/deductible-limit.d.ts.map +1 -0
- package/dist/structure/deductible-limit.js +191 -0
- package/dist/structure/deductible-limit.js.map +1 -0
- package/dist/structure/discount-rate.d.ts +35 -0
- package/dist/structure/discount-rate.d.ts.map +1 -0
- package/dist/structure/discount-rate.js +172 -0
- package/dist/structure/discount-rate.js.map +1 -0
- package/dist/structure/generic-role.d.ts +2 -0
- package/dist/structure/generic-role.d.ts.map +1 -0
- package/dist/structure/generic-role.js +8 -0
- package/dist/structure/generic-role.js.map +1 -0
- package/dist/structure/gpa.d.ts +74 -0
- package/dist/structure/gpa.d.ts.map +1 -0
- package/dist/structure/gpa.js +170 -0
- package/dist/structure/gpa.js.map +1 -0
- package/dist/structure/installment-total.d.ts +110 -0
- package/dist/structure/installment-total.d.ts.map +1 -0
- package/dist/structure/installment-total.js +224 -0
- package/dist/structure/installment-total.js.map +1 -0
- package/dist/structure/interest.d.ts +22 -0
- package/dist/structure/interest.d.ts.map +1 -0
- package/dist/structure/interest.js +107 -0
- package/dist/structure/interest.js.map +1 -0
- package/dist/structure/key-value-row.d.ts +14 -0
- package/dist/structure/key-value-row.d.ts.map +1 -0
- package/dist/structure/key-value-row.js +38 -0
- package/dist/structure/key-value-row.js.map +1 -0
- package/dist/structure/lab-columns.d.ts +12 -0
- package/dist/structure/lab-columns.d.ts.map +1 -0
- package/dist/structure/lab-columns.js +11 -0
- package/dist/structure/lab-columns.js.map +1 -0
- package/dist/structure/labelled-date-order.d.ts +33 -16
- package/dist/structure/labelled-date-order.d.ts.map +1 -1
- package/dist/structure/labelled-date-order.js +38 -30
- package/dist/structure/labelled-date-order.js.map +1 -1
- package/dist/structure/labelled-order.d.ts +59 -0
- package/dist/structure/labelled-order.d.ts.map +1 -0
- package/dist/structure/labelled-order.js +65 -0
- package/dist/structure/labelled-order.js.map +1 -0
- package/dist/structure/labelled-time-order.d.ts +17 -0
- package/dist/structure/labelled-time-order.d.ts.map +1 -0
- package/dist/structure/labelled-time-order.js +79 -0
- package/dist/structure/labelled-time-order.js.map +1 -0
- package/dist/structure/line-amount-label.d.ts +31 -0
- package/dist/structure/line-amount-label.d.ts.map +1 -0
- package/dist/structure/line-amount-label.js +77 -0
- package/dist/structure/line-amount-label.js.map +1 -0
- package/dist/structure/line-amount-rate.d.ts +47 -0
- package/dist/structure/line-amount-rate.d.ts.map +1 -0
- package/dist/structure/line-amount-rate.js +141 -0
- package/dist/structure/line-amount-rate.js.map +1 -0
- package/dist/structure/line-amount-unit.d.ts +7 -0
- package/dist/structure/line-amount-unit.d.ts.map +1 -1
- package/dist/structure/line-amount-unit.js +11 -0
- package/dist/structure/line-amount-unit.js.map +1 -1
- package/dist/structure/line-amount.d.ts +33 -7
- package/dist/structure/line-amount.d.ts.map +1 -1
- package/dist/structure/line-amount.js +152 -42
- package/dist/structure/line-amount.js.map +1 -1
- package/dist/structure/meter-usage-read.d.ts +21 -0
- package/dist/structure/meter-usage-read.d.ts.map +1 -0
- package/dist/structure/meter-usage-read.js +116 -0
- package/dist/structure/meter-usage-read.js.map +1 -0
- package/dist/structure/meter-usage.d.ts +62 -0
- package/dist/structure/meter-usage.d.ts.map +1 -0
- package/dist/structure/meter-usage.js +157 -0
- package/dist/structure/meter-usage.js.map +1 -0
- package/dist/structure/net-amount.d.ts +81 -0
- package/dist/structure/net-amount.d.ts.map +1 -0
- package/dist/structure/net-amount.js +161 -0
- package/dist/structure/net-amount.js.map +1 -0
- package/dist/structure/net-gross-weight.d.ts +30 -0
- package/dist/structure/net-gross-weight.d.ts.map +1 -0
- package/dist/structure/net-gross-weight.js +79 -0
- package/dist/structure/net-gross-weight.js.map +1 -0
- package/dist/structure/order-quantity.d.ts +38 -0
- package/dist/structure/order-quantity.d.ts.map +1 -0
- package/dist/structure/order-quantity.js +104 -0
- package/dist/structure/order-quantity.js.map +1 -0
- package/dist/structure/party-role.d.ts.map +1 -1
- package/dist/structure/party-role.js +4 -1
- package/dist/structure/party-role.js.map +1 -1
- package/dist/structure/percent-sum.d.ts +2 -0
- package/dist/structure/percent-sum.d.ts.map +1 -1
- package/dist/structure/percent-sum.js +2 -0
- package/dist/structure/percent-sum.js.map +1 -1
- package/dist/structure/period-label-conflict.d.ts +52 -0
- package/dist/structure/period-label-conflict.d.ts.map +1 -0
- package/dist/structure/period-label-conflict.js +105 -0
- package/dist/structure/period-label-conflict.js.map +1 -0
- package/dist/structure/period-labels.d.ts +36 -0
- package/dist/structure/period-labels.d.ts.map +1 -0
- package/dist/structure/period-labels.js +86 -0
- package/dist/structure/period-labels.js.map +1 -0
- package/dist/structure/period-multiple.d.ts +46 -0
- package/dist/structure/period-multiple.d.ts.map +1 -0
- package/dist/structure/period-multiple.js +123 -0
- package/dist/structure/period-multiple.js.map +1 -0
- package/dist/structure/quantity-range.d.ts.map +1 -1
- package/dist/structure/quantity-range.js +1 -5
- package/dist/structure/quantity-range.js.map +1 -1
- package/dist/structure/range-bands.d.ts +2 -0
- package/dist/structure/range-bands.d.ts.map +1 -1
- package/dist/structure/range-bands.js +1 -1
- package/dist/structure/range-bands.js.map +1 -1
- package/dist/structure/range-years.d.ts +18 -0
- package/dist/structure/range-years.d.ts.map +1 -0
- package/dist/structure/range-years.js +60 -0
- package/dist/structure/range-years.js.map +1 -0
- package/dist/structure/ratio.d.ts +136 -0
- package/dist/structure/ratio.d.ts.map +1 -0
- package/dist/structure/ratio.js +214 -0
- package/dist/structure/ratio.js.map +1 -0
- package/dist/structure/reference-flags.d.ts +55 -0
- package/dist/structure/reference-flags.d.ts.map +1 -0
- package/dist/structure/reference-flags.js +116 -0
- package/dist/structure/reference-flags.js.map +1 -0
- package/dist/structure/reference-number-repeated.d.ts +12 -0
- package/dist/structure/reference-number-repeated.d.ts.map +1 -0
- package/dist/structure/reference-number-repeated.js +43 -0
- package/dist/structure/reference-number-repeated.js.map +1 -0
- package/dist/structure/reference-unit.d.ts +24 -0
- package/dist/structure/reference-unit.d.ts.map +1 -0
- package/dist/structure/reference-unit.js +80 -0
- package/dist/structure/reference-unit.js.map +1 -0
- package/dist/structure/rent-multiple.d.ts +2 -22
- package/dist/structure/rent-multiple.d.ts.map +1 -1
- package/dist/structure/rent-multiple.js +2 -49
- package/dist/structure/rent-multiple.js.map +1 -1
- package/dist/structure/revision-direction.d.ts +51 -0
- package/dist/structure/revision-direction.d.ts.map +1 -0
- package/dist/structure/revision-direction.js +163 -0
- package/dist/structure/revision-direction.js.map +1 -0
- package/dist/structure/running-balance.d.ts +36 -0
- package/dist/structure/running-balance.d.ts.map +1 -0
- package/dist/structure/running-balance.js +126 -0
- package/dist/structure/running-balance.js.map +1 -0
- package/dist/structure/scaled-quantities.d.ts +1 -1
- package/dist/structure/scaled-quantities.d.ts.map +1 -1
- package/dist/structure/scaled-quantities.js +23 -6
- package/dist/structure/scaled-quantities.js.map +1 -1
- package/dist/structure/serial-range.d.ts +9 -0
- package/dist/structure/serial-range.d.ts.map +1 -0
- package/dist/structure/serial-range.js +41 -0
- package/dist/structure/serial-range.js.map +1 -0
- package/dist/structure/share-amount.d.ts +55 -0
- package/dist/structure/share-amount.d.ts.map +1 -0
- package/dist/structure/share-amount.js +162 -0
- package/dist/structure/share-amount.js.map +1 -0
- package/dist/structure/shift-times.d.ts +32 -0
- package/dist/structure/shift-times.d.ts.map +1 -0
- package/dist/structure/shift-times.js +112 -0
- package/dist/structure/shift-times.js.map +1 -0
- package/dist/structure/span-label.d.ts +3 -0
- package/dist/structure/span-label.d.ts.map +1 -0
- package/dist/structure/span-label.js +27 -0
- package/dist/structure/span-label.js.map +1 -0
- package/dist/structure/stated-multiple.d.ts +39 -0
- package/dist/structure/stated-multiple.d.ts.map +1 -0
- package/dist/structure/stated-multiple.js +49 -0
- package/dist/structure/stated-multiple.js.map +1 -0
- package/dist/structure/stated-period.d.ts +3 -2
- package/dist/structure/stated-period.d.ts.map +1 -1
- package/dist/structure/stated-period.js +17 -11
- package/dist/structure/stated-period.js.map +1 -1
- package/dist/structure/table-scale.d.ts +45 -0
- package/dist/structure/table-scale.d.ts.map +1 -0
- package/dist/structure/table-scale.js +188 -0
- package/dist/structure/table-scale.js.map +1 -0
- package/dist/structure/tax-price.d.ts +29 -0
- package/dist/structure/tax-price.d.ts.map +1 -0
- package/dist/structure/tax-price.js +112 -0
- package/dist/structure/tax-price.js.map +1 -0
- package/dist/structure/tax.d.ts +2 -0
- package/dist/structure/tax.d.ts.map +1 -1
- package/dist/structure/tax.js +46 -23
- package/dist/structure/tax.js.map +1 -1
- package/dist/structure/tier-threshold.d.ts +65 -0
- package/dist/structure/tier-threshold.d.ts.map +1 -0
- package/dist/structure/tier-threshold.js +170 -0
- package/dist/structure/tier-threshold.js.map +1 -0
- package/dist/structure/time-range.d.ts +2 -0
- package/dist/structure/time-range.d.ts.map +1 -1
- package/dist/structure/time-range.js +7 -2
- package/dist/structure/time-range.js.map +1 -1
- package/dist/structure/total-line.d.ts +34 -2
- package/dist/structure/total-line.d.ts.map +1 -1
- package/dist/structure/total-line.js +124 -3
- package/dist/structure/total-line.js.map +1 -1
- package/dist/structure/total-row-blank.d.ts +10 -0
- package/dist/structure/total-row-blank.d.ts.map +1 -0
- package/dist/structure/total-row-blank.js +15 -0
- package/dist/structure/total-row-blank.js.map +1 -0
- package/dist/structure/total.d.ts +13 -3
- package/dist/structure/total.d.ts.map +1 -1
- package/dist/structure/total.js +80 -7
- package/dist/structure/total.js.map +1 -1
- package/dist/structure/variance-table.d.ts +34 -0
- package/dist/structure/variance-table.d.ts.map +1 -0
- package/dist/structure/variance-table.js +130 -0
- package/dist/structure/variance-table.js.map +1 -0
- package/dist/table-names.d.ts +4 -3
- package/dist/table-names.d.ts.map +1 -1
- package/dist/table-names.js +6 -6
- package/dist/table-names.js.map +1 -1
- package/dist/unlabelled-references.d.ts +16 -0
- package/dist/unlabelled-references.d.ts.map +1 -0
- package/dist/unlabelled-references.js +73 -0
- package/dist/unlabelled-references.js.map +1 -0
- package/dist/vehicle-plates.d.ts +28 -0
- package/dist/vehicle-plates.d.ts.map +1 -0
- package/dist/vehicle-plates.js +116 -0
- package/dist/vehicle-plates.js.map +1 -0
- package/dist/whole-word-runs.d.ts +24 -0
- package/dist/whole-word-runs.d.ts.map +1 -0
- package/dist/whole-word-runs.js +26 -0
- package/dist/whole-word-runs.js.map +1 -0
- package/package.json +4 -3
- package/rules/absolute-exception.yaml +1 -1
- package/rules/ai-generated-composite.yaml +1 -1
- package/rules/ai-tell.yaml +1 -1
- package/rules/amount-range-reversed.yaml +1 -1
- package/rules/amount-scale-consistency.yaml +1 -1
- package/rules/announcing-opener.yaml +1 -1
- package/rules/annual-holidays-mismatch.yaml +65 -0
- package/rules/annual-pay-mismatch.yaml +64 -0
- package/rules/article-sound.yaml +1 -1
- package/rules/assistant-residue.yaml +1 -1
- package/rules/attachment-not-attached.yaml +1 -1
- package/rules/backorder-mismatch.yaml +57 -0
- package/rules/bmi-mismatch.yaml +63 -0
- package/rules/bold-label-list.yaml +1 -1
- package/rules/broken-link.yaml +1 -1
- package/rules/capacity-runtime-mismatch.yaml +1 -1
- package/rules/change-rate-mismatch.yaml +6 -6
- package/rules/chat-citation-residue.yaml +2 -2
- package/rules/cliche.yaml +2 -2
- package/rules/closing-balance-mismatch.yaml +63 -0
- package/rules/colon-lead-in.yaml +1 -1
- package/rules/comparative-without-baseline.yaml +1 -1
- package/rules/concrete-evidence-density.yaml +1 -1
- package/rules/connection-time-short.yaml +1 -1
- package/rules/contact-variant.yaml +4 -4
- package/rules/contrast-framing.yaml +2 -2
- package/rules/cross-doc-broken-link.yaml +1 -1
- package/rules/cross-doc-fact-conflict.yaml +1 -1
- package/rules/cross-doc-term-variant.yaml +1 -1
- package/rules/cumulative-below-current.yaml +59 -0
- package/rules/currency-column-mix.yaml +70 -0
- package/rules/currency-notation-consistency.yaml +2 -2
- package/rules/cushion-phrase-density.yaml +1 -1
- package/rules/dangling-participle.yaml +2 -2
- package/rules/dangling-reference.yaml +1 -1
- package/rules/date-format-consistency.yaml +1 -1
- package/rules/date-outside-period.yaml +5 -5
- package/rules/date-range-reversed.yaml +2 -2
- package/rules/date-stamp-order.yaml +2 -2
- package/rules/date-without-year.yaml +12 -12
- package/rules/deadline-after-event.yaml +11 -6
- package/rules/deductible-exceeds-limit.yaml +54 -0
- package/rules/defined-name-repeated.yaml +3 -3
- package/rules/defined-term-form.yaml +2 -2
- package/rules/delivered-over-ordered.yaml +57 -0
- package/rules/demonstrative-opener-run.yaml +1 -1
- package/rules/discount-rate-mismatch.yaml +66 -0
- package/rules/due-before-issue.yaml +33 -12
- package/rules/duration-mismatch.yaml +16 -7
- package/rules/duration-product-mismatch.yaml +11 -3
- package/rules/elapsed-years-mismatch.yaml +11 -6
- package/rules/email-greeting-closing.yaml +2 -2
- package/rules/empty-conclusion.yaml +1 -1
- package/rules/empty-intensifier.yaml +1 -1
- package/rules/empty-list-item.yaml +1 -1
- package/rules/empty-section.yaml +1 -1
- package/rules/empty-table-cell.yaml +2 -2
- package/rules/expletive-construction.yaml +1 -1
- package/rules/fact-conflict.yaml +16 -4
- package/rules/figurative-density.yaml +1 -1
- package/rules/figure-reference-order.yaml +1 -1
- package/rules/footnote-mismatch.yaml +1 -1
- package/rules/fullwidth-alnum-consistency.yaml +1 -1
- package/rules/gpa-mismatch.yaml +80 -0
- package/rules/heading-end-punctuation-mix.yaml +1 -1
- package/rules/heading-level-skip.yaml +1 -1
- package/rules/heading-numbering-mix.yaml +3 -3
- package/rules/homophone-slip.yaml +1 -1
- package/rules/humble-for-others.yaml +1 -1
- package/rules/idiom-misuse.yaml +1 -1
- package/rules/ime-residue.yaml +1 -1
- package/rules/impossible-date.yaml +10 -6
- package/rules/installment-total-mismatch.yaml +58 -0
- package/rules/interest-mismatch.yaml +50 -0
- package/rules/interval-count-mismatch.yaml +1 -1
- package/rules/invisible-character.yaml +1 -1
- package/rules/kana-function-word.yaml +2 -2
- package/rules/katakana-density.yaml +1 -1
- package/rules/katakana-long-vowel.yaml +2 -2
- package/rules/kutoten-consistency.yaml +1 -1
- package/rules/latin-spacing.yaml +20 -6
- package/rules/layout-code-mismatch.yaml +1 -1
- package/rules/less-for-fewer.yaml +1 -1
- package/rules/line-amount-mismatch.yaml +8 -7
- package/rules/link-text-url-mismatch.yaml +1 -1
- package/rules/list-item-form-mix.yaml +1 -1
- package/rules/lookalike-character.yaml +1 -1
- package/rules/max-kanji-continuous.yaml +1 -1
- package/rules/meter-usage-mismatch.yaml +64 -0
- package/rules/misconversion.yaml +1 -1
- package/rules/modal-conflict.yaml +1 -1
- package/rules/name-variant.yaml +12 -3
- package/rules/net-amount-mismatch.yaml +57 -0
- package/rules/net-over-gross.yaml +57 -0
- package/rules/no-doubled-joshi.yaml +1 -1
- package/rules/no-mixed-desumasu.yaml +1 -1
- package/rules/no-nakaguro-parallel.yaml +1 -1
- package/rules/nominalization.yaml +1 -1
- package/rules/nonstandard-word.yaml +1 -1
- package/rules/number-style-consistency.yaml +3 -3
- package/rules/number-without-unit.yaml +1 -1
- package/rules/number-word-figure-mismatch.yaml +1 -1
- package/rules/numbering-gap.yaml +1 -1
- package/rules/obligation-without-deadline.yaml +1 -1
- package/rules/ordinal-suffix-mismatch.yaml +1 -1
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/outside-announced-list.yaml +1 -1
- package/rules/padded-intro.yaml +1 -1
- package/rules/paragraph-restatement.yaml +1 -1
- package/rules/party-role-name.yaml +3 -3
- package/rules/percent-sum-mismatch.yaml +2 -2
- package/rules/period-label-conflict.yaml +68 -0
- package/rules/period-multiple-mismatch.yaml +61 -0
- package/rules/period-part-exceeds-whole.yaml +62 -0
- package/rules/person-consistency.yaml +1 -1
- package/rules/phone-number-variant.yaml +3 -3
- package/rules/preferred-term.yaml +2 -2
- package/rules/prerequisite-after-step.yaml +1 -1
- package/rules/product-exceeds-maximum.yaml +49 -0
- package/rules/proper-noun-density.yaml +1 -1
- package/rules/quantity-range-reversed.yaml +2 -2
- package/rules/range-band-mismatch.yaml +1 -1
- package/rules/ratio-mismatch.yaml +64 -0
- package/rules/reference-flag-mismatch.yaml +74 -0
- package/rules/reference-number-repeated.yaml +63 -0
- package/rules/reference-number-variant.yaml +81 -0
- package/rules/reference-title-mismatch.yaml +1 -1
- package/rules/reference-topic-missing.yaml +1 -1
- package/rules/reference-unit-mismatch.yaml +62 -0
- package/rules/relative-date-mismatch.yaml +1 -1
- package/rules/request-without-deadline.yaml +3 -3
- package/rules/required-listed-as-preferred.yaml +1 -1
- package/rules/required-sections.yaml +2 -2
- package/rules/requirement-modal.yaml +2 -2
- package/rules/requirement-smell.yaml +1 -1
- package/rules/revision-direction-mismatch.yaml +66 -0
- package/rules/risk-disclosure.yaml +1 -1
- package/rules/running-balance-mismatch.yaml +59 -0
- package/rules/scaled-quantity-mismatch.yaml +1 -1
- package/rules/serial-range-reversed.yaml +52 -0
- package/rules/share-amount-mismatch.yaml +58 -0
- package/rules/share-over-hundred.yaml +1 -1
- package/rules/shell-prompt-mix.yaml +1 -1
- package/rules/space-before-punctuation.yaml +1 -1
- package/rules/spelling-consistency.yaml +1 -1
- package/rules/step-statement-mix.yaml +3 -3
- package/rules/stock-transition.yaml +1 -1
- package/rules/summary-fact-mismatch.yaml +1 -1
- package/rules/table-header-variant.yaml +1 -1
- package/rules/table-unit-mix.yaml +82 -0
- package/rules/taigen-dome-in-prose.yaml +1 -1
- package/rules/tax-mismatch.yaml +13 -7
- package/rules/tier-threshold-mismatch.yaml +73 -0
- package/rules/time-order.yaml +7 -4
- package/rules/time-range-reversed.yaml +9 -4
- package/rules/toc-heading-mismatch.yaml +1 -1
- package/rules/topic-predicate-distance.yaml +1 -1
- package/rules/total-mismatch.yaml +5 -5
- package/rules/ui-label-variant.yaml +1 -1
- package/rules/unclosed-code-fence.yaml +1 -1
- package/rules/uncomparable-graded.yaml +2 -2
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +2 -2
- package/rules/unit-mismatch.yaml +1 -1
- package/rules/unit-spacing-consistency.yaml +1 -1
- package/rules/unknown-word.yaml +1 -1
- package/rules/url-run-on.yaml +1 -1
- package/rules/vague-deadline.yaml +1 -1
- package/rules/vague-figure-reference.yaml +1 -1
- package/rules/vague-word-density.yaml +2 -2
- package/rules/variance-mismatch.yaml +67 -0
- package/rules/very-adjective.yaml +1 -1
- package/rules/walk-time-distance-mismatch.yaml +1 -1
- package/rules/warning-without-action.yaml +1 -1
- package/rules/weasel-word.yaml +2 -2
- package/rules/wordy-phrase.yaml +2 -2
- package/rules/yori-as-from.yaml +1 -1
- package/skills/chaff/SKILL.md +59 -9
- package/src/company-kana-spelling.ts +105 -0
- package/src/company-names.ts +159 -26
- package/src/contacts/table-rows.ts +51 -0
- package/src/derived/age-on-date.ts +161 -0
- package/src/derived/durations.ts +83 -12
- package/src/derived/hours-and-minutes.ts +41 -0
- package/src/derived/hyphenated-counts.ts +38 -0
- package/src/derived/marked-dates.ts +61 -0
- package/src/derived/money-span.ts +10 -0
- package/src/derived/period-parts.ts +360 -0
- package/src/derived/readable-date.ts +63 -0
- package/src/derived/stays.ts +7 -2
- package/src/derived/timesheet-hours.ts +112 -0
- package/src/derived/use-maximum.ts +158 -0
- package/src/derived/working-hours.ts +2 -2
- package/src/detectors/annual-holidays-mismatch.ts +41 -0
- package/src/detectors/annual-pay-mismatch.ts +71 -0
- package/src/detectors/blank-structure.ts +54 -14
- package/src/detectors/bmi-mismatch.ts +82 -0
- package/src/detectors/change-rate.ts +27 -4
- package/src/detectors/closing-balance-mismatch.ts +52 -0
- package/src/detectors/contact-variant.ts +8 -2
- package/src/detectors/cumulative-below-current.ts +30 -0
- package/src/detectors/currency-column.ts +37 -0
- package/src/detectors/date-any-year.ts +130 -0
- package/src/detectors/date-outside-period.ts +4 -10
- package/src/detectors/date-stamp-order.ts +2 -1
- package/src/detectors/date-year.ts +55 -13
- package/src/detectors/deductible-exceeds-limit.ts +55 -0
- package/src/detectors/defined-term-form.ts +6 -23
- package/src/detectors/derived-numbers.ts +50 -89
- package/src/detectors/discount-rate.ts +41 -0
- package/src/detectors/due-date.ts +21 -7
- package/src/detectors/email-letter.ts +45 -15
- package/src/detectors/event-deadline.ts +13 -3
- package/src/detectors/fact-consistency.ts +145 -7
- package/src/detectors/gloss-year.ts +21 -0
- package/src/detectors/gpa-mismatch.ts +43 -0
- package/src/detectors/impossible-date.ts +25 -3
- package/src/detectors/installment-total-mismatch.ts +68 -0
- package/src/detectors/interest.ts +43 -0
- package/src/detectors/lab-columns.ts +9 -0
- package/src/detectors/labelled-age.ts +154 -0
- package/src/detectors/line-amount.ts +58 -3
- package/src/detectors/measured-facts.ts +1 -1
- package/src/detectors/meter-usage.ts +49 -0
- package/src/detectors/name-field.ts +43 -0
- package/src/detectors/name-variant.ts +160 -16
- package/src/detectors/net-amount-mismatch.ts +86 -0
- package/src/detectors/net-gross-weight.ts +39 -0
- package/src/detectors/nominal-step.ts +35 -0
- package/src/detectors/number-style.ts +11 -2
- package/src/detectors/order-quantity.ts +46 -0
- package/src/detectors/orthographic-variant.ts +40 -10
- package/src/detectors/orthography.ts +27 -11
- package/src/detectors/period-label-conflict.ts +43 -0
- package/src/detectors/period-multiple-mismatch.ts +54 -0
- package/src/detectors/period-part.ts +71 -0
- package/src/detectors/range-words.ts +17 -0
- package/src/detectors/ratio-mismatch.ts +116 -0
- package/src/detectors/readable-dates.ts +36 -0
- package/src/detectors/reference-flag.ts +36 -0
- package/src/detectors/reference-number-repeated.ts +25 -0
- package/src/detectors/reference-number-variant.ts +44 -0
- package/src/detectors/reference-unit.ts +24 -0
- package/src/detectors/registry/annual-holidays-mismatch.ts +4 -0
- package/src/detectors/registry/annual-pay-mismatch.ts +4 -0
- package/src/detectors/registry/backorder-mismatch.ts +4 -0
- package/src/detectors/registry/bmi-mismatch.ts +4 -0
- package/src/detectors/registry/closing-balance-mismatch.ts +4 -0
- package/src/detectors/registry/cumulative-below-current.ts +4 -0
- package/src/detectors/registry/currency-column-mix.ts +4 -0
- package/src/detectors/registry/deductible-exceeds-limit.ts +4 -0
- package/src/detectors/registry/delivered-over-ordered.ts +4 -0
- package/src/detectors/registry/discount-rate.ts +4 -0
- package/src/detectors/registry/elapsed-years-mismatch.ts +1 -1
- package/src/detectors/registry/gpa-mismatch.ts +4 -0
- package/src/detectors/registry/installment-total-mismatch.ts +4 -0
- package/src/detectors/registry/interest.ts +4 -0
- package/src/detectors/registry/meter-usage.ts +4 -0
- package/src/detectors/registry/net-amount-mismatch.ts +4 -0
- package/src/detectors/registry/net-over-gross.ts +4 -0
- package/src/detectors/registry/period-label-conflict.ts +4 -0
- package/src/detectors/registry/period-multiple-mismatch.ts +4 -0
- package/src/detectors/registry/period-part-exceeds-whole.ts +4 -0
- package/src/detectors/registry/product-exceeds-maximum.ts +4 -0
- package/src/detectors/registry/ratio-mismatch.ts +4 -0
- package/src/detectors/registry/reference-flag-mismatch.ts +4 -0
- package/src/detectors/registry/reference-number-repeated.ts +4 -0
- package/src/detectors/registry/reference-number-variant.ts +4 -0
- package/src/detectors/registry/reference-unit.ts +4 -0
- package/src/detectors/registry/revision-direction.ts +4 -0
- package/src/detectors/registry/running-balance.ts +4 -0
- package/src/detectors/registry/serial-range.ts +4 -0
- package/src/detectors/registry/share-amount.ts +4 -0
- package/src/detectors/registry/table-unit-mix.ts +4 -0
- package/src/detectors/registry/tier-threshold.ts +4 -0
- package/src/detectors/registry/variance-mismatch.ts +4 -0
- package/src/detectors/relative-dates.ts +2 -1
- package/src/detectors/relative-day-words.ts +2 -1
- package/src/detectors/rent-multiple-mismatch.ts +3 -2
- package/src/detectors/request-owner.ts +5 -2
- package/src/detectors/revision-direction.ts +44 -0
- package/src/detectors/row-sentence-amounts.ts +96 -0
- package/src/detectors/running-balance.ts +31 -0
- package/src/detectors/scaled-quantity.ts +1 -1
- package/src/detectors/serial-range.ts +37 -0
- package/src/detectors/share-amount.ts +51 -0
- package/src/detectors/structure-tree.ts +58 -10
- package/src/detectors/table-scale.ts +37 -0
- package/src/detectors/tax-amount.ts +45 -13
- package/src/detectors/technical-docs.ts +4 -2
- package/src/detectors/tier-threshold.ts +108 -0
- package/src/detectors/time-order.ts +52 -18
- package/src/detectors/use-maximum.ts +38 -0
- package/src/detectors/variance.ts +33 -0
- package/src/detectors/whole-count-findings.ts +48 -0
- package/src/detectors/working-hours-findings.ts +100 -0
- package/src/facts/age-values.ts +124 -0
- package/src/facts/cell-keys.ts +21 -0
- package/src/facts/count-labels.ts +28 -0
- package/src/facts/document-terms.ts +107 -0
- package/src/facts/duration-scale.ts +22 -0
- package/src/facts/duration-values.ts +44 -0
- package/src/facts/fact-values.ts +36 -7
- package/src/facts/labelled-facts.ts +66 -9
- package/src/facts/measure-units.ts +28 -10
- package/src/facts/measures.ts +11 -11
- package/src/facts/qualified-labels.ts +126 -0
- package/src/facts/rate-values.ts +117 -0
- package/src/facts/row-sentence-amounts.ts +113 -0
- package/src/facts/superscript-power.ts +5 -0
- package/src/facts/table-facts.ts +35 -7
- package/src/facts/term-values.ts +236 -0
- package/src/facts/unit-word.ts +13 -0
- package/src/facts/verb-quantity-facts.ts +84 -0
- package/src/facts/whole-counts.ts +183 -0
- package/src/name-char-reading.ts +24 -0
- package/src/name-line-block.ts +40 -0
- package/src/name-lookalike-chars.ts +53 -0
- package/src/name-neighbours.ts +58 -0
- package/src/name-ordinary-word.ts +68 -0
- package/src/name-person.ts +31 -0
- package/src/name-separator.ts +48 -0
- package/src/name-variants.ts +42 -86
- package/src/name-weight.ts +12 -0
- package/src/person-field.ts +43 -0
- package/src/person-full-name.ts +70 -0
- package/src/phone-numbers.ts +54 -18
- package/src/plugin.ts +2 -0
- package/src/product-names.ts +98 -0
- package/src/reference-numbers.ts +55 -0
- package/src/spaced-person-name.ts +97 -0
- package/src/spacing-code.ts +22 -1
- package/src/structure/annual-holidays.ts +222 -0
- package/src/structure/annual-pay.ts +339 -0
- package/src/structure/bmi.ts +133 -0
- package/src/structure/change-rate-table.ts +135 -0
- package/src/structure/change-rate.ts +54 -17
- package/src/structure/closing-balance.ts +104 -0
- package/src/structure/column-date-order.ts +73 -0
- package/src/structure/compound-hours.ts +49 -0
- package/src/structure/cumulative-below-current.ts +66 -0
- package/src/structure/currency-column.ts +97 -0
- package/src/structure/date-deadline-mark.ts +30 -0
- package/src/structure/date-outside-period.ts +17 -9
- package/src/structure/date-range.ts +6 -9
- package/src/structure/deadline-after-event.ts +125 -8
- package/src/structure/deductible-limit.ts +255 -0
- package/src/structure/discount-rate.ts +209 -0
- package/src/structure/generic-role.ts +8 -0
- package/src/structure/gpa.ts +218 -0
- package/src/structure/installment-total.ts +343 -0
- package/src/structure/interest.ts +133 -0
- package/src/structure/key-value-row.ts +45 -0
- package/src/structure/lab-columns.ts +21 -0
- package/src/structure/labelled-date-order.ts +68 -52
- package/src/structure/labelled-order.ts +122 -0
- package/src/structure/labelled-time-order.ts +100 -0
- package/src/structure/line-amount-label.ts +100 -0
- package/src/structure/line-amount-rate.ts +178 -0
- package/src/structure/line-amount-unit.ts +16 -0
- package/src/structure/line-amount.ts +200 -48
- package/src/structure/meter-usage-read.ts +139 -0
- package/src/structure/meter-usage.ts +224 -0
- package/src/structure/net-amount.ts +243 -0
- package/src/structure/net-gross-weight.ts +97 -0
- package/src/structure/order-quantity.ts +125 -0
- package/src/structure/party-role.ts +4 -1
- package/src/structure/percent-sum.ts +3 -0
- package/src/structure/period-label-conflict.ts +174 -0
- package/src/structure/period-labels.ts +147 -0
- package/src/structure/period-multiple.ts +186 -0
- package/src/structure/quantity-range.ts +1 -8
- package/src/structure/range-bands.ts +1 -1
- package/src/structure/range-years.ts +75 -0
- package/src/structure/ratio.ts +296 -0
- package/src/structure/reference-flags.ts +156 -0
- package/src/structure/reference-number-repeated.ts +57 -0
- package/src/structure/reference-unit.ts +105 -0
- package/src/structure/rent-multiple.ts +12 -82
- package/src/structure/revision-direction.ts +214 -0
- package/src/structure/running-balance.ts +157 -0
- package/src/structure/scaled-quantities.ts +20 -6
- package/src/structure/serial-range.ts +52 -0
- package/src/structure/share-amount.ts +206 -0
- package/src/structure/shift-times.ts +136 -0
- package/src/structure/span-label.ts +26 -0
- package/src/structure/stated-multiple.ts +82 -0
- package/src/structure/stated-period.ts +23 -11
- package/src/structure/table-scale.ts +239 -0
- package/src/structure/tax-price.ts +136 -0
- package/src/structure/tax.ts +55 -20
- package/src/structure/tier-threshold.ts +218 -0
- package/src/structure/time-range.ts +9 -3
- package/src/structure/total-line.ts +174 -5
- package/src/structure/total-row-blank.ts +23 -0
- package/src/structure/total.ts +122 -13
- package/src/structure/variance-table.ts +167 -0
- package/src/table-names.ts +6 -6
- package/src/unlabelled-references.ts +83 -0
- package/src/vehicle-plates.ts +142 -0
- package/src/whole-word-runs.ts +38 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
import { linesOf } from "../structure/lines.ts";
|
|
3
|
+
import { cellsOf, tablesOf, type Cell } from "../facts/table-facts.ts";
|
|
4
|
+
import { columnOf, hasHeadingNote, onlyTime } from "../structure/shift-times.ts";
|
|
5
|
+
import { rangeReading } from "../structure/time-range.ts";
|
|
6
|
+
import type { Mark, TimeSpan } from "../structure/time-marks.ts";
|
|
7
|
+
import type { ClockRange } from "./working-hours.ts";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 勤務表の行の実働(始業 | 終業 | 休憩 | 実働、Start | End | Break | Hours)を、終わりから始まりと休憩を引いた長さと比べる。
|
|
11
|
+
* 列は見出しの名前で読む(語彙表 shift-column)。始まりと終わりの列が無ければ、一つの升に書いた範囲(9:30〜18:30)を読む。
|
|
12
|
+
* 休憩の列と実働の列が両方ある表だけを読み、どれかの升が読めない行は言わない(休憩が勤務より長い行は実働を読まずに言う)。休憩の升の単位の無い数(30)は分か時間か
|
|
13
|
+
* 分からないので読まない。片方にだけ午前・午後を書いた行も読まない。終わりが始まりより前の行は、文書に夜をまたぐ勤務の印が
|
|
14
|
+
* あるときだけ日をまたいで読み、無ければ言わない(time-range-reversed が見る)。Pure.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const SECONDS_PER_MINUTE = 60;
|
|
18
|
+
const MINUTES_PER_DAY = 24 * 60;
|
|
19
|
+
/** 実働を小数の時間で書いたときの丸め(8.33 は 499.8 分)。 */
|
|
20
|
+
const ROUNDING_MINUTES = 3;
|
|
21
|
+
|
|
22
|
+
export type TimesheetInputs = {
|
|
23
|
+
readonly text: string;
|
|
24
|
+
readonly times: readonly TimeSpan[];
|
|
25
|
+
/** 一つの升に書いた時刻の範囲(9:30〜18:30)。 */
|
|
26
|
+
readonly ranges: readonly ClockRange[];
|
|
27
|
+
readonly columns: readonly Mark[];
|
|
28
|
+
readonly overnight: boolean;
|
|
29
|
+
/** 升に書いた長さを分で。bareHours なら単位の無い数(8.00)も時間と読む。 */
|
|
30
|
+
readonly lengthOf: (text: string, bareHours: boolean) => number | undefined;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type TimesheetMismatch = {
|
|
34
|
+
readonly start: Span;
|
|
35
|
+
readonly end: Span;
|
|
36
|
+
readonly break: Span;
|
|
37
|
+
/** 休憩が勤務より長い行では読まない。 */
|
|
38
|
+
readonly total?: Span & { readonly minutes: number };
|
|
39
|
+
/** 終わりから始まりと休憩を引いた分。負なら休憩が勤務より長い。 */
|
|
40
|
+
readonly expected: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type Columns = { readonly start: number; readonly end: number; readonly hours: number; readonly break: number; readonly bareHours: boolean };
|
|
44
|
+
|
|
45
|
+
const trimmed = (cell: Cell): Span & { readonly text: string } => {
|
|
46
|
+
const text = cell.text.trim();
|
|
47
|
+
const start = cell.start + cell.text.indexOf(text);
|
|
48
|
+
return { start, end: start + text.length, text };
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** 始まりと終わりの列の時刻。十二時間制の片方にだけ午前・午後を書いた組は読まない。 */
|
|
52
|
+
const columnTimes = (cells: readonly Cell[], columns: Columns, inputs: TimesheetInputs) => {
|
|
53
|
+
const [from, to] = [onlyTime(cells[columns.start], inputs.times, inputs.text), onlyTime(cells[columns.end], inputs.times, inputs.text)];
|
|
54
|
+
if (from === undefined || to === undefined) return undefined;
|
|
55
|
+
const reading = rangeReading(inputs.text, from, to);
|
|
56
|
+
return reading.borrowed ? undefined : { from, to, minutes: (reading.to - reading.from) / SECONDS_PER_MINUTE };
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** 一つの升に範囲だけを書いた行の、その範囲。実働と休憩の列のほかに、そういう升が一つだけのときに読む。 */
|
|
60
|
+
const rangeTimes = (cells: readonly Cell[], columns: Columns, inputs: TimesheetInputs) => {
|
|
61
|
+
const others = cells.filter((_cell, index) => index !== columns.hours && index !== columns.break);
|
|
62
|
+
const found = others.flatMap((cell) => {
|
|
63
|
+
const within = trimmed(cell);
|
|
64
|
+
return inputs.ranges.filter((range) => range.start === within.start && range.end === within.end);
|
|
65
|
+
});
|
|
66
|
+
const range = found.length === 1 ? found[0] : undefined;
|
|
67
|
+
if (range === undefined || rangeReading(inputs.text, range.from, range.to).borrowed) return undefined;
|
|
68
|
+
return { from: range.from, to: range.to, minutes: range.minutes ?? (range.to.seconds - range.from.seconds) / SECONDS_PER_MINUTE };
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** 勤務の長さ。日をまたぐ行は、夜をまたぐ勤務の印のある文書でだけ読む。 */
|
|
72
|
+
const shiftMinutes = (minutes: number, overnight: boolean): number | undefined => {
|
|
73
|
+
if (minutes > 0) return minutes;
|
|
74
|
+
return overnight && minutes < 0 ? minutes + MINUTES_PER_DAY : undefined;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const lengthCell = (cell: Cell | undefined, inputs: TimesheetInputs, bareHours: boolean) => {
|
|
78
|
+
if (cell === undefined) return undefined;
|
|
79
|
+
const span = trimmed(cell);
|
|
80
|
+
const minutes = inputs.lengthOf(span.text, bareHours);
|
|
81
|
+
return minutes === undefined ? undefined : { ...span, minutes };
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const rowMismatch = (cells: readonly Cell[], columns: Columns, inputs: TimesheetInputs): TimesheetMismatch | undefined => {
|
|
85
|
+
const times = columns.start === -1 ? rangeTimes(cells, columns, inputs) : columnTimes(cells, columns, inputs);
|
|
86
|
+
const shift = times === undefined ? undefined : shiftMinutes(times.minutes, inputs.overnight);
|
|
87
|
+
const breakLength = lengthCell(cells[columns.break], inputs, false);
|
|
88
|
+
const total = lengthCell(cells[columns.hours], inputs, columns.bareHours);
|
|
89
|
+
if (times === undefined || shift === undefined || breakLength === undefined) return undefined;
|
|
90
|
+
const expected = shift - breakLength.minutes;
|
|
91
|
+
if (expected < 0) return { start: times.from, end: times.to, break: breakLength, expected };
|
|
92
|
+
if (total === undefined || Math.abs(expected - total.minutes) <= ROUNDING_MINUTES) return undefined;
|
|
93
|
+
return { start: times.from, end: times.to, break: breakLength, total, expected };
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const columnsOf = (header: readonly Cell[], marks: readonly Mark[]): Columns | undefined => {
|
|
97
|
+
const [start, end, hours, rest] = (["start", "end", "hours", "break"] as const).map((side) => columnOf(header, marks, side));
|
|
98
|
+
if (start === undefined || end === undefined || hours === undefined || rest === undefined || hours === -1 || rest === -1) return undefined;
|
|
99
|
+
if ((start === -1) !== (end === -1)) return undefined;
|
|
100
|
+
return { start, end, hours, break: rest, bareHours: !hasHeadingNote(header[hours]?.text ?? "") };
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/** 勤務表の行で、実働が終わり − 始まり − 休憩と合わないもの、休憩が勤務より長いもの。 */
|
|
104
|
+
export const timesheetHoursMismatches = (inputs: TimesheetInputs): TimesheetMismatch[] =>
|
|
105
|
+
tablesOf(linesOf(inputs.text)).flatMap((table) => {
|
|
106
|
+
const columns = columnsOf(cellsOf(table.header), inputs.columns);
|
|
107
|
+
if (columns === undefined) return [];
|
|
108
|
+
return table.rows.flatMap((line) => {
|
|
109
|
+
const mismatch = rowMismatch(cellsOf(line), columns, inputs);
|
|
110
|
+
return mismatch === undefined ? [] : [mismatch];
|
|
111
|
+
});
|
|
112
|
+
});
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { Span } from "../plugin.ts";
|
|
2
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
3
|
+
import type { Mark } from "../structure/time-marks.ts";
|
|
4
|
+
import {
|
|
5
|
+
asciiDigits,
|
|
6
|
+
isLimited,
|
|
7
|
+
lastIndexAtOrBefore,
|
|
8
|
+
periodCounts,
|
|
9
|
+
periodsIn,
|
|
10
|
+
windowStart,
|
|
11
|
+
type LimitWords,
|
|
12
|
+
type PeriodCount,
|
|
13
|
+
type PeriodCountWords,
|
|
14
|
+
} from "./period-counts.ts";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The amount of one use times the uses in a period, against the maximum stated for that period (1回2錠を1日3回、1日の最大量は
|
|
18
|
+
* 4錠; 2 tablets at a time, 3 times a day, no more than 4 tablets in 24 hours). Read in one paragraph holding exactly one
|
|
19
|
+
* labelled amount of one use, one count of uses in a period and one maximum in the same unit for the same period. Pure.
|
|
20
|
+
*/
|
|
21
|
+
type UseAmount = Span & { readonly amount: number; readonly unit: string };
|
|
22
|
+
|
|
23
|
+
export type UseMaximumWords = PeriodCountWords &
|
|
24
|
+
LimitWords & {
|
|
25
|
+
/** What makes an amount the amount of one use: before it (1回2錠) or right after it (2 tablets at a time). */
|
|
26
|
+
readonly perUse: readonly Mark[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type ExceededMaximum = {
|
|
30
|
+
readonly perUse: UseAmount;
|
|
31
|
+
readonly count: PeriodCount;
|
|
32
|
+
readonly maximum: UseAmount;
|
|
33
|
+
/** The amount of one use times the count. */
|
|
34
|
+
readonly expected: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type Maximum = UseAmount & { readonly hours: number };
|
|
38
|
+
|
|
39
|
+
/** A number and the unit written right after it (2錠, 3,000円, 4 tablets). A number in a range (1〜2錠) is not read. */
|
|
40
|
+
const AMOUNT = /(?<![\p{N}.,.〜~\-–])(\p{Nd}+(?:[,,]\p{Nd}{3})*(?:[..]\p{Nd}+)?)\s?([\p{Script=Han}\p{Script=Katakana}ー]{1,6}|[A-Za-zµμ]+)/gu;
|
|
41
|
+
|
|
42
|
+
const LATIN_PLURAL = /^([a-z]{2,})s$/u;
|
|
43
|
+
|
|
44
|
+
/** 錠 and 錠, tablet and tablets: the unit with its case and an English plural s taken off. */
|
|
45
|
+
const unitKey = (unit: string): string => {
|
|
46
|
+
const lower = unit.normalize("NFKC").toLowerCase();
|
|
47
|
+
return LATIN_PLURAL.exec(lower)?.[1] ?? lower;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** The characters of text that taken covers. */
|
|
51
|
+
const coverOf = (length: number, taken: readonly Span[]): Uint8Array => {
|
|
52
|
+
const cover = new Uint8Array(length);
|
|
53
|
+
taken.forEach((span) => cover.fill(1, span.start, span.end));
|
|
54
|
+
return cover;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const amountsIn = (text: string, taken: readonly Span[]): UseAmount[] => {
|
|
58
|
+
const cover = coverOf(text.length, taken);
|
|
59
|
+
return [...text.matchAll(AMOUNT)].flatMap((match): UseAmount[] => {
|
|
60
|
+
const span = { start: match.index, end: match.index + match[0].length };
|
|
61
|
+
const amount = Number((match[1] ?? "").normalize("NFKC").replace(/,/gu, ""));
|
|
62
|
+
if (cover.subarray(span.start, span.end).includes(1) || !Number.isFinite(amount)) return [];
|
|
63
|
+
return [{ ...span, amount, unit: unitKey(match[2] ?? "") }];
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const lower = (text: string): string => text.toLowerCase();
|
|
68
|
+
|
|
69
|
+
const LABEL_GAP = /^[\s,、]*/u;
|
|
70
|
+
const LABEL_SEPARATORS = new Set([" ", "\t", "\u3000", ":", ":"]);
|
|
71
|
+
|
|
72
|
+
/** 1回量:2錠 reads its label past the colon. */
|
|
73
|
+
const withoutSeparatorsAtEnd = (text: string): string => {
|
|
74
|
+
let end = text.length;
|
|
75
|
+
while (end > 0 && LABEL_SEPARATORS.has(text.charAt(end - 1))) end -= 1;
|
|
76
|
+
return text.slice(0, end);
|
|
77
|
+
};
|
|
78
|
+
/** How far around an amount its label is looked for, in characters. */
|
|
79
|
+
const LABEL_REACH = 32;
|
|
80
|
+
|
|
81
|
+
/** 1回2錠: the label right before the number. 2 tablets at a time: right after the unit. */
|
|
82
|
+
const isLabelled = (text: string, amount: UseAmount, labels: readonly Mark[]): boolean => {
|
|
83
|
+
const before = withoutSeparatorsAtEnd(lower(text.slice(Math.max(0, amount.start - LABEL_REACH), amount.start)));
|
|
84
|
+
const after = lower(text.slice(amount.end, amount.end + LABEL_REACH));
|
|
85
|
+
const gap = LABEL_GAP.exec(after)?.[0].length ?? 0;
|
|
86
|
+
return labels.some((label) =>
|
|
87
|
+
(label.position ?? "before") === "before"
|
|
88
|
+
? before.endsWith(lower(label.pattern))
|
|
89
|
+
: new RegExp(`^${escapeRegExp(lower(label.pattern))}(?![a-z])`, "u").test(after.slice(gap)),
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const COUNT_GAP = /^[\s,、を]*/u;
|
|
94
|
+
const SPACES = /^\s*/u;
|
|
95
|
+
|
|
96
|
+
/** Where the count would start after amount: past commas, を, and a limit word ("2 tablets, up to 3 times a day"). */
|
|
97
|
+
const countStartAfter = (text: string, amount: UseAmount, words: LimitWords): number => {
|
|
98
|
+
const from = amount.end + (COUNT_GAP.exec(text.slice(amount.end, amount.end + LABEL_REACH))?.[0].length ?? 0);
|
|
99
|
+
const rest = lower(text.slice(from, from + LABEL_REACH));
|
|
100
|
+
const limit = words.limits.find((mark) => (mark.position ?? "before") === "before" && new RegExp(`^${escapeRegExp(lower(mark.pattern))}\\s`, "u").test(rest));
|
|
101
|
+
if (limit === undefined) return from;
|
|
102
|
+
const after = from + limit.pattern.length;
|
|
103
|
+
return after + (SPACES.exec(text.slice(after, after + LABEL_REACH))?.[0].length ?? 0);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type Period = Span & { readonly hours: number };
|
|
107
|
+
|
|
108
|
+
type Periods = { readonly all: readonly Period[]; readonly ends: readonly number[]; readonly byStart: ReadonlyMap<number, number> };
|
|
109
|
+
|
|
110
|
+
const periodsOf = (all: readonly Period[]): Periods => ({
|
|
111
|
+
all,
|
|
112
|
+
ends: all.map((period) => period.end),
|
|
113
|
+
byStart: new Map(all.map((period) => [period.start, period.hours])),
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
/** The period of a maximum: right after it (4 tablets in 24 hours), or the last in its window (1日の最大量は). */
|
|
117
|
+
const periodOf = (text: string, amount: UseAmount, from: number, periods: Periods): number | undefined => {
|
|
118
|
+
const at = amount.end + (SPACES.exec(text.slice(amount.end, amount.end + LABEL_REACH))?.[0].length ?? 0);
|
|
119
|
+
const before = periods.all[lastIndexAtOrBefore(periods.ends, amount.start)];
|
|
120
|
+
return periods.byStart.get(at) ?? (before !== undefined && before.start >= from ? before.hours : undefined);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
type Reading = { readonly perUse: UseAmount[]; readonly maxima: Maximum[]; readonly counts: PeriodCount[] };
|
|
124
|
+
|
|
125
|
+
const readingOf = (text: string, words: UseMaximumWords): Reading => {
|
|
126
|
+
const counts = periodCounts(text, words);
|
|
127
|
+
const periods = periodsOf(periodsIn(text, words));
|
|
128
|
+
const amounts = amountsIn(text, [...counts, ...periods.all]);
|
|
129
|
+
const countStarts = new Set(counts.map((count) => count.start));
|
|
130
|
+
const perUse = new Set(amounts.filter((amount) => isLabelled(text, amount, words.perUse) || countStarts.has(countStartAfter(text, amount, words))));
|
|
131
|
+
const takenEnds = [...counts, ...amounts].map((span) => span.end).toSorted((left, right) => left - right);
|
|
132
|
+
const maxima = amounts.flatMap((amount): Maximum[] => {
|
|
133
|
+
const from = windowStart(text, amount.start, takenEnds);
|
|
134
|
+
const hours = perUse.has(amount) || !isLimited(text, amount, from, words) ? undefined : periodOf(text, amount, from, periods);
|
|
135
|
+
return hours === undefined ? [] : [{ ...amount, hours }];
|
|
136
|
+
});
|
|
137
|
+
return { perUse: [...perUse], maxima, counts };
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const inside = (scope: Span) => (span: Span) => span.start >= scope.start && span.end <= scope.end;
|
|
141
|
+
|
|
142
|
+
const exceededIn = (scope: Span, reading: Reading): ExceededMaximum | undefined => {
|
|
143
|
+
const [perUse, counts, maxima] = [reading.perUse.filter(inside(scope)), reading.counts.filter(inside(scope)), reading.maxima.filter(inside(scope))];
|
|
144
|
+
const [one, count, maximum] = [perUse[0], counts[0], maxima[0]];
|
|
145
|
+
if (perUse.length !== 1 || counts.length !== 1 || maxima.length !== 1 || one === undefined || count === undefined || maximum === undefined) return undefined;
|
|
146
|
+
if (one.unit !== maximum.unit || count.hours !== maximum.hours) return undefined;
|
|
147
|
+
const expected = one.amount * count.amount;
|
|
148
|
+
return expected > maximum.amount ? { perUse: one, count, maximum, expected } : undefined;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/** Maxima below the amount of one use times the uses in the same period. scopes are the paragraphs to read in. */
|
|
152
|
+
export const exceededMaxima = (written: string, scopes: readonly Span[], words: UseMaximumWords): ExceededMaximum[] => {
|
|
153
|
+
const reading = readingOf(asciiDigits(written), words);
|
|
154
|
+
return scopes.flatMap((scope) => {
|
|
155
|
+
const found = exceededIn(scope, reading);
|
|
156
|
+
return found === undefined ? [] : [found];
|
|
157
|
+
});
|
|
158
|
+
};
|
|
@@ -21,12 +21,12 @@ export type WorkingHoursMismatch = {
|
|
|
21
21
|
readonly start: Span;
|
|
22
22
|
readonly end: Span;
|
|
23
23
|
readonly break: Span;
|
|
24
|
-
readonly total:
|
|
24
|
+
readonly total: TimeLength;
|
|
25
25
|
/** The total the times and the break give, in minutes. */
|
|
26
26
|
readonly expected: number;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
type ClockRange = Span & { readonly from:
|
|
29
|
+
export type ClockRange = Span & { readonly from: TimeSpan; readonly to: TimeSpan; readonly minutes: number | undefined };
|
|
30
30
|
|
|
31
31
|
const SECONDS_PER_MINUTE = 60;
|
|
32
32
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// annual-holidays-mismatch: annual days off fewer than the weekly days off give over a year (structure/annual-holidays.ts).
|
|
2
|
+
// The labels are annual-holidays-label, the weekly phrases weekly-days-off, the other words annual-holidays-word,
|
|
3
|
+
// approximate-marker, range-connector and amount-range-word.
|
|
4
|
+
import type { Detector, Finding, Lexicon, ProseDocument } from "../plugin.ts";
|
|
5
|
+
import { annualHolidaysMismatches, type AnnualHolidaysWords, type PositionedWord } from "../structure/annual-holidays.ts";
|
|
6
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
7
|
+
import { quoteAround } from "./quote-around.ts";
|
|
8
|
+
|
|
9
|
+
const entriesOf = (doc: ProseDocument, lexicon: string, group?: string): Lexicon =>
|
|
10
|
+
(doc.lexicons[lexicon] ?? []).filter((entry) => group === undefined || entry.group === group);
|
|
11
|
+
|
|
12
|
+
const patternsOf = (doc: ProseDocument, lexicon: string, group?: string): string[] => entriesOf(doc, lexicon, group).map((entry) => entry.pattern);
|
|
13
|
+
|
|
14
|
+
const positionedOf = (doc: ProseDocument, lexicon: string, group?: string): PositionedWord[] =>
|
|
15
|
+
entriesOf(doc, lexicon, group).map((entry) => ({ word: entry.pattern, position: entry.position === "after" ? "after" : "before" }));
|
|
16
|
+
|
|
17
|
+
const weeklyOf = (doc: ProseDocument): AnnualHolidaysWords["weekly"] =>
|
|
18
|
+
entriesOf(doc, "weekly-days-off").map((entry) => ({ word: entry.pattern, minimum: entry.group === "every-week" ? entry.weight : undefined }));
|
|
19
|
+
|
|
20
|
+
const wordsOf = (doc: ProseDocument): AnnualHolidaysWords => ({
|
|
21
|
+
labels: positionedOf(doc, "annual-holidays-label"),
|
|
22
|
+
days: patternsOf(doc, "annual-holidays-word", "day"),
|
|
23
|
+
links: patternsOf(doc, "annual-holidays-word", "link"),
|
|
24
|
+
weekly: weeklyOf(doc),
|
|
25
|
+
negations: positionedOf(doc, "annual-holidays-word", "negation"),
|
|
26
|
+
exceptions: patternsOf(doc, "annual-holidays-word", "exception"),
|
|
27
|
+
markers: [...positionedOf(doc, "approximate-marker"), ...positionedOf(doc, "annual-holidays-word", "open")],
|
|
28
|
+
connectors: [...patternsOf(doc, "range-connector"), ...patternsOf(doc, "amount-range-word")],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const annualHolidaysMismatch: Detector = (doc): Finding[] => {
|
|
32
|
+
const text = proseAndTablesOf(doc);
|
|
33
|
+
return annualHolidaysMismatches(text, wordsOf(doc)).map((issue) => ({
|
|
34
|
+
rule: "annual-holidays-mismatch",
|
|
35
|
+
severity: "warning",
|
|
36
|
+
line: 0,
|
|
37
|
+
column: 0,
|
|
38
|
+
quote: quoteAround(text, issue.offset),
|
|
39
|
+
values: { ...issue.values, offset: issue.offset },
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// annual-pay-mismatch: an example annual pay that is not the monthly pay times twelve plus the bonus months
|
|
2
|
+
// (structure/annual-pay.ts). The amounts are currency-notation's, read with amount-multiplier's words of scale; the labels
|
|
3
|
+
// are annual-pay-label, the other words annual-pay-word, approximate-marker, duration-month, number-word (digit),
|
|
4
|
+
// range-connector and amount-range-word.
|
|
5
|
+
import type { Detector, Finding, Lexicon, ProseDocument } from "../plugin.ts";
|
|
6
|
+
import { annualPayMismatches, type AnnualPayWords, type PayAmount, type PositionedWord } from "../structure/annual-pay.ts";
|
|
7
|
+
import { scaledAmountOf, scaleWordsOf } from "./amount-scale.ts";
|
|
8
|
+
import { amountsIn, formsOf } from "./currency-notation.ts";
|
|
9
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
10
|
+
import { quoteAround } from "./quote-around.ts";
|
|
11
|
+
|
|
12
|
+
const entriesOf = (doc: ProseDocument, lexicon: string, group?: string): Lexicon =>
|
|
13
|
+
(doc.lexicons[lexicon] ?? []).filter((entry) => group === undefined || entry.group === group);
|
|
14
|
+
|
|
15
|
+
const patternsOf = (doc: ProseDocument, lexicon: string, group?: string): string[] => entriesOf(doc, lexicon, group).map((entry) => entry.pattern);
|
|
16
|
+
|
|
17
|
+
const positionedOf = (doc: ProseDocument, lexicon: string, group?: string): PositionedWord[] =>
|
|
18
|
+
entriesOf(doc, lexicon, group).map((entry) => ({ word: entry.pattern, position: entry.position === "after" ? "after" : "before" }));
|
|
19
|
+
|
|
20
|
+
const numberWordsOf = (doc: ProseDocument): AnnualPayWords["numberWords"] =>
|
|
21
|
+
entriesOf(doc, "number-word", "digit").flatMap((entry) => (entry.weight === undefined ? [] : [{ word: entry.pattern, value: entry.weight }]));
|
|
22
|
+
|
|
23
|
+
const labelsOf = (doc: ProseDocument): AnnualPayWords["labels"] => ({
|
|
24
|
+
example: patternsOf(doc, "annual-pay-label", "example"),
|
|
25
|
+
salary: patternsOf(doc, "annual-pay-label", "salary"),
|
|
26
|
+
monthly: patternsOf(doc, "annual-pay-label", "monthly"),
|
|
27
|
+
pay: patternsOf(doc, "annual-pay-label", "pay"),
|
|
28
|
+
bonus: patternsOf(doc, "annual-pay-label", "bonus"),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const wordsOf = (doc: ProseDocument): AnnualPayWords => ({
|
|
32
|
+
labels: labelsOf(doc),
|
|
33
|
+
links: patternsOf(doc, "annual-pay-word", "link"),
|
|
34
|
+
perMonth: patternsOf(doc, "annual-pay-word", "per-month"),
|
|
35
|
+
none: positionedOf(doc, "annual-pay-word", "none"),
|
|
36
|
+
each: patternsOf(doc, "annual-pay-word", "each"),
|
|
37
|
+
extra: patternsOf(doc, "annual-pay-word", "extra"),
|
|
38
|
+
times: patternsOf(doc, "annual-pay-word", "times"),
|
|
39
|
+
totals: patternsOf(doc, "annual-pay-word", "total"),
|
|
40
|
+
includes: patternsOf(doc, "annual-pay-word", "include"),
|
|
41
|
+
markers: [...positionedOf(doc, "approximate-marker"), ...positionedOf(doc, "annual-pay-word", "open")],
|
|
42
|
+
months: patternsOf(doc, "duration-month"),
|
|
43
|
+
connectors: [...patternsOf(doc, "range-connector"), ...patternsOf(doc, "amount-range-word")],
|
|
44
|
+
numberWords: numberWordsOf(doc),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const amountsOf = (text: string, doc: ProseDocument): PayAmount[] => {
|
|
48
|
+
const scales = scaleWordsOf(doc);
|
|
49
|
+
return amountsIn(
|
|
50
|
+
text,
|
|
51
|
+
formsOf(doc),
|
|
52
|
+
scales.map((scale) => scale.word),
|
|
53
|
+
).flatMap((amount) => {
|
|
54
|
+
const read = scaledAmountOf(text, amount, scales);
|
|
55
|
+
return read === undefined
|
|
56
|
+
? []
|
|
57
|
+
: [{ offset: read.offset, end: amount.offset + amount.written.length, currency: read.currency, value: read.value, scale: read.unit }];
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const annualPayMismatch: Detector = (doc): Finding[] => {
|
|
62
|
+
const text = proseAndTablesOf(doc);
|
|
63
|
+
return annualPayMismatches(text, amountsOf(text, doc), wordsOf(doc)).map((issue) => ({
|
|
64
|
+
rule: "annual-pay-mismatch",
|
|
65
|
+
severity: "warning",
|
|
66
|
+
line: 0,
|
|
67
|
+
column: 0,
|
|
68
|
+
quote: quoteAround(text, issue.offset),
|
|
69
|
+
values: { ...issue.values, offset: issue.offset },
|
|
70
|
+
}));
|
|
71
|
+
};
|
|
@@ -5,6 +5,9 @@ import { readMarkdown } from "../markdown-read.ts";
|
|
|
5
5
|
import { spanOf, type MarkdownNode } from "../markdown-node.ts";
|
|
6
6
|
import { eachPreOrder, foldPostOrder } from "../tree-walk.ts";
|
|
7
7
|
import { quoteAt } from "./structure-tree.ts";
|
|
8
|
+
import { amountColumnOf, isTotalRowGap, type BodyRow } from "../structure/total-row-blank.ts";
|
|
9
|
+
import { isAmountNameLine, isTotalLine } from "../structure/total-line.ts";
|
|
10
|
+
import { isTotalLabel } from "../structure/total.ts";
|
|
8
11
|
|
|
9
12
|
/** Fewer body rows than this, and one blank is as likely a choice as a gap. */
|
|
10
13
|
const MIN_BODY_ROWS = 3;
|
|
@@ -61,25 +64,45 @@ const cellOffset = (cell: MarkdownNode | undefined, row: MarkdownNode | undefine
|
|
|
61
64
|
return row === undefined ? undefined : spanOf(row)?.end;
|
|
62
65
|
};
|
|
63
66
|
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
/** Whether a row is a total, subtotal or tax row, judged from the row's source text. */
|
|
68
|
+
export type IsTotalRow = (rowText: string) => boolean;
|
|
69
|
+
|
|
70
|
+
const NO_TOTAL_ROWS: IsTotalRow = () => false;
|
|
71
|
+
|
|
72
|
+
const rowSource = (source: string, row: MarkdownNode): string => {
|
|
73
|
+
const span = spanOf(row);
|
|
74
|
+
return span === undefined ? "" : source.slice(span.start, span.end);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const bodyRowOf = (source: string, row: MarkdownNode, isTotalRow: IsTotalRow): BodyRow => ({
|
|
78
|
+
total: isTotalRow(rowSource(source, row)),
|
|
79
|
+
cells: (row.children ?? []).map((cell) => (shows(cell) ? sourceOf(source, cell) : undefined)),
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The one blank body cell of a column whose other body rows are all filled, unless it is a total row's blank beside its
|
|
84
|
+
* amount. Such a blank still counts as a second blank, so the rows it shares a column with stay as unreported as before.
|
|
85
|
+
*/
|
|
86
|
+
const columnBlank = (source: string, header: MarkdownNode, body: readonly MarkdownNode[], rows: readonly BodyRow[], column: number): Blank[] => {
|
|
87
|
+
const blanks = rows.flatMap((row, index) => (row.cells[column] === undefined ? [index] : []));
|
|
68
88
|
const at = blanks[0];
|
|
69
|
-
|
|
70
|
-
|
|
89
|
+
const row = at === undefined ? undefined : rows[at];
|
|
90
|
+
if (blanks.length !== 1 || at === undefined || row === undefined) return [];
|
|
91
|
+
if (isTotalRowGap(row, column, amountColumnOf(rows, header.children?.length ?? 0))) return [];
|
|
92
|
+
const offset = cellOffset(body[at]?.children?.[column], body[at]);
|
|
71
93
|
const name = sourceOf(source, header.children?.[column]);
|
|
72
94
|
return offset === undefined || name === "" ? [] : [{ offset, name }];
|
|
73
95
|
};
|
|
74
96
|
|
|
75
97
|
/** The first column is skipped: a blank there often means "same as above". */
|
|
76
|
-
const tableBlanksOf = (source: string, table: MarkdownNode): Blank[] => {
|
|
98
|
+
const tableBlanksOf = (source: string, table: MarkdownNode, isTotalRow: IsTotalRow): Blank[] => {
|
|
77
99
|
const [header, ...body] = table.children ?? [];
|
|
78
100
|
if (header === undefined || body.length < MIN_BODY_ROWS) return [];
|
|
101
|
+
const rows = body.map((row) => bodyRowOf(source, row, isTotalRow));
|
|
79
102
|
const columns = header.children?.length ?? 0;
|
|
80
103
|
return Array.from({ length: columns }, (_unused, column) => column)
|
|
81
104
|
.slice(1)
|
|
82
|
-
.flatMap((column) => columnBlank(source, header, body, column));
|
|
105
|
+
.flatMap((column) => columnBlank(source, header, body, rows, column));
|
|
83
106
|
};
|
|
84
107
|
|
|
85
108
|
/** Quoted material is someone else's: email replies the document model found, and every Markdown blockquote. */
|
|
@@ -95,8 +118,8 @@ const blocksOutsideQuotes = (source: string, type: string, replies: readonly Spa
|
|
|
95
118
|
};
|
|
96
119
|
|
|
97
120
|
/** Blank cells in every table outside quotes. */
|
|
98
|
-
export const tableBlanks = (source: string, replies: readonly Span[] = []): Blank[] =>
|
|
99
|
-
blocksOutsideQuotes(source, "table", replies).flatMap((table) => tableBlanksOf(source, table));
|
|
121
|
+
export const tableBlanks = (source: string, replies: readonly Span[] = [], isTotalRow: IsTotalRow = NO_TOTAL_ROWS): Blank[] =>
|
|
122
|
+
blocksOutsideQuotes(source, "table", replies).flatMap((table) => tableBlanksOf(source, table, isTotalRow));
|
|
100
123
|
|
|
101
124
|
type Item = { readonly node: MarkdownNode; readonly text: string | undefined; readonly empty: boolean };
|
|
102
125
|
|
|
@@ -139,9 +162,9 @@ export const listBlanks = (source: string, replies: readonly Span[] = []): Blank
|
|
|
139
162
|
blocksOutsideQuotes(source, "list", replies).flatMap((list) => listBlanksOf(source, list));
|
|
140
163
|
|
|
141
164
|
const findingsOf =
|
|
142
|
-
(rule: string, blanksOf: (
|
|
165
|
+
(rule: string, blanksOf: (doc: ProseDocument) => Blank[]): Detector =>
|
|
143
166
|
(doc: ProseDocument): Finding[] =>
|
|
144
|
-
blanksOf(doc
|
|
167
|
+
blanksOf(doc).map((blank) => ({
|
|
145
168
|
rule,
|
|
146
169
|
severity: "warning",
|
|
147
170
|
line: 0,
|
|
@@ -151,5 +174,22 @@ const findingsOf =
|
|
|
151
174
|
values: { name: blank.name, offset: blank.offset },
|
|
152
175
|
}));
|
|
153
176
|
|
|
154
|
-
|
|
155
|
-
|
|
177
|
+
const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* A total row starts with a total word (total-label, with total-label-qualifier or total-period-qualifier: Week total),
|
|
181
|
+
* a tax word (tax-label), or is named by a computed amount (net-amount-label: Gross pay, Net pay).
|
|
182
|
+
*/
|
|
183
|
+
const totalRowOf = (doc: ProseDocument): IsTotalRow => {
|
|
184
|
+
const totals = {
|
|
185
|
+
labels: patternsOf(doc, "total-label"),
|
|
186
|
+
qualifiers: doc.lexicons["total-label-qualifier"] ?? [],
|
|
187
|
+
periodQualifiers: doc.lexicons["total-period-qualifier"] ?? [],
|
|
188
|
+
amountNames: patternsOf(doc, "net-amount-label"),
|
|
189
|
+
};
|
|
190
|
+
const taxes = patternsOf(doc, "tax-label");
|
|
191
|
+
return (rowText) => isTotalLine(rowText, totals) || isAmountNameLine(rowText, totals) || isTotalLabel(rowText, taxes);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export const emptyTableCell: Detector = findingsOf("empty-table-cell", (doc) => tableBlanks(doc.source, doc.replyQuotes ?? [], totalRowOf(doc)));
|
|
195
|
+
export const emptyListItem: Detector = findingsOf("empty-list-item", (doc) => listBlanks(doc.source, doc.replyQuotes ?? []));
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// bmi-mismatch: the reading half. Reads, section by section, the tables (each row's label and cells) and the "label: value"
|
|
2
|
+
// lines, and leaves the deciding to structure/bmi.ts.
|
|
3
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
4
|
+
import { linesOf, type Line } from "../structure/lines.ts";
|
|
5
|
+
import { tablesOf } from "../facts/table-facts.ts";
|
|
6
|
+
import { EDGE_MARKS, trimEndOf, withoutEdgeMarks } from "../facts/trim-marks.ts";
|
|
7
|
+
import { tableRowOf } from "./ratio-mismatch.ts";
|
|
8
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
9
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
10
|
+
import { sectionBmiMismatches, type BodyKind, type BodyUnit, type BodyWords } from "../structure/bmi.ts";
|
|
11
|
+
import type { TableRow } from "../structure/ratio.ts";
|
|
12
|
+
|
|
13
|
+
const RULE = "bmi-mismatch";
|
|
14
|
+
const KINDS: ReadonlySet<string> = new Set(["height", "weight", "bmi"]);
|
|
15
|
+
|
|
16
|
+
const isKind = (group: string | undefined): group is BodyKind => group !== undefined && KINDS.has(group);
|
|
17
|
+
|
|
18
|
+
const unitsOf = (doc: ProseDocument, id: string): BodyUnit[] =>
|
|
19
|
+
(doc.lexicons[id] ?? []).flatMap((entry) => (entry.weight === undefined ? [] : [{ pattern: entry.pattern, factor: entry.weight }]));
|
|
20
|
+
|
|
21
|
+
const wordsOf = (doc: ProseDocument): BodyWords => ({
|
|
22
|
+
terms: (doc.lexicons["bmi-term"] ?? []).flatMap((entry) => (isKind(entry.group) ? [{ pattern: entry.pattern, kind: entry.group }] : [])),
|
|
23
|
+
lengthUnits: unitsOf(doc, "unit-length"),
|
|
24
|
+
massUnits: unitsOf(doc, "unit-mass"),
|
|
25
|
+
bmiUnits: (doc.lexicons["bmi-unit"] ?? []).map((entry) => entry.pattern),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/** A list mark or a blockquote mark at the head of a line ("- ", "1. ", "> "). */
|
|
29
|
+
const LINE_MARK = /^\s*(?:>\s*)*(?:(?:[-*+]|\d+[.)])\s+)?/u;
|
|
30
|
+
/** "Height: 178 cm", 「身長:160.0 cm」: the label ends at the first colon. */
|
|
31
|
+
const COLON = /[::]/u;
|
|
32
|
+
/** What may end a value: a sentence end, edge marks and spaces. */
|
|
33
|
+
const VALUE_END: ReadonlySet<string> = new Set([...EDGE_MARKS, "。", "."]);
|
|
34
|
+
|
|
35
|
+
/** A "label: value" line read as a row of one cell: the label up to the first colon, the value after it to the line end. */
|
|
36
|
+
const labelLineRow = (line: Line): TableRow[] => {
|
|
37
|
+
const mark = LINE_MARK.exec(line.text)?.[0] ?? "";
|
|
38
|
+
const colon = line.text.slice(mark.length).search(COLON);
|
|
39
|
+
if (colon <= 0) return [];
|
|
40
|
+
const valueFrom = mark.length + colon + 1;
|
|
41
|
+
const text = withoutEdgeMarks(trimEndOf(line.text.slice(valueFrom), VALUE_END));
|
|
42
|
+
if (text === "") return [];
|
|
43
|
+
const start = line.start + valueFrom + line.text.slice(valueFrom).indexOf(text);
|
|
44
|
+
return [{ label: withoutEdgeMarks(line.text.slice(mark.length, mark.length + colon)), cells: [{ start, text }] }];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type SectionGroups = { readonly tables: TableRow[][]; readonly lines: TableRow[] };
|
|
48
|
+
|
|
49
|
+
const sectionAt = (doc: ProseDocument, offset: number): number => doc.sections.findLastIndex((section) => section.span.start <= offset);
|
|
50
|
+
|
|
51
|
+
/** Each section's tables and its "label: value" lines, by the index of the section (-1 before the first). */
|
|
52
|
+
const groupsBySection = (doc: ProseDocument): Map<number, SectionGroups> => {
|
|
53
|
+
const lines = linesOf(proseAndTablesOf(doc));
|
|
54
|
+
const tables = tablesOf(lines);
|
|
55
|
+
const tableLines = new Set(tables.flatMap((table) => [table.header.number, ...table.rows.map((row) => row.number)]));
|
|
56
|
+
const groups = new Map<number, SectionGroups>();
|
|
57
|
+
const groupAt = (offset: number): SectionGroups => {
|
|
58
|
+
const index = sectionAt(doc, offset);
|
|
59
|
+
const found = groups.get(index) ?? { tables: [], lines: [] };
|
|
60
|
+
groups.set(index, found);
|
|
61
|
+
return found;
|
|
62
|
+
};
|
|
63
|
+
tables.forEach((table) => groupAt(table.header.start).tables.push(table.rows.flatMap(tableRowOf)));
|
|
64
|
+
lines.filter((line) => !tableLines.has(line.number)).forEach((line) => groupAt(line.start).lines.push(...labelLineRow(line)));
|
|
65
|
+
return groups;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const bmiMismatch: Detector = (doc): Finding[] => {
|
|
69
|
+
const words = wordsOf(doc);
|
|
70
|
+
if (words.terms.length === 0) return [];
|
|
71
|
+
return [...groupsBySection(doc).values()]
|
|
72
|
+
.flatMap((section) => sectionBmiMismatches([...section.tables, section.lines], words))
|
|
73
|
+
.toSorted((left, right) => left.offset - right.offset)
|
|
74
|
+
.map((issue) => ({
|
|
75
|
+
rule: RULE,
|
|
76
|
+
severity: "warning",
|
|
77
|
+
line: 0,
|
|
78
|
+
column: 0,
|
|
79
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
80
|
+
values: { ...issue.values, offset: issue.offset },
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
// tree's quantities, the numbers counted with a word ("1,200 companies"), the calendar years, and the lexicons change-direction,
|
|
3
3
|
// change-base, change-target, change-break, percent-unit and amount-multiplier.
|
|
4
4
|
import type { Detector, Finding, LexiconEntry, ProseDocument, Span, StructureNode, Token } from "../plugin.ts";
|
|
5
|
-
import { inDocumentOrder } from "../structure/issues.ts";
|
|
5
|
+
import { inDocumentOrder, type StructureIssue } from "../structure/issues.ts";
|
|
6
6
|
import { startsOtherSubject } from "../structure/subject-change.ts";
|
|
7
7
|
import { changeRateMismatches, type BaseMark, type Break, type Direction, type Figure, type Period, type Rate } from "../structure/change-rate.ts";
|
|
8
8
|
import { escapeRegExp } from "../orthography.ts";
|
|
9
9
|
import { quoteAt } from "./structure-tree.ts";
|
|
10
|
+
import { tableRateMismatches, type ChangeTable, type ColumnRole, type ColumnWord } from "../structure/change-rate-table.ts";
|
|
11
|
+
import { cellsOf, tablesOf } from "../facts/table-facts.ts";
|
|
12
|
+
import { linesOf } from "../structure/lines.ts";
|
|
13
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
10
14
|
|
|
11
15
|
const patternsOf = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
|
|
12
16
|
|
|
@@ -137,7 +141,23 @@ const marksOf = (doc: ProseDocument, lexicon: string): BaseMark[] =>
|
|
|
137
141
|
entry.position === undefined ? [] : spansOf(doc.source, entry.pattern).map((span) => ({ ...span, position: entry.position ?? "before" })),
|
|
138
142
|
);
|
|
139
143
|
|
|
140
|
-
|
|
144
|
+
const ROLES: readonly string[] = ["base", "current", "rate", "change"] satisfies readonly ColumnRole[];
|
|
145
|
+
const isRole = (group: string | undefined): group is ColumnRole => group !== undefined && ROLES.includes(group);
|
|
146
|
+
|
|
147
|
+
/** Lexicon change-column: the heading words that say which column holds the earlier value, the later one and the rate. */
|
|
148
|
+
const columnWordsOf = (doc: ProseDocument): ColumnWord[] =>
|
|
149
|
+
(doc.lexicons["change-column"] ?? []).flatMap((entry) => (isRole(entry.group) ? [{ pattern: entry.pattern, role: entry.group }] : []));
|
|
150
|
+
|
|
151
|
+
/** The document's Markdown tables (outside code and quotes): the heading cells and the body rows' cells. */
|
|
152
|
+
const changeTablesOf = (doc: ProseDocument): ChangeTable[] =>
|
|
153
|
+
tablesOf(linesOf(proseAndTablesOf(doc))).map((table) => ({ header: cellsOf(table.header), rows: table.rows.map(cellsOf) }));
|
|
154
|
+
|
|
155
|
+
const tableIssues = (doc: ProseDocument): StructureIssue[] => {
|
|
156
|
+
const words = columnWordsOf(doc);
|
|
157
|
+
return words.length === 0 ? [] : tableRateMismatches(changeTablesOf(doc), words);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const sentenceIssues = (doc: ProseDocument): StructureIssue[] => {
|
|
141
161
|
if (doc.structure === undefined) return [];
|
|
142
162
|
const nodes = quantityNodes(doc.structure);
|
|
143
163
|
const units = patternsOf(doc, "percent-unit");
|
|
@@ -155,7 +175,11 @@ export const changeRate: Detector = (doc): Finding[] => {
|
|
|
155
175
|
breaks: breaksOf(doc),
|
|
156
176
|
source: doc.source,
|
|
157
177
|
};
|
|
158
|
-
return changeRateMismatches(text)
|
|
178
|
+
return changeRateMismatches(text);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const changeRate: Detector = (doc): Finding[] =>
|
|
182
|
+
[...sentenceIssues(doc), ...tableIssues(doc)].map((issue) => ({
|
|
159
183
|
rule: "change-rate-mismatch",
|
|
160
184
|
severity: "warning",
|
|
161
185
|
line: 0,
|
|
@@ -163,4 +187,3 @@ export const changeRate: Detector = (doc): Finding[] => {
|
|
|
163
187
|
quote: quoteAt(doc.source, issue.offset),
|
|
164
188
|
values: { ...issue.values, offset: issue.offset },
|
|
165
189
|
}));
|
|
166
|
-
};
|