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
|
@@ -19,6 +19,8 @@ export type NumberWords = {
|
|
|
19
19
|
readonly countWords: readonly string[];
|
|
20
20
|
/** Plural nouns of measure (days, miles) that take figures in every style: a number before one is not a count. */
|
|
21
21
|
readonly figureNouns: readonly string[];
|
|
22
|
+
/** Words written before a number to name one of a series (Grade 5, Room 12): the number after one is not a count. */
|
|
23
|
+
readonly nameWords: readonly string[];
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
const alternation = (words: readonly string[]): string =>
|
|
@@ -147,9 +149,14 @@ const valueOf = (surface: string, words: readonly string[]): number | undefined
|
|
|
147
149
|
const isCountedNoun = (token: Token | undefined, figureNouns: readonly string[]): boolean =>
|
|
148
150
|
token?.pos === "NOUN" && token.features?.["Number"] === "Plur" && !figureNouns.includes(token.surface.toLowerCase());
|
|
149
151
|
|
|
152
|
+
/** Whether the text ends in one of the name words, standing as a word of its own (Grade 5, No. 5). */
|
|
153
|
+
const endsInNameWord = (before: string, nameWords: readonly string[]): boolean =>
|
|
154
|
+
nameWords.length > 0 && new RegExp(`(?<![\\p{L}\\p{N}])(?:${alternation(nameWords)})\\s*$`, "u").test(before);
|
|
155
|
+
|
|
150
156
|
/**
|
|
151
157
|
* A number before a plural noun (three files, 3 files), from two to the last number word the language lists. One is a
|
|
152
|
-
* pronoun as often as a count. A number word that opens the sentence is spelt out by every style, so it is not counted
|
|
158
|
+
* pronoun as often as a count. A number word that opens the sentence is spelt out by every style, so it is not counted,
|
|
159
|
+
* nor a number after a name word (Grade 5 students), which names the group rather than counting it.
|
|
153
160
|
*/
|
|
154
161
|
const englishCountMarks = (sentence: Sentence, words: NumberWords): NumberMark[] => {
|
|
155
162
|
const tokens = sentence.tokens ?? [];
|
|
@@ -157,8 +164,9 @@ const englishCountMarks = (sentence: Sentence, words: NumberWords): NumberMark[]
|
|
|
157
164
|
const value = valueOf(token.surface, words.countWords);
|
|
158
165
|
if (value === undefined || value < SMALL_FROM || value > words.countWords.length || index === 0 || !isCountedNoun(tokens[index + 1], words.figureNouns))
|
|
159
166
|
return [];
|
|
167
|
+
if (endsInNameWord(sentence.text.slice(0, token.span.start - sentence.span.start), words.nameWords)) return [];
|
|
160
168
|
const style = /^\d+$/u.test(token.surface) ? "digits" : "words";
|
|
161
|
-
return [{ kind: value < LARGE_FROM ? "count-small" : "count-large", style, written: token.surface, offset:
|
|
169
|
+
return [{ kind: value < LARGE_FROM ? "count-small" : "count-large", style, written: token.surface, offset: token.span.start }];
|
|
162
170
|
});
|
|
163
171
|
};
|
|
164
172
|
|
|
@@ -201,6 +209,7 @@ const wordsOf = (doc: ProseDocument): NumberWords => {
|
|
|
201
209
|
percentUnits: patterns("percent-unit"),
|
|
202
210
|
countWords: patterns("count-number"),
|
|
203
211
|
figureNouns: patterns("figure-noun"),
|
|
212
|
+
nameWords: patterns("number-name-word"),
|
|
204
213
|
};
|
|
205
214
|
};
|
|
206
215
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// delivered-over-ordered and backorder-mismatch: the reading half. Reads the document's Markdown tables and the lexicon
|
|
2
|
+
// order-quantity-column, and leaves the deciding to structure/order-quantity.ts.
|
|
3
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
4
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
5
|
+
import { cellsOf, tablesOf } from "../facts/table-facts.ts";
|
|
6
|
+
import { linesOf } from "../structure/lines.ts";
|
|
7
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
8
|
+
import type { ChangeTable } from "../structure/change-rate-table.ts";
|
|
9
|
+
import type { StructureIssue } from "../structure/issues.ts";
|
|
10
|
+
import { backorderMismatches, deliveredOverOrdered, type QuantityRole, type QuantityWords } from "../structure/order-quantity.ts";
|
|
11
|
+
|
|
12
|
+
const ROLES: readonly string[] = ["ordered", "delivered", "backordered"] satisfies readonly QuantityRole[];
|
|
13
|
+
const isRole = (group: string | undefined): group is QuantityRole => group !== undefined && ROLES.includes(group);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Lexicon order-quantity-column: the heading words that say which column holds the ordered, delivered and backordered
|
|
17
|
+
* count, and (group qualifier) the words after a number that make it no exact count.
|
|
18
|
+
*/
|
|
19
|
+
export const quantityWordsOf = (doc: ProseDocument): QuantityWords => {
|
|
20
|
+
const entries = doc.lexicons["order-quantity-column"] ?? [];
|
|
21
|
+
return {
|
|
22
|
+
columns: entries.flatMap((entry) => (isRole(entry.group) ? [{ pattern: entry.pattern, role: entry.group }] : [])),
|
|
23
|
+
qualifiers: entries.flatMap((entry) => (entry.group === "qualifier" ? [entry.pattern] : [])),
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type RowCheck = (tables: readonly ChangeTable[], words: QuantityWords) => StructureIssue[];
|
|
28
|
+
|
|
29
|
+
const detectorOf =
|
|
30
|
+
(rule: string, check: RowCheck): Detector =>
|
|
31
|
+
(doc): Finding[] => {
|
|
32
|
+
const words = quantityWordsOf(doc);
|
|
33
|
+
if (words.columns.length === 0) return [];
|
|
34
|
+
const tables = tablesOf(linesOf(proseAndTablesOf(doc))).map((table) => ({ header: cellsOf(table.header), rows: table.rows.map(cellsOf) }));
|
|
35
|
+
return check(tables, words).map((issue) => ({
|
|
36
|
+
rule,
|
|
37
|
+
severity: "warning",
|
|
38
|
+
line: 0,
|
|
39
|
+
column: 0,
|
|
40
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
41
|
+
values: { ...issue.values, offset: issue.offset },
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const deliveredOverOrderedDetector: Detector = detectorOf("delivered-over-ordered", deliveredOverOrdered);
|
|
46
|
+
export const backorderMismatchDetector: Detector = detectorOf("backorder-mismatch", backorderMismatches);
|
|
@@ -7,6 +7,7 @@ import { nameSpans, touchesAny } from "../team-names.ts";
|
|
|
7
7
|
import { furiganaSpans } from "../furigana.ts";
|
|
8
8
|
import { acronymsIn, isCapitalsNotSpelling } from "../capitals-with-small.ts";
|
|
9
9
|
import { isPartOfAddress } from "./address-word.ts";
|
|
10
|
+
import { wholeWordRuns, type WholeWordRun } from "../whole-word-runs.ts";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* A word found in the document: where it is, which sentence it is in, its key and spelling, how it is written when that differs, and
|
|
@@ -37,6 +38,8 @@ const DISTINCT = "orthographic-variant-distinct";
|
|
|
37
38
|
const FUKUSHI = "hiragana-fukushi";
|
|
38
39
|
/** Lexicon: idioms written as noun, particle and verb (気をつける). The verb there is compared apart from the verb on its own. */
|
|
39
40
|
const IDIOM = "orthographic-variant-idiom";
|
|
41
|
+
/** Lexicon: words the tokenizer cuts in one spelling and not the other (お客様, お客 and さま). Each is read whole, keyed by its group. */
|
|
42
|
+
const WHOLE_WORD = "orthographic-variant-whole-word";
|
|
40
43
|
|
|
41
44
|
const patternsOf = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
|
|
42
45
|
|
|
@@ -116,7 +119,7 @@ const isCutFromKatakana = ({ token, previous }: InContext): boolean =>
|
|
|
116
119
|
const isCopulaReadAsVerb = ({ token, previous }: InContext): boolean =>
|
|
117
120
|
token.pos === "VERB" && token.surface === "で" && previous !== undefined && previous.pos !== "ADP";
|
|
118
121
|
|
|
119
|
-
type Skips = { readonly skip: ReadonlySet<string>; readonly idioms: ReadonlySet<string> };
|
|
122
|
+
type Skips = { readonly skip: ReadonlySet<string>; readonly idioms: ReadonlySet<string>; readonly wholeWords: ReadonlyMap<string, string> };
|
|
120
123
|
|
|
121
124
|
const readingKeyOf = (word: InContext, { skip, idioms }: Skips): string | undefined => {
|
|
122
125
|
const { token } = word;
|
|
@@ -127,17 +130,40 @@ const readingKeyOf = (word: InContext, { skip, idioms }: Skips): string | undefi
|
|
|
127
130
|
return `${token.pos}|${useOf(word, idioms)}|${reading}`;
|
|
128
131
|
};
|
|
129
132
|
|
|
133
|
+
/**
|
|
134
|
+
* A listed word keyed by its group, so its spellings meet however the tokenizer cut each one. Not by reading: お父様 is read
|
|
135
|
+
* オ + トウサマ and お父さま オ + チチ + サマ.
|
|
136
|
+
*/
|
|
137
|
+
const wholeWordOf = (
|
|
138
|
+
sentence: Sentence,
|
|
139
|
+
tokens: readonly Token[],
|
|
140
|
+
{ first, last, word }: WholeWordRun,
|
|
141
|
+
isOpen: IsOpen,
|
|
142
|
+
groups: ReadonlyMap<string, string>,
|
|
143
|
+
): Placed[] => {
|
|
144
|
+
const [head, tail] = [tokens[first], tokens[last]];
|
|
145
|
+
if (head === undefined || tail === undefined || !isOpen(head.span.start - sentence.span.start, tail.span.end - sentence.span.start)) return [];
|
|
146
|
+
return [{ key: `whole|${groups.get(word) ?? word}`, spelling: word, sentence, offset: head.span.start }];
|
|
147
|
+
};
|
|
148
|
+
|
|
130
149
|
/** Japanese words keyed by part of speech, use and the reading of the dictionary form, spelled as the dictionary form. */
|
|
131
150
|
const readingWords = (sentence: Sentence, isOpen: IsOpen, skips: Skips): Placed[] => {
|
|
132
151
|
const tokens = sentence.tokens ?? [];
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
152
|
+
const runs = wholeWordRuns(tokens, skips.wholeWords);
|
|
153
|
+
const inRun = new Set(runs.flatMap(({ first, last }) => Array.from({ length: last - first + 1 }, (_, extra) => first + extra)));
|
|
154
|
+
const whole = runs.flatMap((run) => wholeWordOf(sentence, tokens, run, isOpen, skips.wholeWords));
|
|
155
|
+
return [
|
|
156
|
+
...whole,
|
|
157
|
+
...tokens.flatMap((token, at): Placed[] => {
|
|
158
|
+
if (inRun.has(at)) return [];
|
|
159
|
+
const key = readingKeyOf({ token, previous: tokens[at - 1], before: tokens[at - 2] }, skips);
|
|
160
|
+
const local = token.span.start - sentence.span.start;
|
|
161
|
+
if (key === undefined || token.lemma === undefined || !isOpen(local, local + token.surface.length)) return [];
|
|
162
|
+
const next = tokens[at + 1];
|
|
163
|
+
const compoundHead = token.pos === "NOUN" && next?.pos === "NOUN" && isTouching(token, next);
|
|
164
|
+
return [{ key, spelling: token.lemma, sentence, offset: token.span.start, compoundHead }];
|
|
165
|
+
}),
|
|
166
|
+
];
|
|
141
167
|
};
|
|
142
168
|
|
|
143
169
|
/**
|
|
@@ -273,7 +299,11 @@ const cellPlace = (cell: TableCell, names: readonly string[]): Place => {
|
|
|
273
299
|
* document writes less is pointed at. No way is called right; limit is the largest share, in percent, the minority may have.
|
|
274
300
|
*/
|
|
275
301
|
export const orthographicVariant: Detector = (doc, options): Finding[] => {
|
|
276
|
-
const skips: Skips = {
|
|
302
|
+
const skips: Skips = {
|
|
303
|
+
skip: new Set([...patternsOf(doc, DISTINCT), ...patternsOf(doc, FUKUSHI)]),
|
|
304
|
+
idioms: new Set(patternsOf(doc, IDIOM)),
|
|
305
|
+
wholeWords: new Map((doc.lexicons[WHOLE_WORD] ?? []).map((entry) => [entry.pattern, entry.group ?? entry.pattern])),
|
|
306
|
+
};
|
|
277
307
|
const names = doc.names ?? [];
|
|
278
308
|
const placed: Place[] = [
|
|
279
309
|
...doc.sentences.map((sentence) => ({ sentence, isOpen: isOpenIn(sentence, names), readsLatin: true })),
|
|
@@ -5,7 +5,8 @@ import { minorityReport } from "../spacing-minority.ts";
|
|
|
5
5
|
import { isWithinAny, quotedSpans } from "../quoted-span.ts";
|
|
6
6
|
import { digitRunAround, endsWithDivisionLabel, isNumberName, sequenceLabelStarts, type NameContext } from "../number-name.ts";
|
|
7
7
|
import { isSpacedLocationPart, type FloorWords } from "../location-part.ts";
|
|
8
|
-
import {
|
|
8
|
+
import { isNameSeparator, type OrganizationWords } from "../name-separator.ts";
|
|
9
|
+
import { addressSpans, clockTimeSpans, identifierSpans, isInsideSpan } from "../spacing-code.ts";
|
|
9
10
|
|
|
10
11
|
/** チームが chaff.yaml の prefer に書いた「使わない書き方」。書いていなければ何も言わない。 */
|
|
11
12
|
export const preferredTerm: Detector = (doc, options): Finding[] => {
|
|
@@ -37,13 +38,15 @@ const digitBeside = (boundary: Boundary): number => {
|
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* 文書全体で一度だけ読むもの(number-name.ts の NameContext に加えて)。calendar は日付・時刻の単位、
|
|
40
|
-
* divisions は「第1節」のように「第」と番号の後ろに書く区切りの語、floors は階・部屋の番号を読む語(5階、201号室、地下 1
|
|
41
|
+
* divisions は「第1節」のように「第」と番号の後ろに書く区切りの語、floors は階・部屋の番号を読む語(5階、201号室、地下 1階)、
|
|
42
|
+
* organizations は組織の名前を読む語(経営企画部、株式会社)。
|
|
41
43
|
*/
|
|
42
44
|
type NumberContext = NameContext & {
|
|
43
45
|
readonly calendar: CalendarUnits;
|
|
44
46
|
readonly divisions: ReadonlySet<string>;
|
|
45
47
|
readonly itemNumbers: ReadonlySet<string>;
|
|
46
48
|
readonly floors: FloorWords;
|
|
49
|
+
readonly organizations: OrganizationWords;
|
|
47
50
|
};
|
|
48
51
|
|
|
49
52
|
/** 文頭の項目の番号の後ろと見る境目の位置の上限。番号は短く文の頭にあるので、これより後ろの境目は番号の後ろではない。長い文で文頭からの切り出しを繰り返さない。 */
|
|
@@ -71,23 +74,30 @@ const followsItemNumber = (text: string, boundary: Boundary, itemNumbers: Readon
|
|
|
71
74
|
const calendarStarts = (sentence: Sentence, units: CalendarUnits): ReadonlySet<number> =>
|
|
72
75
|
new Set(calendarRuns(sentence.text, sentence.tokens, sentence.span.start, units).map(({ run }) => run.start));
|
|
73
76
|
|
|
74
|
-
/**
|
|
75
|
-
const
|
|
76
|
-
isInsideSpan(
|
|
77
|
+
/** 英数字の側が spans のどれか(メールアドレス・URL・番号)の中にある境目。 */
|
|
78
|
+
const besideSpan = (spans: readonly Span[], boundary: Boundary): boolean =>
|
|
79
|
+
isInsideSpan(spans, boundary.offset - 1) || isInsideSpan(spans, boundary.spaced ? boundary.offset + 1 : boundary.offset);
|
|
77
80
|
|
|
78
|
-
/** 文の中で一度だけ探すもの: 日付・時刻の数の頭の位置、コロンで書いた時刻、メールアドレス・URL
|
|
79
|
-
type SentenceCodes = {
|
|
81
|
+
/** 文の中で一度だけ探すもの: 日付・時刻の数の頭の位置、コロンで書いた時刻、メールアドレス・URL、予約番号や型番のような番号。 */
|
|
82
|
+
type SentenceCodes = {
|
|
83
|
+
readonly calendar: ReadonlySet<number>;
|
|
84
|
+
readonly clockTimes: readonly Span[];
|
|
85
|
+
readonly addresses: readonly Span[];
|
|
86
|
+
readonly identifiers: readonly Span[];
|
|
87
|
+
};
|
|
80
88
|
|
|
81
89
|
/**
|
|
82
90
|
* 番号・識別子として書かれた数(number-name.ts)、日付・時刻の数、「第1節」の後ろの境目、文頭の項目の番号(「一 JIS」)の後ろの境目は、空け方の好みではないので数えない。
|
|
83
91
|
* 日付・時刻は前の境目(「は 9月」「午後3時」「令和 3 年」)も数えない。日付はまとめて一つの書き方で、数量の空け方の票にはしない。コロンで書いた時刻(13:30)も同じ。
|
|
84
|
-
* メールアドレス・URL の前後の境目も数えない(spacing-code.ts
|
|
92
|
+
* メールアドレス・URL の前後の境目も数えない(spacing-code.ts)。「予約番号 MN-48215 を」の番号の前後も、番号を文から区切る空白なので数えない。
|
|
85
93
|
* 「本社 5階」のように名前の後ろに空白で区切った階・部屋の番号の前の空白も、所在の組の区切りなので数えない(location-part.ts)。
|
|
94
|
+
* 「経営企画部 IR担当」のように名前だけを並べた行で、名前と名前を分ける空白も数えない(name-separator.ts)。
|
|
86
95
|
*/
|
|
87
96
|
const isCounted = (sentence: Sentence, boundary: Boundary, context: NumberContext, codes: SentenceCodes): boolean => {
|
|
88
|
-
if (followsItemNumber(sentence.text, boundary, context.itemNumbers)) return false;
|
|
97
|
+
if (followsItemNumber(sentence.text, boundary, context.itemNumbers) || besideSpan(codes.identifiers, boundary)) return false;
|
|
89
98
|
if (boundary.kind !== "after-digit" && endsWithDivisionLabel(sentence.text.slice(0, boundary.offset), context.divisions)) return false;
|
|
90
|
-
if (boundary.kind === "letter")
|
|
99
|
+
if (boundary.kind === "letter")
|
|
100
|
+
return !besideSpan(codes.addresses, boundary) && !isNameSeparator(sentence.text, boundary, sentence.tokens, sentence.span.start, context.organizations);
|
|
91
101
|
if (isInsideSpan(codes.clockTimes, digitBeside(boundary))) return false;
|
|
92
102
|
const run = digitRunAround(sentence.text, digitBeside(boundary));
|
|
93
103
|
if (run === undefined) return true;
|
|
@@ -160,10 +170,16 @@ export const latinSpacing: Detector = (doc, options): Finding[] => {
|
|
|
160
170
|
divisions: labelsAt(doc, "after"),
|
|
161
171
|
itemNumbers: numberedItems(patternList(doc, "item-number"), doc.prose ?? doc.source),
|
|
162
172
|
floors: { units: patternsOf(doc, "floor-unit"), levels: patternsOf(doc, "floor-level") },
|
|
173
|
+
organizations: { units: patternsOf(doc, "organization-unit"), forms: patternList(doc, "company-form") },
|
|
163
174
|
};
|
|
164
175
|
const located: Located[] = doc.sentences.flatMap((sentence) => {
|
|
165
176
|
const quoted = quotedSpans(sentence.text);
|
|
166
|
-
const codes = {
|
|
177
|
+
const codes = {
|
|
178
|
+
calendar: calendarStarts(sentence, context.calendar),
|
|
179
|
+
clockTimes: clockTimeSpans(sentence.text),
|
|
180
|
+
addresses: addressSpans(sentence.text),
|
|
181
|
+
identifiers: identifierSpans(sentence.text),
|
|
182
|
+
};
|
|
167
183
|
return latinBoundaries(sentence.text, doc.source.slice(sentence.span.start, sentence.span.end))
|
|
168
184
|
.filter((boundary) => !isQuoted(quoted, boundary) && !isInsideLink(doc.links, sentence.span.start + boundary.offset))
|
|
169
185
|
.filter((boundary) => isCounted(sentence, boundary, context, codes))
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
|
+
import { periodLabelConflicts, type ReportingWords } from "../structure/period-label-conflict.ts";
|
|
3
|
+
import { compileFrames, type Era, type PeriodFrame } from "../structure/period-labels.ts";
|
|
4
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
5
|
+
|
|
6
|
+
const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
|
|
7
|
+
|
|
8
|
+
const framesOf = (doc: ProseDocument, lexicon: string, titleAlone: boolean): PeriodFrame[] =>
|
|
9
|
+
(doc.lexicons[lexicon] ?? []).flatMap((entry) =>
|
|
10
|
+
entry.group === undefined ? [] : [{ pattern: entry.pattern, kind: entry.group, insteadOf: entry.instead_of, titleAlone }],
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const erasOf = (doc: ProseDocument): Era[] =>
|
|
14
|
+
(doc.lexicons["calendar-era"] ?? []).flatMap((entry) => (entry.first_year === undefined ? [] : [{ name: entry.pattern, firstYear: entry.first_year }]));
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 期間の名前の書き方と種類(group)、業績の語、期間の行の語、比べる相手と見込みの語、今の期間の語とそれに似た別の語、名前に似た別の語は語彙表から取る。
|
|
18
|
+
* reporting-year-frame の書き方(令和8年分、Tax Year 2026)は業績の語の無い題からも読む。元号の年は calendar-era の元年で西暦にする。
|
|
19
|
+
*/
|
|
20
|
+
const wordsOf = (doc: ProseDocument): ReportingWords => ({
|
|
21
|
+
frames: compileFrames([...framesOf(doc, "reporting-period-frame", false), ...framesOf(doc, "reporting-year-frame", true)], erasOf(doc)),
|
|
22
|
+
results: patternsOf(doc, "reporting-results-word"),
|
|
23
|
+
periodLines: patternsOf(doc, "reporting-period-line"),
|
|
24
|
+
comparisons: patternsOf(doc, "reporting-comparison"),
|
|
25
|
+
forecasts: patternsOf(doc, "reporting-forecast"),
|
|
26
|
+
currents: patternsOf(doc, "reporting-current"),
|
|
27
|
+
notCurrents: patternsOf(doc, "reporting-current-not"),
|
|
28
|
+
notNames: patternsOf(doc, "reporting-period-not"),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** 題で言った決算の期間と同じ種類の別の期間を、今の業績を言う所に書いた所。 */
|
|
32
|
+
export const periodLabelConflict: Detector = (doc): Finding[] => {
|
|
33
|
+
const headings = (doc.markup?.headings ?? []).map((heading) => ({ start: heading.start, end: heading.end, text: heading.text }));
|
|
34
|
+
const sentences = doc.sentences.map((sentence) => sentence.span);
|
|
35
|
+
return periodLabelConflicts(doc.source, sentences, headings, wordsOf(doc)).map((issue) => ({
|
|
36
|
+
rule: "period-label-conflict",
|
|
37
|
+
severity: "warning",
|
|
38
|
+
line: 0,
|
|
39
|
+
column: 0,
|
|
40
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
41
|
+
values: { label: issue.label, stated: issue.stated, offset: issue.offset },
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// period-multiple-mismatch: an amount stated as a number of another period's amount (月払の12か月分, 12 monthly payments)
|
|
2
|
+
// that is not that many of it (structure/period-multiple.ts). The amounts are currency-notation's, read with
|
|
3
|
+
// amount-multiplier's words of scale; the base labels are period-multiple-label, the words period-multiple-word, the counts
|
|
4
|
+
// number-word (digit), and a range of counts is joined by range-connector or amount-range-word.
|
|
5
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
6
|
+
import { periodMultipleMismatches, type PeriodMultipleWords } from "../structure/period-multiple.ts";
|
|
7
|
+
import type { StatedAmount } from "../structure/stated-multiple.ts";
|
|
8
|
+
import { scaledAmountOf, scaleWordsOf } from "./amount-scale.ts";
|
|
9
|
+
import { amountsIn, formsOf } from "./currency-notation.ts";
|
|
10
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
11
|
+
import { quoteAround } from "./quote-around.ts";
|
|
12
|
+
|
|
13
|
+
const patternsOf = (doc: ProseDocument, lexicon: string, group?: string): string[] =>
|
|
14
|
+
(doc.lexicons[lexicon] ?? []).filter((entry) => group === undefined || entry.group === group).map((entry) => entry.pattern);
|
|
15
|
+
|
|
16
|
+
const numberWordsOf = (doc: ProseDocument): PeriodMultipleWords["numberWords"] =>
|
|
17
|
+
(doc.lexicons["number-word"] ?? []).flatMap((entry) =>
|
|
18
|
+
entry.group === "digit" && entry.weight !== undefined ? [{ word: entry.pattern, value: entry.weight }] : [],
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const wordsOf = (doc: ProseDocument): PeriodMultipleWords => ({
|
|
22
|
+
bases: patternsOf(doc, "period-multiple-label"),
|
|
23
|
+
times: patternsOf(doc, "period-multiple-word", "times"),
|
|
24
|
+
links: patternsOf(doc, "period-multiple-word", "link"),
|
|
25
|
+
skips: patternsOf(doc, "period-multiple-word", "skip"),
|
|
26
|
+
connectors: [...patternsOf(doc, "range-connector"), ...patternsOf(doc, "amount-range-word")],
|
|
27
|
+
numberWords: numberWordsOf(doc),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const amountsOf = (text: string, doc: ProseDocument): StatedAmount[] => {
|
|
31
|
+
const scales = scaleWordsOf(doc);
|
|
32
|
+
return amountsIn(
|
|
33
|
+
text,
|
|
34
|
+
formsOf(doc),
|
|
35
|
+
scales.map((scale) => scale.word),
|
|
36
|
+
).flatMap((amount) => {
|
|
37
|
+
const read = scaledAmountOf(text, amount, scales);
|
|
38
|
+
return read === undefined
|
|
39
|
+
? []
|
|
40
|
+
: [{ offset: read.offset, end: amount.offset + amount.written.length, currency: read.currency, value: read.value, scale: read.unit }];
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const periodMultipleMismatch: Detector = (doc): Finding[] => {
|
|
45
|
+
const text = proseAndTablesOf(doc);
|
|
46
|
+
return periodMultipleMismatches(text, amountsOf(text, doc), wordsOf(doc)).map((issue) => ({
|
|
47
|
+
rule: "period-multiple-mismatch",
|
|
48
|
+
severity: "warning",
|
|
49
|
+
line: 0,
|
|
50
|
+
column: 0,
|
|
51
|
+
quote: quoteAround(text, issue.offset),
|
|
52
|
+
values: { ...issue.values, offset: issue.offset },
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Detector, Finding, ProseDocument, StructureNode } from "../plugin.ts";
|
|
2
|
+
import { inDocumentOrder } from "../structure/issues.ts";
|
|
3
|
+
import { overlapsAny, spanIndex } from "../compare/spans.ts";
|
|
4
|
+
import type { DurationUnit } from "../derived/date-arithmetic.ts";
|
|
5
|
+
import { hyphenatedCounts } from "../derived/hyphenated-counts.ts";
|
|
6
|
+
import { periodPartIssues, tableRowsOf, type PeriodLength, type PeriodPartWords, type PlacedWord } from "../derived/period-parts.ts";
|
|
7
|
+
import { DURATION_LEXICONS, quantitiesOf } from "./derived-numbers.ts";
|
|
8
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
9
|
+
|
|
10
|
+
const patternsOf = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
|
|
11
|
+
|
|
12
|
+
const UNITS: readonly DurationUnit[] = ["day", "week", "month", "year"];
|
|
13
|
+
const isDurationUnit = (group: string | undefined): group is DurationUnit => UNITS.some((unit) => unit === group);
|
|
14
|
+
|
|
15
|
+
/** 期間の単位(か月、months)と、年数にもなる単位(「保証期間は1年」の 年。retention-unit の group が大きさ)。 */
|
|
16
|
+
const unitOf = (doc: ProseDocument, unit: string): DurationUnit | undefined => {
|
|
17
|
+
const folded = unit.normalize("NFKC").toLowerCase();
|
|
18
|
+
const listed = DURATION_LEXICONS.find(([id]) => patternsOf(doc, id).some((pattern) => pattern.normalize("NFKC").toLowerCase() === folded))?.[1];
|
|
19
|
+
const extra = (doc.lexicons["retention-unit"] ?? []).find((entry) => entry.pattern.normalize("NFKC") === folded)?.group;
|
|
20
|
+
return listed ?? (isDurationUnit(extra) ? extra : undefined);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const datesOf = (tree: StructureNode) => spanIndex(inDocumentOrder(tree).flatMap((node) => (node.kind === "date" ? [node.span] : [])));
|
|
24
|
+
|
|
25
|
+
/** 木の数量(12か月、2 years)と名詞の前の期間(a 12-month warranty)。日付の中の数(2026年)は読まない。 */
|
|
26
|
+
const lengthsOf = (doc: ProseDocument, tree: StructureNode): PeriodLength[] => {
|
|
27
|
+
const dates = datesOf(tree);
|
|
28
|
+
const hyphenated = hyphenatedCounts(
|
|
29
|
+
doc.source,
|
|
30
|
+
DURATION_LEXICONS.flatMap(([id]) => patternsOf(doc, id)),
|
|
31
|
+
);
|
|
32
|
+
return [...quantitiesOf(tree, doc.source), ...hyphenated]
|
|
33
|
+
.flatMap((quantity): PeriodLength[] => {
|
|
34
|
+
const unit = unitOf(doc, quantity.unit);
|
|
35
|
+
return unit === undefined || overlapsAny(dates, quantity) ? [] : [{ start: quantity.start, end: quantity.end, amount: quantity.amount, unit }];
|
|
36
|
+
})
|
|
37
|
+
.toSorted((left, right) => left.start - right.start);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const placed = (doc: ProseDocument, id: string): PlacedWord[] =>
|
|
41
|
+
(doc.lexicons[id] ?? []).map((entry) => ({ pattern: entry.pattern, position: entry.position ?? "before" }));
|
|
42
|
+
|
|
43
|
+
/** 印、期間の語、後に来る期間の語、長さを言う語、目安と幅の語は語彙表から取る。 */
|
|
44
|
+
const wordsOf = (doc: ProseDocument): PeriodPartWords => ({
|
|
45
|
+
markers: (doc.lexicons["period-part-marker"] ?? []).map((entry) => ({ pattern: entry.pattern, position: entry.position ?? "after", group: entry.group })),
|
|
46
|
+
periodWords: patternsOf(doc, "period-part-word"),
|
|
47
|
+
afterWords: patternsOf(doc, "period-part-after"),
|
|
48
|
+
lengthVerbs: patternsOf(doc, "period-part-length-verb"),
|
|
49
|
+
approximate: placed(doc, "approximate-marker"),
|
|
50
|
+
rangeJoiners: patternsOf(doc, "period-part-range"),
|
|
51
|
+
inlineJoiners: patternsOf(doc, "period-part-inline-joiner"),
|
|
52
|
+
unnamed: patternsOf(doc, "period-part-unnamed"),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const written = (doc: ProseDocument, span: { start: number; end: number }): string => doc.source.slice(span.start, span.end);
|
|
56
|
+
|
|
57
|
+
/** 期間の一部として書いた期間が、全体の期間より長い(保証期間(12か月)のうち、無料交換期間は18か月)。 */
|
|
58
|
+
export const periodPartExceedsWhole: Detector = (doc): Finding[] => {
|
|
59
|
+
if (doc.structure === undefined) return [];
|
|
60
|
+
const units = [...doc.sentences.map((sentence) => sentence.span), ...tableRowsOf(doc.source)].toSorted((left, right) => left.start - right.start);
|
|
61
|
+
const sectionStarts = (doc.markup?.headings ?? []).map((heading) => heading.start);
|
|
62
|
+
const input = { source: doc.source, units, sectionStarts, lengths: lengthsOf(doc, doc.structure), words: wordsOf(doc) };
|
|
63
|
+
return periodPartIssues(input).map(({ part, whole }) => ({
|
|
64
|
+
rule: "period-part-exceeds-whole",
|
|
65
|
+
severity: "warning",
|
|
66
|
+
line: 0,
|
|
67
|
+
column: 0,
|
|
68
|
+
quote: quoteAt(doc.source, part.start),
|
|
69
|
+
values: { part: written(doc, part), whole: written(doc, whole), offset: part.start },
|
|
70
|
+
}));
|
|
71
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProseDocument } from "../plugin.ts";
|
|
2
|
+
import { rangeFrameOf } from "../structure/date-range.ts";
|
|
3
|
+
import type { PeriodWords } from "../structure/stated-period.ts";
|
|
4
|
+
|
|
5
|
+
const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
|
|
6
|
+
|
|
7
|
+
/** The words that read a period on a labelled line: the range signs (range-connector, range-opener, range-frame's joint), month and weekday names. */
|
|
8
|
+
export const periodWordsOf = (doc: ProseDocument, labels: readonly string[]): PeriodWords => ({
|
|
9
|
+
labels,
|
|
10
|
+
connectors: [
|
|
11
|
+
...patternsOf(doc, "range-connector"),
|
|
12
|
+
...patternsOf(doc, "range-opener"),
|
|
13
|
+
...patternsOf(doc, "range-frame").flatMap((pattern) => rangeFrameOf(pattern)?.joint ?? []),
|
|
14
|
+
],
|
|
15
|
+
months: patternsOf(doc, "month-name"),
|
|
16
|
+
weekdays: patternsOf(doc, "weekday"),
|
|
17
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// ratio-mismatch: the reading half. Reads the tables (each row's label and cells) and the sentences (the words of lexicons
|
|
2
|
+
// ratio-label and ratio-term, and the structure tree's quantities in a currency or a percent unit) and leaves the deciding
|
|
3
|
+
// to structure/ratio.ts.
|
|
4
|
+
import type { Detector, Finding, ProseDocument, Span } from "../plugin.ts";
|
|
5
|
+
import { linesOf, type Line } from "../structure/lines.ts";
|
|
6
|
+
import { cellsOf, tablesOf } from "../facts/table-facts.ts";
|
|
7
|
+
import { withoutEdgeMarks } from "../facts/trim-marks.ts";
|
|
8
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
9
|
+
import { escapeRegExp } from "../orthography.ts";
|
|
10
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
11
|
+
import {
|
|
12
|
+
proseValues,
|
|
13
|
+
sentenceRatioMismatch,
|
|
14
|
+
tableRatioMismatches,
|
|
15
|
+
type AmountWords,
|
|
16
|
+
proseQuantitiesOf,
|
|
17
|
+
type LabelHit,
|
|
18
|
+
type RatioIssue,
|
|
19
|
+
type RatioWords,
|
|
20
|
+
type TableRow,
|
|
21
|
+
} from "../structure/ratio.ts";
|
|
22
|
+
|
|
23
|
+
const RULE = "ratio-mismatch";
|
|
24
|
+
const LATIN = /^[A-Za-z]/u;
|
|
25
|
+
/** A ratio label's group names the two terms it divides: "operating-profit/sales". */
|
|
26
|
+
const GROUP_SEPARATOR = "/";
|
|
27
|
+
|
|
28
|
+
const patternsOf = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
|
|
29
|
+
|
|
30
|
+
const wordsOf = (doc: ProseDocument): RatioWords => ({
|
|
31
|
+
labels: (doc.lexicons["ratio-label"] ?? []).flatMap((entry) => {
|
|
32
|
+
const [numerator, denominator, ...rest] = (entry.group ?? "").split(GROUP_SEPARATOR);
|
|
33
|
+
return numerator === undefined || denominator === undefined || rest.length > 0 ? [] : [{ pattern: entry.pattern, numerator, denominator }];
|
|
34
|
+
}),
|
|
35
|
+
terms: (doc.lexicons["ratio-term"] ?? []).flatMap((entry) => (entry.group === undefined ? [] : [{ pattern: entry.pattern, term: entry.group }])),
|
|
36
|
+
percentUnits: patternsOf(doc, "percent-unit"),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const currencyMarks = (doc: ProseDocument, position: "before" | "after"): string[] =>
|
|
40
|
+
(doc.lexicons["currency-notation"] ?? []).filter((entry) => entry.position === position).map((entry) => entry.pattern);
|
|
41
|
+
|
|
42
|
+
const amountWordsOf = (doc: ProseDocument, percentUnits: readonly string[]): AmountWords => ({
|
|
43
|
+
before: currencyMarks(doc, "before"),
|
|
44
|
+
after: currencyMarks(doc, "after"),
|
|
45
|
+
multipliers: patternsOf(doc, "amount-multiplier"),
|
|
46
|
+
percentUnits,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/** A table line read as its label (the first cell) and the cells after it, each without its edge marks. */
|
|
50
|
+
export const tableRowOf = (row: Line): TableRow[] => {
|
|
51
|
+
const [first, ...rest] = cellsOf(row);
|
|
52
|
+
if (first === undefined) return [];
|
|
53
|
+
const cells = rest.map((cell) => {
|
|
54
|
+
const text = withoutEdgeMarks(cell.text);
|
|
55
|
+
return { start: cell.start + Math.max(0, cell.text.indexOf(text)), text };
|
|
56
|
+
});
|
|
57
|
+
return [{ label: withoutEdgeMarks(first.text), cells }];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const tableRowsOf = (source: string): TableRow[][] => tablesOf(linesOf(source)).map((table) => table.rows.flatMap(tableRowOf));
|
|
61
|
+
|
|
62
|
+
/** A kanji or katakana next to a word written in them makes it part of a longer word (営業利益率 in 調整後営業利益率). */
|
|
63
|
+
const CJK_LETTER = /[\p{sc=Han}\p{sc=Katakana}ー]/u;
|
|
64
|
+
|
|
65
|
+
/** Where a word stands in the text: a Latin word as a whole word in any case, any other word not inside a longer one. */
|
|
66
|
+
const spansOf = (text: string, offset: number, word: string): Span[] => {
|
|
67
|
+
const latin = LATIN.test(word);
|
|
68
|
+
const pattern = latin ? new RegExp(`\\b${escapeRegExp(word)}\\b`, "giu") : new RegExp(escapeRegExp(word), "gu");
|
|
69
|
+
return [...text.matchAll(pattern)]
|
|
70
|
+
.filter((match) => latin || !(CJK_LETTER.test(text.charAt(match.index - 1)) || CJK_LETTER.test(text.charAt(match.index + match[0].length))))
|
|
71
|
+
.map((match) => ({ start: offset + match.index, end: offset + match.index + match[0].length }));
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** A word inside a longer one is not a word of its own (営業利益 in 営業利益率, sales in net sales). */
|
|
75
|
+
const longestHits = (hits: readonly LabelHit[]): LabelHit[] =>
|
|
76
|
+
hits.filter(
|
|
77
|
+
(hit) => !hits.some((other) => other !== hit && other.start <= hit.start && hit.end <= other.end && other.end - other.start > hit.end - hit.start),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const hitsIn = (text: string, offset: number, words: RatioWords): LabelHit[] => {
|
|
81
|
+
const labels = words.labels.flatMap((label) => spansOf(text, offset, label.pattern).map((at) => ({ ...at, label })));
|
|
82
|
+
const terms = words.terms.flatMap((term) => spansOf(text, offset, term.pattern).map((at) => ({ ...at, term: term.term })));
|
|
83
|
+
return longestHits([...labels, ...terms]);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const proseIssues = (doc: ProseDocument, words: RatioWords): RatioIssue[] => {
|
|
87
|
+
const named = doc.sentences.flatMap((sentence) => {
|
|
88
|
+
const text = doc.source.slice(sentence.span.start, sentence.span.end);
|
|
89
|
+
const hits = hitsIn(text, sentence.span.start, words);
|
|
90
|
+
return hits.some((hit) => "label" in hit) ? [{ span: sentence.span, text, hits }] : [];
|
|
91
|
+
});
|
|
92
|
+
if (named.length === 0) return [];
|
|
93
|
+
const amountWords = amountWordsOf(doc, words.percentUnits);
|
|
94
|
+
const quantities = proseQuantitiesOf(doc.structure);
|
|
95
|
+
return named.flatMap(({ span, text, hits }) => {
|
|
96
|
+
const issue = sentenceRatioMismatch({ hits, end: span.end, ...proseValues(text, span.start, quantities, amountWords) });
|
|
97
|
+
return issue === undefined ? [] : [issue];
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const ratioMismatch: Detector = (doc): Finding[] => {
|
|
102
|
+
const words = wordsOf(doc);
|
|
103
|
+
if (words.labels.length === 0) return [];
|
|
104
|
+
const tables = tableRowsOf(proseAndTablesOf(doc)).flatMap((rows) => tableRatioMismatches(rows, words));
|
|
105
|
+
const prose = proseIssues(doc, words).filter((issue) => !tables.some((table) => table.offset === issue.offset));
|
|
106
|
+
return [...tables, ...prose]
|
|
107
|
+
.toSorted((left, right) => left.offset - right.offset)
|
|
108
|
+
.map((issue) => ({
|
|
109
|
+
rule: RULE,
|
|
110
|
+
severity: "warning",
|
|
111
|
+
line: 0,
|
|
112
|
+
column: 0,
|
|
113
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
114
|
+
values: { ...issue.values, offset: issue.offset },
|
|
115
|
+
}));
|
|
116
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ProseDocument } from "../plugin.ts";
|
|
2
|
+
import { dayOrderOf, readableDate, type DateWords } from "../derived/readable-date.ts";
|
|
3
|
+
import { inDocumentOrder } from "../structure/issues.ts";
|
|
4
|
+
|
|
5
|
+
const MONTHS_IN_YEAR = 12;
|
|
6
|
+
|
|
7
|
+
const wordsOf = (doc: ProseDocument): DateWords => {
|
|
8
|
+
const monthWords = (doc.lexicons["month-name"] ?? []).map((entry) => entry.pattern);
|
|
9
|
+
const written =
|
|
10
|
+
doc.structure === undefined
|
|
11
|
+
? []
|
|
12
|
+
: inDocumentOrder(doc.structure).flatMap((node) => (node.kind === "date" ? [doc.source.slice(node.span.start, node.span.end)] : []));
|
|
13
|
+
return { language: doc.language, months: monthWords.slice(0, MONTHS_IN_YEAR), order: dayOrderOf(written, monthWords) };
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const wordsByDocument = new WeakMap<ProseDocument, DateWords>();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A date value (2026-06-30) as a message writes it, in the document's language and its own day order. The month names are
|
|
20
|
+
* the language's month-name lexicon (January first). The document is read once, on the first date a message needs.
|
|
21
|
+
*/
|
|
22
|
+
export const readableDates =
|
|
23
|
+
(doc: ProseDocument) =>
|
|
24
|
+
(value: string): string => {
|
|
25
|
+
const words = wordsByDocument.get(doc) ?? wordsOf(doc);
|
|
26
|
+
wordsByDocument.set(doc, words);
|
|
27
|
+
return readableDate(value, words);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** The named values written as readable dates; the other values as they are. */
|
|
31
|
+
export const withReadableDates = (
|
|
32
|
+
values: Readonly<Record<string, string | number>>,
|
|
33
|
+
keys: readonly string[],
|
|
34
|
+
readable: (value: string) => string,
|
|
35
|
+
): Record<string, string | number> =>
|
|
36
|
+
Object.fromEntries(Object.entries(values).map(([key, value]) => [key, keys.includes(key) && typeof value === "string" ? readable(value) : value]));
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// reference-flag-mismatch: the reading half (structure/reference-flags.ts). The column headings are lab-result-column's and
|
|
2
|
+
// reference-column-heading's, the flags reference-flag's, and a range is read with range-band-word and reference-bound-mark.
|
|
3
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
4
|
+
import { referenceFlagSlips, type FlagMeaning, type ReferenceWords } from "../structure/reference-flags.ts";
|
|
5
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
6
|
+
import { labColumnWordsOf } from "./lab-columns.ts";
|
|
7
|
+
import { bandWordsOf } from "./range-band.ts";
|
|
8
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
9
|
+
|
|
10
|
+
const isMeaning = (group: string | undefined): group is FlagMeaning => group === "high" || group === "low" || group === "normal" || group === "outside";
|
|
11
|
+
|
|
12
|
+
const wordsOf = (doc: ProseDocument): ReferenceWords => {
|
|
13
|
+
const boundWords = [...(doc.lexicons["range-band-word"] ?? []), ...(doc.lexicons["reference-bound-mark"] ?? [])];
|
|
14
|
+
const band = bandWordsOf({ ...doc.lexicons, "range-band-word": boundWords });
|
|
15
|
+
return {
|
|
16
|
+
headings: labColumnWordsOf(doc, "reference-column-heading"),
|
|
17
|
+
flags: (doc.lexicons["reference-flag"] ?? []).flatMap((entry) => (isMeaning(entry.group) ? [{ pattern: entry.pattern, meaning: entry.group }] : [])),
|
|
18
|
+
band: { ...band, units: [], headings: [] },
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const referenceFlag: Detector = (doc): Finding[] => {
|
|
23
|
+
const text = proseAndTablesOf(doc);
|
|
24
|
+
return referenceFlagSlips(text, wordsOf(doc)).map((slip) => {
|
|
25
|
+
const offset = slip.flag.start + (slip.flag.text.length - slip.flag.text.trimStart().length);
|
|
26
|
+
return {
|
|
27
|
+
rule: "reference-flag-mismatch",
|
|
28
|
+
severity: "warning",
|
|
29
|
+
line: 0,
|
|
30
|
+
column: 0,
|
|
31
|
+
quote: quoteAt(text, offset),
|
|
32
|
+
...(slip.kind === "inside" ? {} : { variant: slip.kind }),
|
|
33
|
+
values: { item: slip.item, value: slip.value, range: slip.range, flag: slip.flag.text.trim(), offset },
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
};
|