chaffjs 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +330 -0
- package/README.md +124 -255
- package/dist/cli-text.js +2 -2
- package/dist/company-kana-spelling.d.ts +31 -0
- package/dist/company-kana-spelling.d.ts.map +1 -0
- package/dist/company-kana-spelling.js +79 -0
- package/dist/company-kana-spelling.js.map +1 -0
- package/dist/company-names.d.ts +32 -1
- package/dist/company-names.d.ts.map +1 -1
- package/dist/company-names.js +129 -22
- package/dist/company-names.js.map +1 -1
- package/dist/contacts/table-rows.d.ts +7 -0
- package/dist/contacts/table-rows.d.ts.map +1 -0
- package/dist/contacts/table-rows.js +42 -0
- package/dist/contacts/table-rows.js.map +1 -0
- package/dist/cross-run.d.ts.map +1 -1
- package/dist/cross-run.js +1 -0
- package/dist/cross-run.js.map +1 -1
- package/dist/derived/age-on-date.d.ts +53 -0
- package/dist/derived/age-on-date.d.ts.map +1 -0
- package/dist/derived/age-on-date.js +114 -0
- package/dist/derived/age-on-date.js.map +1 -0
- package/dist/derived/durations.d.ts +17 -2
- package/dist/derived/durations.d.ts.map +1 -1
- package/dist/derived/durations.js +61 -10
- package/dist/derived/durations.js.map +1 -1
- package/dist/derived/hours-and-minutes.d.ts +26 -0
- package/dist/derived/hours-and-minutes.d.ts.map +1 -0
- package/dist/derived/hours-and-minutes.js +24 -0
- package/dist/derived/hours-and-minutes.js.map +1 -0
- package/dist/derived/hyphenated-counts.d.ts +15 -0
- package/dist/derived/hyphenated-counts.d.ts.map +1 -0
- package/dist/derived/hyphenated-counts.js +31 -0
- package/dist/derived/hyphenated-counts.js.map +1 -0
- package/dist/derived/marked-dates.d.ts +15 -0
- package/dist/derived/marked-dates.d.ts.map +1 -0
- package/dist/derived/marked-dates.js +41 -0
- package/dist/derived/marked-dates.js.map +1 -0
- package/dist/derived/money-span.d.ts +9 -0
- package/dist/derived/money-span.d.ts.map +1 -0
- package/dist/derived/money-span.js +6 -0
- package/dist/derived/money-span.js.map +1 -0
- package/dist/derived/period-parts.d.ts +55 -0
- package/dist/derived/period-parts.d.ts.map +1 -0
- package/dist/derived/period-parts.js +283 -0
- package/dist/derived/period-parts.js.map +1 -0
- package/dist/derived/readable-date.d.ts +20 -0
- package/dist/derived/readable-date.d.ts.map +1 -0
- package/dist/derived/readable-date.js +50 -0
- package/dist/derived/readable-date.js.map +1 -0
- package/dist/derived/stays.d.ts +3 -1
- package/dist/derived/stays.d.ts.map +1 -1
- package/dist/derived/stays.js +3 -0
- package/dist/derived/stays.js.map +1 -1
- package/dist/derived/timesheet-hours.d.ts +27 -0
- package/dist/derived/timesheet-hours.d.ts.map +1 -0
- package/dist/derived/timesheet-hours.js +86 -0
- package/dist/derived/timesheet-hours.js.map +1 -0
- package/dist/derived/use-maximum.d.ts +27 -0
- package/dist/derived/use-maximum.d.ts.map +1 -0
- package/dist/derived/use-maximum.js +104 -0
- package/dist/derived/use-maximum.js.map +1 -0
- package/dist/derived/working-hours.d.ts +4 -5
- package/dist/derived/working-hours.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.js +4 -0
- package/dist/detectors/agreement-slip.js.map +1 -1
- package/dist/detectors/annual-holidays-mismatch.d.ts +3 -0
- package/dist/detectors/annual-holidays-mismatch.d.ts.map +1 -0
- package/dist/detectors/annual-holidays-mismatch.js +29 -0
- package/dist/detectors/annual-holidays-mismatch.js.map +1 -0
- package/dist/detectors/annual-pay-mismatch.d.ts +3 -0
- package/dist/detectors/annual-pay-mismatch.d.ts.map +1 -0
- package/dist/detectors/annual-pay-mismatch.js +52 -0
- package/dist/detectors/annual-pay-mismatch.js.map +1 -0
- package/dist/detectors/blank-structure.d.ts +3 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +45 -12
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/bmi-mismatch.d.ts +3 -0
- package/dist/detectors/bmi-mismatch.d.ts.map +1 -0
- package/dist/detectors/bmi-mismatch.js +70 -0
- package/dist/detectors/bmi-mismatch.js.map +1 -0
- package/dist/detectors/change-rate.d.ts.map +1 -1
- package/dist/detectors/change-rate.js +24 -9
- package/dist/detectors/change-rate.js.map +1 -1
- package/dist/detectors/closing-balance-mismatch.d.ts +3 -0
- package/dist/detectors/closing-balance-mismatch.d.ts.map +1 -0
- package/dist/detectors/closing-balance-mismatch.js +42 -0
- package/dist/detectors/closing-balance-mismatch.js.map +1 -0
- package/dist/detectors/contact-variant.d.ts.map +1 -1
- package/dist/detectors/contact-variant.js +6 -2
- package/dist/detectors/contact-variant.js.map +1 -1
- package/dist/detectors/cumulative-below-current.d.ts +3 -0
- package/dist/detectors/cumulative-below-current.d.ts.map +1 -0
- package/dist/detectors/cumulative-below-current.js +25 -0
- package/dist/detectors/cumulative-below-current.js.map +1 -0
- package/dist/detectors/currency-column.d.ts +3 -0
- package/dist/detectors/currency-column.d.ts.map +1 -0
- package/dist/detectors/currency-column.js +32 -0
- package/dist/detectors/currency-column.js.map +1 -0
- package/dist/detectors/date-any-year.d.ts +24 -0
- package/dist/detectors/date-any-year.d.ts.map +1 -0
- package/dist/detectors/date-any-year.js +103 -0
- package/dist/detectors/date-any-year.js.map +1 -0
- package/dist/detectors/date-outside-period.d.ts.map +1 -1
- package/dist/detectors/date-outside-period.js +4 -10
- package/dist/detectors/date-outside-period.js.map +1 -1
- package/dist/detectors/date-stamp-order.d.ts.map +1 -1
- package/dist/detectors/date-stamp-order.js +2 -1
- package/dist/detectors/date-stamp-order.js.map +1 -1
- package/dist/detectors/date-year.d.ts +18 -6
- package/dist/detectors/date-year.d.ts.map +1 -1
- package/dist/detectors/date-year.js +39 -11
- package/dist/detectors/date-year.js.map +1 -1
- package/dist/detectors/deductible-exceeds-limit.d.ts +4 -0
- package/dist/detectors/deductible-exceeds-limit.d.ts.map +1 -0
- package/dist/detectors/deductible-exceeds-limit.js +46 -0
- package/dist/detectors/deductible-exceeds-limit.js.map +1 -0
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +6 -20
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/derived-numbers.d.ts +4 -3
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +43 -70
- package/dist/detectors/derived-numbers.js.map +1 -1
- package/dist/detectors/discount-rate.d.ts +3 -0
- package/dist/detectors/discount-rate.d.ts.map +1 -0
- package/dist/detectors/discount-rate.js +35 -0
- package/dist/detectors/discount-rate.js.map +1 -0
- package/dist/detectors/due-date.d.ts.map +1 -1
- package/dist/detectors/due-date.js +11 -4
- package/dist/detectors/due-date.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +10 -2
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +24 -5
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/event-deadline.d.ts.map +1 -1
- package/dist/detectors/event-deadline.js +11 -2
- package/dist/detectors/event-deadline.js.map +1 -1
- package/dist/detectors/fact-consistency.d.ts.map +1 -1
- package/dist/detectors/fact-consistency.js +112 -5
- package/dist/detectors/fact-consistency.js.map +1 -1
- package/dist/detectors/formula-amount.d.ts +3 -0
- package/dist/detectors/formula-amount.d.ts.map +1 -0
- package/dist/detectors/formula-amount.js +41 -0
- package/dist/detectors/formula-amount.js.map +1 -0
- package/dist/detectors/gloss-year.d.ts +11 -0
- package/dist/detectors/gloss-year.d.ts.map +1 -0
- package/dist/detectors/gloss-year.js +14 -0
- package/dist/detectors/gloss-year.js.map +1 -0
- package/dist/detectors/gpa-mismatch.d.ts +3 -0
- package/dist/detectors/gpa-mismatch.d.ts.map +1 -0
- package/dist/detectors/gpa-mismatch.js +39 -0
- package/dist/detectors/gpa-mismatch.js.map +1 -0
- package/dist/detectors/impossible-date.d.ts.map +1 -1
- package/dist/detectors/impossible-date.js +22 -6
- package/dist/detectors/impossible-date.js.map +1 -1
- package/dist/detectors/installment-total-mismatch.d.ts +3 -0
- package/dist/detectors/installment-total-mismatch.d.ts.map +1 -0
- package/dist/detectors/installment-total-mismatch.js +68 -0
- package/dist/detectors/installment-total-mismatch.js.map +1 -0
- package/dist/detectors/interest.d.ts +3 -0
- package/dist/detectors/interest.d.ts.map +1 -0
- package/dist/detectors/interest.js +38 -0
- package/dist/detectors/interest.js.map +1 -0
- package/dist/detectors/lab-columns.d.ts +4 -0
- package/dist/detectors/lab-columns.d.ts.map +1 -0
- package/dist/detectors/lab-columns.js +3 -0
- package/dist/detectors/lab-columns.js.map +1 -0
- package/dist/detectors/labelled-age.d.ts +4 -0
- package/dist/detectors/labelled-age.d.ts.map +1 -0
- package/dist/detectors/labelled-age.js +110 -0
- package/dist/detectors/labelled-age.js.map +1 -0
- package/dist/detectors/line-amount.d.ts.map +1 -1
- package/dist/detectors/line-amount.js +45 -2
- package/dist/detectors/line-amount.js.map +1 -1
- package/dist/detectors/measured-facts.d.ts +1 -1
- package/dist/detectors/measured-facts.d.ts.map +1 -1
- package/dist/detectors/measured-facts.js.map +1 -1
- package/dist/detectors/meter-usage.d.ts +3 -0
- package/dist/detectors/meter-usage.d.ts.map +1 -0
- package/dist/detectors/meter-usage.js +37 -0
- package/dist/detectors/meter-usage.js.map +1 -0
- package/dist/detectors/name-field.d.ts +13 -0
- package/dist/detectors/name-field.d.ts.map +1 -0
- package/dist/detectors/name-field.js +38 -0
- package/dist/detectors/name-field.js.map +1 -0
- package/dist/detectors/name-variant.d.ts.map +1 -1
- package/dist/detectors/name-variant.js +128 -14
- package/dist/detectors/name-variant.js.map +1 -1
- package/dist/detectors/net-amount-mismatch.d.ts +10 -0
- package/dist/detectors/net-amount-mismatch.d.ts.map +1 -0
- package/dist/detectors/net-amount-mismatch.js +70 -0
- package/dist/detectors/net-amount-mismatch.js.map +1 -0
- package/dist/detectors/net-gross-weight.d.ts +3 -0
- package/dist/detectors/net-gross-weight.d.ts.map +1 -0
- package/dist/detectors/net-gross-weight.js +35 -0
- package/dist/detectors/net-gross-weight.js.map +1 -0
- package/dist/detectors/nominal-step.d.ts +3 -0
- package/dist/detectors/nominal-step.d.ts.map +1 -0
- package/dist/detectors/nominal-step.js +28 -0
- package/dist/detectors/nominal-step.js.map +1 -0
- package/dist/detectors/number-style.d.ts +2 -0
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +8 -2
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/order-quantity.d.ts +10 -0
- package/dist/detectors/order-quantity.d.ts.map +1 -0
- package/dist/detectors/order-quantity.js +35 -0
- package/dist/detectors/order-quantity.js.map +1 -0
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +37 -11
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +15 -7
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/period-label-conflict.d.ts +4 -0
- package/dist/detectors/period-label-conflict.d.ts.map +1 -0
- package/dist/detectors/period-label-conflict.js +34 -0
- package/dist/detectors/period-label-conflict.js.map +1 -0
- package/dist/detectors/period-multiple-mismatch.d.ts +3 -0
- package/dist/detectors/period-multiple-mismatch.d.ts.map +1 -0
- package/dist/detectors/period-multiple-mismatch.js +36 -0
- package/dist/detectors/period-multiple-mismatch.js.map +1 -0
- package/dist/detectors/period-part.d.ts +4 -0
- package/dist/detectors/period-part.d.ts.map +1 -0
- package/dist/detectors/period-part.js +58 -0
- package/dist/detectors/period-part.js.map +1 -0
- package/dist/detectors/range-words.d.ts +5 -0
- package/dist/detectors/range-words.d.ts.map +1 -0
- package/dist/detectors/range-words.js +14 -0
- package/dist/detectors/range-words.js.map +1 -0
- package/dist/detectors/ratio-mismatch.d.ts +7 -0
- package/dist/detectors/ratio-mismatch.d.ts.map +1 -0
- package/dist/detectors/ratio-mismatch.js +89 -0
- package/dist/detectors/ratio-mismatch.js.map +1 -0
- package/dist/detectors/readable-dates.d.ts +9 -0
- package/dist/detectors/readable-dates.d.ts.map +1 -0
- package/dist/detectors/readable-dates.js +23 -0
- package/dist/detectors/readable-dates.js.map +1 -0
- package/dist/detectors/reference-flag.d.ts +3 -0
- package/dist/detectors/reference-flag.d.ts.map +1 -0
- package/dist/detectors/reference-flag.js +31 -0
- package/dist/detectors/reference-flag.js.map +1 -0
- package/dist/detectors/reference-number-repeated.d.ts +3 -0
- package/dist/detectors/reference-number-repeated.d.ts.map +1 -0
- package/dist/detectors/reference-number-repeated.js +22 -0
- package/dist/detectors/reference-number-repeated.js.map +1 -0
- package/dist/detectors/reference-number-variant.d.ts +3 -0
- package/dist/detectors/reference-number-variant.d.ts.map +1 -0
- package/dist/detectors/reference-number-variant.js +40 -0
- package/dist/detectors/reference-number-variant.js.map +1 -0
- package/dist/detectors/reference-unit.d.ts +3 -0
- package/dist/detectors/reference-unit.d.ts.map +1 -0
- package/dist/detectors/reference-unit.js +19 -0
- package/dist/detectors/reference-unit.js.map +1 -0
- package/dist/detectors/registry/annual-holidays-mismatch.d.ts +3 -0
- package/dist/detectors/registry/annual-holidays-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/annual-holidays-mismatch.js +3 -0
- package/dist/detectors/registry/annual-holidays-mismatch.js.map +1 -0
- package/dist/detectors/registry/annual-pay-mismatch.d.ts +3 -0
- package/dist/detectors/registry/annual-pay-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/annual-pay-mismatch.js +3 -0
- package/dist/detectors/registry/annual-pay-mismatch.js.map +1 -0
- package/dist/detectors/registry/backorder-mismatch.d.ts +3 -0
- package/dist/detectors/registry/backorder-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/backorder-mismatch.js +3 -0
- package/dist/detectors/registry/backorder-mismatch.js.map +1 -0
- package/dist/detectors/registry/bmi-mismatch.d.ts +3 -0
- package/dist/detectors/registry/bmi-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/bmi-mismatch.js +3 -0
- package/dist/detectors/registry/bmi-mismatch.js.map +1 -0
- package/dist/detectors/registry/closing-balance-mismatch.d.ts +3 -0
- package/dist/detectors/registry/closing-balance-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/closing-balance-mismatch.js +3 -0
- package/dist/detectors/registry/closing-balance-mismatch.js.map +1 -0
- package/dist/detectors/registry/cumulative-below-current.d.ts +3 -0
- package/dist/detectors/registry/cumulative-below-current.d.ts.map +1 -0
- package/dist/detectors/registry/cumulative-below-current.js +3 -0
- package/dist/detectors/registry/cumulative-below-current.js.map +1 -0
- package/dist/detectors/registry/currency-column-mix.d.ts +3 -0
- package/dist/detectors/registry/currency-column-mix.d.ts.map +1 -0
- package/dist/detectors/registry/currency-column-mix.js +3 -0
- package/dist/detectors/registry/currency-column-mix.js.map +1 -0
- package/dist/detectors/registry/deductible-exceeds-limit.d.ts +3 -0
- package/dist/detectors/registry/deductible-exceeds-limit.d.ts.map +1 -0
- package/dist/detectors/registry/deductible-exceeds-limit.js +3 -0
- package/dist/detectors/registry/deductible-exceeds-limit.js.map +1 -0
- package/dist/detectors/registry/delivered-over-ordered.d.ts +3 -0
- package/dist/detectors/registry/delivered-over-ordered.d.ts.map +1 -0
- package/dist/detectors/registry/delivered-over-ordered.js +3 -0
- package/dist/detectors/registry/delivered-over-ordered.js.map +1 -0
- package/dist/detectors/registry/discount-rate.d.ts +3 -0
- package/dist/detectors/registry/discount-rate.d.ts.map +1 -0
- package/dist/detectors/registry/discount-rate.js +3 -0
- package/dist/detectors/registry/discount-rate.js.map +1 -0
- package/dist/detectors/registry/elapsed-years-mismatch.js +1 -1
- package/dist/detectors/registry/elapsed-years-mismatch.js.map +1 -1
- package/dist/detectors/registry/formula-amount.d.ts +3 -0
- package/dist/detectors/registry/formula-amount.d.ts.map +1 -0
- package/dist/detectors/registry/formula-amount.js +3 -0
- package/dist/detectors/registry/formula-amount.js.map +1 -0
- package/dist/detectors/registry/gpa-mismatch.d.ts +3 -0
- package/dist/detectors/registry/gpa-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/gpa-mismatch.js +3 -0
- package/dist/detectors/registry/gpa-mismatch.js.map +1 -0
- package/dist/detectors/registry/installment-total-mismatch.d.ts +3 -0
- package/dist/detectors/registry/installment-total-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/installment-total-mismatch.js +3 -0
- package/dist/detectors/registry/installment-total-mismatch.js.map +1 -0
- package/dist/detectors/registry/interest.d.ts +3 -0
- package/dist/detectors/registry/interest.d.ts.map +1 -0
- package/dist/detectors/registry/interest.js +3 -0
- package/dist/detectors/registry/interest.js.map +1 -0
- package/dist/detectors/registry/meter-usage.d.ts +3 -0
- package/dist/detectors/registry/meter-usage.d.ts.map +1 -0
- package/dist/detectors/registry/meter-usage.js +3 -0
- package/dist/detectors/registry/meter-usage.js.map +1 -0
- package/dist/detectors/registry/net-amount-mismatch.d.ts +3 -0
- package/dist/detectors/registry/net-amount-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/net-amount-mismatch.js +3 -0
- package/dist/detectors/registry/net-amount-mismatch.js.map +1 -0
- package/dist/detectors/registry/net-over-gross.d.ts +3 -0
- package/dist/detectors/registry/net-over-gross.d.ts.map +1 -0
- package/dist/detectors/registry/net-over-gross.js +3 -0
- package/dist/detectors/registry/net-over-gross.js.map +1 -0
- package/dist/detectors/registry/period-label-conflict.d.ts +3 -0
- package/dist/detectors/registry/period-label-conflict.d.ts.map +1 -0
- package/dist/detectors/registry/period-label-conflict.js +3 -0
- package/dist/detectors/registry/period-label-conflict.js.map +1 -0
- package/dist/detectors/registry/period-multiple-mismatch.d.ts +3 -0
- package/dist/detectors/registry/period-multiple-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/period-multiple-mismatch.js +3 -0
- package/dist/detectors/registry/period-multiple-mismatch.js.map +1 -0
- package/dist/detectors/registry/period-part-exceeds-whole.d.ts +3 -0
- package/dist/detectors/registry/period-part-exceeds-whole.d.ts.map +1 -0
- package/dist/detectors/registry/period-part-exceeds-whole.js +3 -0
- package/dist/detectors/registry/period-part-exceeds-whole.js.map +1 -0
- package/dist/detectors/registry/product-exceeds-maximum.d.ts +3 -0
- package/dist/detectors/registry/product-exceeds-maximum.d.ts.map +1 -0
- package/dist/detectors/registry/product-exceeds-maximum.js +3 -0
- package/dist/detectors/registry/product-exceeds-maximum.js.map +1 -0
- package/dist/detectors/registry/ratio-mismatch.d.ts +3 -0
- package/dist/detectors/registry/ratio-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/ratio-mismatch.js +3 -0
- package/dist/detectors/registry/ratio-mismatch.js.map +1 -0
- package/dist/detectors/registry/reference-flag-mismatch.d.ts +3 -0
- package/dist/detectors/registry/reference-flag-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/reference-flag-mismatch.js +3 -0
- package/dist/detectors/registry/reference-flag-mismatch.js.map +1 -0
- package/dist/detectors/registry/reference-number-repeated.d.ts +3 -0
- package/dist/detectors/registry/reference-number-repeated.d.ts.map +1 -0
- package/dist/detectors/registry/reference-number-repeated.js +3 -0
- package/dist/detectors/registry/reference-number-repeated.js.map +1 -0
- package/dist/detectors/registry/reference-number-variant.d.ts +3 -0
- package/dist/detectors/registry/reference-number-variant.d.ts.map +1 -0
- package/dist/detectors/registry/reference-number-variant.js +3 -0
- package/dist/detectors/registry/reference-number-variant.js.map +1 -0
- package/dist/detectors/registry/reference-unit.d.ts +3 -0
- package/dist/detectors/registry/reference-unit.d.ts.map +1 -0
- package/dist/detectors/registry/reference-unit.js +3 -0
- package/dist/detectors/registry/reference-unit.js.map +1 -0
- package/dist/detectors/registry/revision-direction.d.ts +3 -0
- package/dist/detectors/registry/revision-direction.d.ts.map +1 -0
- package/dist/detectors/registry/revision-direction.js +3 -0
- package/dist/detectors/registry/revision-direction.js.map +1 -0
- package/dist/detectors/registry/running-balance.d.ts +3 -0
- package/dist/detectors/registry/running-balance.d.ts.map +1 -0
- package/dist/detectors/registry/running-balance.js +3 -0
- package/dist/detectors/registry/running-balance.js.map +1 -0
- package/dist/detectors/registry/serial-range.d.ts +3 -0
- package/dist/detectors/registry/serial-range.d.ts.map +1 -0
- package/dist/detectors/registry/serial-range.js +3 -0
- package/dist/detectors/registry/serial-range.js.map +1 -0
- package/dist/detectors/registry/share-amount.d.ts +3 -0
- package/dist/detectors/registry/share-amount.d.ts.map +1 -0
- package/dist/detectors/registry/share-amount.js +3 -0
- package/dist/detectors/registry/share-amount.js.map +1 -0
- package/dist/detectors/registry/table-unit-mix.d.ts +3 -0
- package/dist/detectors/registry/table-unit-mix.d.ts.map +1 -0
- package/dist/detectors/registry/table-unit-mix.js +3 -0
- package/dist/detectors/registry/table-unit-mix.js.map +1 -0
- package/dist/detectors/registry/tier-threshold.d.ts +3 -0
- package/dist/detectors/registry/tier-threshold.d.ts.map +1 -0
- package/dist/detectors/registry/tier-threshold.js +3 -0
- package/dist/detectors/registry/tier-threshold.js.map +1 -0
- package/dist/detectors/registry/variance-mismatch.d.ts +3 -0
- package/dist/detectors/registry/variance-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/variance-mismatch.js +3 -0
- package/dist/detectors/registry/variance-mismatch.js.map +1 -0
- package/dist/detectors/relative-dates.d.ts.map +1 -1
- package/dist/detectors/relative-dates.js +2 -1
- package/dist/detectors/relative-dates.js.map +1 -1
- package/dist/detectors/relative-day-words.d.ts.map +1 -1
- package/dist/detectors/relative-day-words.js +2 -1
- package/dist/detectors/relative-day-words.js.map +1 -1
- package/dist/detectors/rent-multiple-mismatch.d.ts.map +1 -1
- package/dist/detectors/rent-multiple-mismatch.js.map +1 -1
- package/dist/detectors/request-owner.d.ts +3 -1
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +5 -2
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/revision-direction.d.ts +3 -0
- package/dist/detectors/revision-direction.d.ts.map +1 -0
- package/dist/detectors/revision-direction.js +32 -0
- package/dist/detectors/revision-direction.js.map +1 -0
- package/dist/detectors/row-sentence-amounts.d.ts +5 -0
- package/dist/detectors/row-sentence-amounts.d.ts.map +1 -0
- package/dist/detectors/row-sentence-amounts.js +71 -0
- package/dist/detectors/row-sentence-amounts.js.map +1 -0
- package/dist/detectors/running-balance.d.ts +3 -0
- package/dist/detectors/running-balance.d.ts.map +1 -0
- package/dist/detectors/running-balance.js +26 -0
- package/dist/detectors/running-balance.js.map +1 -0
- package/dist/detectors/scaled-quantity.js +1 -1
- package/dist/detectors/scaled-quantity.js.map +1 -1
- package/dist/detectors/serial-range.d.ts +3 -0
- package/dist/detectors/serial-range.d.ts.map +1 -0
- package/dist/detectors/serial-range.js +29 -0
- package/dist/detectors/serial-range.js.map +1 -0
- package/dist/detectors/share-amount.d.ts +3 -0
- package/dist/detectors/share-amount.d.ts.map +1 -0
- package/dist/detectors/share-amount.js +45 -0
- package/dist/detectors/share-amount.js.map +1 -0
- package/dist/detectors/structure-tree.d.ts +1 -1
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +46 -12
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/table-scale.d.ts +3 -0
- package/dist/detectors/table-scale.d.ts.map +1 -0
- package/dist/detectors/table-scale.js +32 -0
- package/dist/detectors/table-scale.js.map +1 -0
- package/dist/detectors/tax-amount.d.ts.map +1 -1
- package/dist/detectors/tax-amount.js +34 -10
- package/dist/detectors/tax-amount.js.map +1 -1
- package/dist/detectors/technical-docs.d.ts +1 -1
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +3 -2
- package/dist/detectors/technical-docs.js.map +1 -1
- package/dist/detectors/tier-threshold.d.ts +3 -0
- package/dist/detectors/tier-threshold.d.ts.map +1 -0
- package/dist/detectors/tier-threshold.js +86 -0
- package/dist/detectors/tier-threshold.js.map +1 -0
- package/dist/detectors/time-order.d.ts +1 -0
- package/dist/detectors/time-order.d.ts.map +1 -1
- package/dist/detectors/time-order.js +43 -13
- package/dist/detectors/time-order.js.map +1 -1
- package/dist/detectors/use-maximum.d.ts +3 -0
- package/dist/detectors/use-maximum.d.ts.map +1 -0
- package/dist/detectors/use-maximum.js +32 -0
- package/dist/detectors/use-maximum.js.map +1 -0
- package/dist/detectors/variance.d.ts +3 -0
- package/dist/detectors/variance.d.ts.map +1 -0
- package/dist/detectors/variance.js +28 -0
- package/dist/detectors/variance.js.map +1 -0
- package/dist/detectors/whole-count-findings.d.ts +4 -0
- package/dist/detectors/whole-count-findings.d.ts.map +1 -0
- package/dist/detectors/whole-count-findings.js +38 -0
- package/dist/detectors/whole-count-findings.js.map +1 -0
- package/dist/detectors/working-hours-findings.d.ts +9 -0
- package/dist/detectors/working-hours-findings.d.ts.map +1 -0
- package/dist/detectors/working-hours-findings.js +79 -0
- package/dist/detectors/working-hours-findings.js.map +1 -0
- package/dist/eval.js +3 -3
- package/dist/eval.js.map +1 -1
- package/dist/facts/age-values.d.ts +22 -0
- package/dist/facts/age-values.d.ts.map +1 -0
- package/dist/facts/age-values.js +76 -0
- package/dist/facts/age-values.js.map +1 -0
- package/dist/facts/cell-keys.d.ts +12 -0
- package/dist/facts/cell-keys.d.ts.map +1 -0
- package/dist/facts/cell-keys.js +19 -0
- package/dist/facts/cell-keys.js.map +1 -0
- package/dist/facts/count-labels.d.ts +15 -0
- package/dist/facts/count-labels.d.ts.map +1 -0
- package/dist/facts/count-labels.js +19 -0
- package/dist/facts/count-labels.js.map +1 -0
- package/dist/facts/document-terms.d.ts +43 -0
- package/dist/facts/document-terms.d.ts.map +1 -0
- package/dist/facts/document-terms.js +74 -0
- package/dist/facts/document-terms.js.map +1 -0
- package/dist/facts/duration-scale.d.ts +11 -0
- package/dist/facts/duration-scale.d.ts.map +1 -0
- package/dist/facts/duration-scale.js +14 -0
- package/dist/facts/duration-scale.js.map +1 -0
- package/dist/facts/duration-values.d.ts +15 -0
- package/dist/facts/duration-values.d.ts.map +1 -0
- package/dist/facts/duration-values.js +29 -0
- package/dist/facts/duration-values.js.map +1 -0
- package/dist/facts/fact-values.d.ts +9 -1
- package/dist/facts/fact-values.d.ts.map +1 -1
- package/dist/facts/fact-values.js +19 -6
- package/dist/facts/fact-values.js.map +1 -1
- package/dist/facts/labelled-facts.d.ts +15 -1
- package/dist/facts/labelled-facts.d.ts.map +1 -1
- package/dist/facts/labelled-facts.js +51 -8
- package/dist/facts/labelled-facts.js.map +1 -1
- package/dist/facts/measure-units.d.ts.map +1 -1
- package/dist/facts/measure-units.js +23 -8
- package/dist/facts/measure-units.js.map +1 -1
- package/dist/facts/measures.js +11 -9
- package/dist/facts/measures.js.map +1 -1
- package/dist/facts/qualified-labels.d.ts +28 -0
- package/dist/facts/qualified-labels.d.ts.map +1 -0
- package/dist/facts/qualified-labels.js +96 -0
- package/dist/facts/qualified-labels.js.map +1 -0
- package/dist/facts/rate-values.d.ts +40 -0
- package/dist/facts/rate-values.d.ts.map +1 -0
- package/dist/facts/rate-values.js +68 -0
- package/dist/facts/rate-values.js.map +1 -0
- package/dist/facts/row-sentence-amounts.d.ts +51 -0
- package/dist/facts/row-sentence-amounts.d.ts.map +1 -0
- package/dist/facts/row-sentence-amounts.js +71 -0
- package/dist/facts/row-sentence-amounts.js.map +1 -0
- package/dist/facts/superscript-power.d.ts +3 -0
- package/dist/facts/superscript-power.d.ts.map +1 -0
- package/dist/facts/superscript-power.js +5 -0
- package/dist/facts/superscript-power.js.map +1 -0
- package/dist/facts/table-facts.d.ts +18 -2
- package/dist/facts/table-facts.d.ts.map +1 -1
- package/dist/facts/table-facts.js +16 -6
- package/dist/facts/table-facts.js.map +1 -1
- package/dist/facts/term-values.d.ts +34 -0
- package/dist/facts/term-values.d.ts.map +1 -0
- package/dist/facts/term-values.js +195 -0
- package/dist/facts/term-values.js.map +1 -0
- package/dist/facts/unit-word.d.ts +5 -0
- package/dist/facts/unit-word.d.ts.map +1 -1
- package/dist/facts/unit-word.js +9 -0
- package/dist/facts/unit-word.js.map +1 -1
- package/dist/facts/verb-quantity-facts.d.ts +22 -0
- package/dist/facts/verb-quantity-facts.d.ts.map +1 -0
- package/dist/facts/verb-quantity-facts.js +58 -0
- package/dist/facts/verb-quantity-facts.js.map +1 -0
- package/dist/facts/whole-counts.d.ts +58 -0
- package/dist/facts/whole-counts.d.ts.map +1 -0
- package/dist/facts/whole-counts.js +118 -0
- package/dist/facts/whole-counts.js.map +1 -0
- package/dist/fix-plan/text.js +2 -2
- package/dist/fix-plan/text.js.map +1 -1
- package/dist/lexicon-genres.d.ts +7 -0
- package/dist/lexicon-genres.d.ts.map +1 -0
- package/dist/lexicon-genres.js +8 -0
- package/dist/lexicon-genres.js.map +1 -0
- package/dist/name-char-reading.d.ts +16 -0
- package/dist/name-char-reading.d.ts.map +1 -0
- package/dist/name-char-reading.js +18 -0
- package/dist/name-char-reading.js.map +1 -0
- package/dist/name-line-block.d.ts +6 -0
- package/dist/name-line-block.d.ts.map +1 -0
- package/dist/name-line-block.js +35 -0
- package/dist/name-line-block.js.map +1 -0
- package/dist/name-lookalike-chars.d.ts +16 -0
- package/dist/name-lookalike-chars.d.ts.map +1 -0
- package/dist/name-lookalike-chars.js +41 -0
- package/dist/name-lookalike-chars.js.map +1 -0
- package/dist/name-neighbours.d.ts +7 -0
- package/dist/name-neighbours.d.ts.map +1 -0
- package/dist/name-neighbours.js +55 -0
- package/dist/name-neighbours.js.map +1 -0
- package/dist/name-ordinary-word.d.ts +13 -0
- package/dist/name-ordinary-word.d.ts.map +1 -0
- package/dist/name-ordinary-word.js +54 -0
- package/dist/name-ordinary-word.js.map +1 -0
- package/dist/name-person.d.ts +9 -0
- package/dist/name-person.d.ts.map +1 -0
- package/dist/name-person.js +25 -0
- package/dist/name-person.js.map +1 -0
- package/dist/name-separator.d.ts +14 -0
- package/dist/name-separator.d.ts.map +1 -0
- package/dist/name-separator.js +33 -0
- package/dist/name-separator.js.map +1 -0
- package/dist/name-variants.d.ts +8 -8
- package/dist/name-variants.d.ts.map +1 -1
- package/dist/name-variants.js +28 -81
- package/dist/name-variants.js.map +1 -1
- package/dist/name-weight.d.ts +10 -0
- package/dist/name-weight.d.ts.map +1 -0
- package/dist/name-weight.js +7 -0
- package/dist/name-weight.js.map +1 -0
- package/dist/person-field.d.ts +6 -0
- package/dist/person-field.d.ts.map +1 -0
- package/dist/person-field.js +40 -0
- package/dist/person-field.js.map +1 -0
- package/dist/person-full-name.d.ts +12 -0
- package/dist/person-full-name.d.ts.map +1 -0
- package/dist/person-full-name.js +52 -0
- package/dist/person-full-name.js.map +1 -0
- package/dist/phone-numbers.d.ts +23 -3
- package/dist/phone-numbers.d.ts.map +1 -1
- package/dist/phone-numbers.js +49 -21
- package/dist/phone-numbers.js.map +1 -1
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/product-names.d.ts +33 -0
- package/dist/product-names.d.ts.map +1 -0
- package/dist/product-names.js +74 -0
- package/dist/product-names.js.map +1 -0
- package/dist/profile/parse.d.ts.map +1 -1
- package/dist/profile/parse.js +5 -0
- package/dist/profile/parse.js.map +1 -1
- package/dist/reference-numbers.d.ts +26 -0
- package/dist/reference-numbers.d.ts.map +1 -0
- package/dist/reference-numbers.js +43 -0
- package/dist/reference-numbers.js.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +1 -0
- package/dist/run.js.map +1 -1
- package/dist/spaced-person-name.d.ts +17 -0
- package/dist/spaced-person-name.d.ts.map +1 -0
- package/dist/spaced-person-name.js +82 -0
- package/dist/spaced-person-name.js.map +1 -0
- package/dist/spacing-code.d.ts +1 -0
- package/dist/spacing-code.d.ts.map +1 -1
- package/dist/spacing-code.js +15 -1
- package/dist/spacing-code.js.map +1 -1
- package/dist/structure/annual-holidays.d.ts +56 -0
- package/dist/structure/annual-holidays.d.ts.map +1 -0
- package/dist/structure/annual-holidays.js +159 -0
- package/dist/structure/annual-holidays.js.map +1 -0
- package/dist/structure/annual-pay.d.ts +97 -0
- package/dist/structure/annual-pay.d.ts.map +1 -0
- package/dist/structure/annual-pay.js +236 -0
- package/dist/structure/annual-pay.js.map +1 -0
- package/dist/structure/bmi.d.ts +63 -0
- package/dist/structure/bmi.d.ts.map +1 -0
- package/dist/structure/bmi.js +106 -0
- package/dist/structure/bmi.js.map +1 -0
- package/dist/structure/change-rate-table.d.ts +46 -0
- package/dist/structure/change-rate-table.d.ts.map +1 -0
- package/dist/structure/change-rate-table.js +110 -0
- package/dist/structure/change-rate-table.js.map +1 -0
- package/dist/structure/change-rate.d.ts +13 -1
- package/dist/structure/change-rate.d.ts.map +1 -1
- package/dist/structure/change-rate.js +51 -19
- package/dist/structure/change-rate.js.map +1 -1
- package/dist/structure/closing-balance.d.ts +24 -0
- package/dist/structure/closing-balance.d.ts.map +1 -0
- package/dist/structure/closing-balance.js +79 -0
- package/dist/structure/closing-balance.js.map +1 -0
- package/dist/structure/column-date-order.d.ts +5 -0
- package/dist/structure/column-date-order.d.ts.map +1 -0
- package/dist/structure/column-date-order.js +57 -0
- package/dist/structure/column-date-order.js.map +1 -0
- package/dist/structure/compound-hours.d.ts +5 -0
- package/dist/structure/compound-hours.d.ts.map +1 -0
- package/dist/structure/compound-hours.js +45 -0
- package/dist/structure/compound-hours.js.map +1 -0
- package/dist/structure/cumulative-below-current.d.ts +21 -0
- package/dist/structure/cumulative-below-current.d.ts.map +1 -0
- package/dist/structure/cumulative-below-current.js +48 -0
- package/dist/structure/cumulative-below-current.js.map +1 -0
- package/dist/structure/currency-column.d.ts +21 -0
- package/dist/structure/currency-column.d.ts.map +1 -0
- package/dist/structure/currency-column.js +74 -0
- package/dist/structure/currency-column.js.map +1 -0
- package/dist/structure/date-deadline-mark.d.ts +15 -0
- package/dist/structure/date-deadline-mark.d.ts.map +1 -0
- package/dist/structure/date-deadline-mark.js +22 -0
- package/dist/structure/date-deadline-mark.js.map +1 -0
- package/dist/structure/date-outside-period.d.ts +5 -1
- package/dist/structure/date-outside-period.d.ts.map +1 -1
- package/dist/structure/date-outside-period.js +13 -9
- package/dist/structure/date-outside-period.js.map +1 -1
- package/dist/structure/date-range.d.ts +5 -3
- package/dist/structure/date-range.d.ts.map +1 -1
- package/dist/structure/date-range.js +7 -9
- package/dist/structure/date-range.js.map +1 -1
- package/dist/structure/deadline-after-event.d.ts +35 -2
- package/dist/structure/deadline-after-event.d.ts.map +1 -1
- package/dist/structure/deadline-after-event.js +77 -6
- package/dist/structure/deadline-after-event.js.map +1 -1
- package/dist/structure/deductible-limit.d.ts +69 -0
- package/dist/structure/deductible-limit.d.ts.map +1 -0
- package/dist/structure/deductible-limit.js +191 -0
- package/dist/structure/deductible-limit.js.map +1 -0
- package/dist/structure/discount-rate.d.ts +35 -0
- package/dist/structure/discount-rate.d.ts.map +1 -0
- package/dist/structure/discount-rate.js +172 -0
- package/dist/structure/discount-rate.js.map +1 -0
- package/dist/structure/formula-amount.d.ts +38 -0
- package/dist/structure/formula-amount.d.ts.map +1 -0
- package/dist/structure/formula-amount.js +187 -0
- package/dist/structure/formula-amount.js.map +1 -0
- package/dist/structure/generic-role.d.ts +2 -0
- package/dist/structure/generic-role.d.ts.map +1 -0
- package/dist/structure/generic-role.js +8 -0
- package/dist/structure/generic-role.js.map +1 -0
- package/dist/structure/gpa.d.ts +74 -0
- package/dist/structure/gpa.d.ts.map +1 -0
- package/dist/structure/gpa.js +170 -0
- package/dist/structure/gpa.js.map +1 -0
- package/dist/structure/installment-fee.d.ts +52 -0
- package/dist/structure/installment-fee.d.ts.map +1 -0
- package/dist/structure/installment-fee.js +110 -0
- package/dist/structure/installment-fee.js.map +1 -0
- package/dist/structure/installment-total.d.ts +117 -0
- package/dist/structure/installment-total.d.ts.map +1 -0
- package/dist/structure/installment-total.js +224 -0
- package/dist/structure/installment-total.js.map +1 -0
- package/dist/structure/interest.d.ts +22 -0
- package/dist/structure/interest.d.ts.map +1 -0
- package/dist/structure/interest.js +107 -0
- package/dist/structure/interest.js.map +1 -0
- package/dist/structure/key-value-row.d.ts +14 -0
- package/dist/structure/key-value-row.d.ts.map +1 -0
- package/dist/structure/key-value-row.js +38 -0
- package/dist/structure/key-value-row.js.map +1 -0
- package/dist/structure/lab-columns.d.ts +12 -0
- package/dist/structure/lab-columns.d.ts.map +1 -0
- package/dist/structure/lab-columns.js +11 -0
- package/dist/structure/lab-columns.js.map +1 -0
- package/dist/structure/labelled-date-order.d.ts +33 -16
- package/dist/structure/labelled-date-order.d.ts.map +1 -1
- package/dist/structure/labelled-date-order.js +38 -30
- package/dist/structure/labelled-date-order.js.map +1 -1
- package/dist/structure/labelled-order.d.ts +59 -0
- package/dist/structure/labelled-order.d.ts.map +1 -0
- package/dist/structure/labelled-order.js +65 -0
- package/dist/structure/labelled-order.js.map +1 -0
- package/dist/structure/labelled-time-order.d.ts +17 -0
- package/dist/structure/labelled-time-order.d.ts.map +1 -0
- package/dist/structure/labelled-time-order.js +79 -0
- package/dist/structure/labelled-time-order.js.map +1 -0
- package/dist/structure/line-amount-label.d.ts +31 -0
- package/dist/structure/line-amount-label.d.ts.map +1 -0
- package/dist/structure/line-amount-label.js +77 -0
- package/dist/structure/line-amount-label.js.map +1 -0
- package/dist/structure/line-amount-rate.d.ts +47 -0
- package/dist/structure/line-amount-rate.d.ts.map +1 -0
- package/dist/structure/line-amount-rate.js +141 -0
- package/dist/structure/line-amount-rate.js.map +1 -0
- package/dist/structure/line-amount-unit.d.ts +7 -0
- package/dist/structure/line-amount-unit.d.ts.map +1 -1
- package/dist/structure/line-amount-unit.js +11 -0
- package/dist/structure/line-amount-unit.js.map +1 -1
- package/dist/structure/line-amount.d.ts +33 -7
- package/dist/structure/line-amount.d.ts.map +1 -1
- package/dist/structure/line-amount.js +152 -42
- package/dist/structure/line-amount.js.map +1 -1
- package/dist/structure/meter-usage-read.d.ts +21 -0
- package/dist/structure/meter-usage-read.d.ts.map +1 -0
- package/dist/structure/meter-usage-read.js +116 -0
- package/dist/structure/meter-usage-read.js.map +1 -0
- package/dist/structure/meter-usage.d.ts +62 -0
- package/dist/structure/meter-usage.d.ts.map +1 -0
- package/dist/structure/meter-usage.js +157 -0
- package/dist/structure/meter-usage.js.map +1 -0
- package/dist/structure/net-amount.d.ts +81 -0
- package/dist/structure/net-amount.d.ts.map +1 -0
- package/dist/structure/net-amount.js +161 -0
- package/dist/structure/net-amount.js.map +1 -0
- package/dist/structure/net-gross-weight.d.ts +30 -0
- package/dist/structure/net-gross-weight.d.ts.map +1 -0
- package/dist/structure/net-gross-weight.js +79 -0
- package/dist/structure/net-gross-weight.js.map +1 -0
- package/dist/structure/order-quantity.d.ts +38 -0
- package/dist/structure/order-quantity.d.ts.map +1 -0
- package/dist/structure/order-quantity.js +104 -0
- package/dist/structure/order-quantity.js.map +1 -0
- package/dist/structure/party-role.d.ts.map +1 -1
- package/dist/structure/party-role.js +4 -1
- package/dist/structure/party-role.js.map +1 -1
- package/dist/structure/percent-sum.d.ts +2 -0
- package/dist/structure/percent-sum.d.ts.map +1 -1
- package/dist/structure/percent-sum.js +2 -0
- package/dist/structure/percent-sum.js.map +1 -1
- package/dist/structure/period-label-conflict.d.ts +52 -0
- package/dist/structure/period-label-conflict.d.ts.map +1 -0
- package/dist/structure/period-label-conflict.js +105 -0
- package/dist/structure/period-label-conflict.js.map +1 -0
- package/dist/structure/period-labels.d.ts +36 -0
- package/dist/structure/period-labels.d.ts.map +1 -0
- package/dist/structure/period-labels.js +86 -0
- package/dist/structure/period-labels.js.map +1 -0
- package/dist/structure/period-multiple.d.ts +46 -0
- package/dist/structure/period-multiple.d.ts.map +1 -0
- package/dist/structure/period-multiple.js +123 -0
- package/dist/structure/period-multiple.js.map +1 -0
- package/dist/structure/quantity-range.d.ts.map +1 -1
- package/dist/structure/quantity-range.js +1 -5
- package/dist/structure/quantity-range.js.map +1 -1
- package/dist/structure/range-bands.d.ts +2 -0
- package/dist/structure/range-bands.d.ts.map +1 -1
- package/dist/structure/range-bands.js +1 -1
- package/dist/structure/range-bands.js.map +1 -1
- package/dist/structure/range-years.d.ts +18 -0
- package/dist/structure/range-years.d.ts.map +1 -0
- package/dist/structure/range-years.js +60 -0
- package/dist/structure/range-years.js.map +1 -0
- package/dist/structure/ratio.d.ts +136 -0
- package/dist/structure/ratio.d.ts.map +1 -0
- package/dist/structure/ratio.js +214 -0
- package/dist/structure/ratio.js.map +1 -0
- package/dist/structure/reference-flags.d.ts +55 -0
- package/dist/structure/reference-flags.d.ts.map +1 -0
- package/dist/structure/reference-flags.js +116 -0
- package/dist/structure/reference-flags.js.map +1 -0
- package/dist/structure/reference-number-repeated.d.ts +12 -0
- package/dist/structure/reference-number-repeated.d.ts.map +1 -0
- package/dist/structure/reference-number-repeated.js +43 -0
- package/dist/structure/reference-number-repeated.js.map +1 -0
- package/dist/structure/reference-unit.d.ts +24 -0
- package/dist/structure/reference-unit.d.ts.map +1 -0
- package/dist/structure/reference-unit.js +80 -0
- package/dist/structure/reference-unit.js.map +1 -0
- package/dist/structure/rent-multiple.d.ts +2 -22
- package/dist/structure/rent-multiple.d.ts.map +1 -1
- package/dist/structure/rent-multiple.js +2 -49
- package/dist/structure/rent-multiple.js.map +1 -1
- package/dist/structure/revision-direction.d.ts +51 -0
- package/dist/structure/revision-direction.d.ts.map +1 -0
- package/dist/structure/revision-direction.js +163 -0
- package/dist/structure/revision-direction.js.map +1 -0
- package/dist/structure/running-balance.d.ts +36 -0
- package/dist/structure/running-balance.d.ts.map +1 -0
- package/dist/structure/running-balance.js +126 -0
- package/dist/structure/running-balance.js.map +1 -0
- package/dist/structure/scaled-quantities.d.ts +1 -1
- package/dist/structure/scaled-quantities.d.ts.map +1 -1
- package/dist/structure/scaled-quantities.js +23 -6
- package/dist/structure/scaled-quantities.js.map +1 -1
- package/dist/structure/serial-range.d.ts +9 -0
- package/dist/structure/serial-range.d.ts.map +1 -0
- package/dist/structure/serial-range.js +41 -0
- package/dist/structure/serial-range.js.map +1 -0
- package/dist/structure/share-amount.d.ts +55 -0
- package/dist/structure/share-amount.d.ts.map +1 -0
- package/dist/structure/share-amount.js +162 -0
- package/dist/structure/share-amount.js.map +1 -0
- package/dist/structure/shift-times.d.ts +32 -0
- package/dist/structure/shift-times.d.ts.map +1 -0
- package/dist/structure/shift-times.js +112 -0
- package/dist/structure/shift-times.js.map +1 -0
- package/dist/structure/span-label.d.ts +3 -0
- package/dist/structure/span-label.d.ts.map +1 -0
- package/dist/structure/span-label.js +27 -0
- package/dist/structure/span-label.js.map +1 -0
- package/dist/structure/start-end-range.d.ts +30 -0
- package/dist/structure/start-end-range.d.ts.map +1 -0
- package/dist/structure/start-end-range.js +79 -0
- package/dist/structure/start-end-range.js.map +1 -0
- package/dist/structure/stated-multiple.d.ts +39 -0
- package/dist/structure/stated-multiple.d.ts.map +1 -0
- package/dist/structure/stated-multiple.js +49 -0
- package/dist/structure/stated-multiple.js.map +1 -0
- package/dist/structure/stated-period.d.ts +3 -2
- package/dist/structure/stated-period.d.ts.map +1 -1
- package/dist/structure/stated-period.js +17 -11
- package/dist/structure/stated-period.js.map +1 -1
- package/dist/structure/table-scale.d.ts +45 -0
- package/dist/structure/table-scale.d.ts.map +1 -0
- package/dist/structure/table-scale.js +188 -0
- package/dist/structure/table-scale.js.map +1 -0
- package/dist/structure/tax-price.d.ts +29 -0
- package/dist/structure/tax-price.d.ts.map +1 -0
- package/dist/structure/tax-price.js +112 -0
- package/dist/structure/tax-price.js.map +1 -0
- package/dist/structure/tax.d.ts +2 -0
- package/dist/structure/tax.d.ts.map +1 -1
- package/dist/structure/tax.js +46 -23
- package/dist/structure/tax.js.map +1 -1
- package/dist/structure/tier-threshold.d.ts +65 -0
- package/dist/structure/tier-threshold.d.ts.map +1 -0
- package/dist/structure/tier-threshold.js +170 -0
- package/dist/structure/tier-threshold.js.map +1 -0
- package/dist/structure/time-range.d.ts +2 -0
- package/dist/structure/time-range.d.ts.map +1 -1
- package/dist/structure/time-range.js +7 -2
- package/dist/structure/time-range.js.map +1 -1
- package/dist/structure/total-line.d.ts +34 -2
- package/dist/structure/total-line.d.ts.map +1 -1
- package/dist/structure/total-line.js +124 -3
- package/dist/structure/total-line.js.map +1 -1
- package/dist/structure/total-row-blank.d.ts +10 -0
- package/dist/structure/total-row-blank.d.ts.map +1 -0
- package/dist/structure/total-row-blank.js +15 -0
- package/dist/structure/total-row-blank.js.map +1 -0
- package/dist/structure/total.d.ts +13 -3
- package/dist/structure/total.d.ts.map +1 -1
- package/dist/structure/total.js +80 -7
- package/dist/structure/total.js.map +1 -1
- package/dist/structure/variance-table.d.ts +34 -0
- package/dist/structure/variance-table.d.ts.map +1 -0
- package/dist/structure/variance-table.js +130 -0
- package/dist/structure/variance-table.js.map +1 -0
- package/dist/table-names.d.ts +4 -3
- package/dist/table-names.d.ts.map +1 -1
- package/dist/table-names.js +6 -6
- package/dist/table-names.js.map +1 -1
- package/dist/unlabelled-references.d.ts +16 -0
- package/dist/unlabelled-references.d.ts.map +1 -0
- package/dist/unlabelled-references.js +73 -0
- package/dist/unlabelled-references.js.map +1 -0
- package/dist/vehicle-plates.d.ts +28 -0
- package/dist/vehicle-plates.d.ts.map +1 -0
- package/dist/vehicle-plates.js +116 -0
- package/dist/vehicle-plates.js.map +1 -0
- package/dist/whole-word-runs.d.ts +24 -0
- package/dist/whole-word-runs.d.ts.map +1 -0
- package/dist/whole-word-runs.js +26 -0
- package/dist/whole-word-runs.js.map +1 -0
- package/package.json +5 -4
- package/profiles/property-sale.yaml +21 -0
- package/rules/absolute-exception.yaml +1 -1
- package/rules/ai-generated-composite.yaml +1 -1
- package/rules/ai-tell.yaml +1 -1
- package/rules/amount-range-reversed.yaml +1 -1
- package/rules/amount-scale-consistency.yaml +1 -1
- package/rules/announcing-opener.yaml +1 -1
- package/rules/annual-holidays-mismatch.yaml +65 -0
- package/rules/annual-pay-mismatch.yaml +64 -0
- package/rules/article-sound.yaml +1 -1
- package/rules/assistant-residue.yaml +1 -1
- package/rules/attachment-not-attached.yaml +1 -1
- package/rules/backorder-mismatch.yaml +57 -0
- package/rules/bmi-mismatch.yaml +63 -0
- package/rules/bold-label-list.yaml +1 -1
- package/rules/broken-link.yaml +1 -1
- package/rules/capacity-runtime-mismatch.yaml +1 -1
- package/rules/change-rate-mismatch.yaml +6 -6
- package/rules/chat-citation-residue.yaml +2 -2
- package/rules/cliche.yaml +2 -2
- package/rules/closing-balance-mismatch.yaml +63 -0
- package/rules/colon-lead-in.yaml +1 -1
- package/rules/comparative-without-baseline.yaml +1 -1
- package/rules/concrete-evidence-density.yaml +1 -1
- package/rules/connection-time-short.yaml +1 -1
- package/rules/contact-variant.yaml +4 -4
- package/rules/contrast-framing.yaml +2 -2
- package/rules/cross-doc-broken-link.yaml +1 -1
- package/rules/cross-doc-fact-conflict.yaml +1 -1
- package/rules/cross-doc-term-variant.yaml +1 -1
- package/rules/cumulative-below-current.yaml +59 -0
- package/rules/currency-column-mix.yaml +70 -0
- package/rules/currency-notation-consistency.yaml +2 -2
- package/rules/cushion-phrase-density.yaml +1 -1
- package/rules/dangling-participle.yaml +2 -2
- package/rules/dangling-reference.yaml +1 -1
- package/rules/date-format-consistency.yaml +1 -1
- package/rules/date-outside-period.yaml +5 -5
- package/rules/date-range-reversed.yaml +4 -4
- package/rules/date-stamp-order.yaml +2 -2
- package/rules/date-without-year.yaml +12 -12
- package/rules/deadline-after-event.yaml +11 -6
- package/rules/deductible-exceeds-limit.yaml +54 -0
- package/rules/defined-name-repeated.yaml +3 -3
- package/rules/defined-term-form.yaml +2 -2
- package/rules/delivered-over-ordered.yaml +57 -0
- package/rules/demonstrative-opener-run.yaml +1 -1
- package/rules/discount-rate-mismatch.yaml +66 -0
- package/rules/due-before-issue.yaml +33 -12
- package/rules/duration-mismatch.yaml +16 -7
- package/rules/duration-product-mismatch.yaml +11 -3
- package/rules/elapsed-years-mismatch.yaml +11 -6
- package/rules/email-greeting-closing.yaml +2 -2
- package/rules/empty-conclusion.yaml +1 -1
- package/rules/empty-intensifier.yaml +1 -1
- package/rules/empty-list-item.yaml +1 -1
- package/rules/empty-section.yaml +1 -1
- package/rules/empty-table-cell.yaml +2 -2
- package/rules/expletive-construction.yaml +1 -1
- package/rules/fact-conflict.yaml +16 -4
- package/rules/figurative-density.yaml +1 -1
- package/rules/figure-reference-order.yaml +1 -1
- package/rules/footnote-mismatch.yaml +1 -1
- package/rules/formula-amount-mismatch.yaml +67 -0
- package/rules/fullwidth-alnum-consistency.yaml +1 -1
- package/rules/gpa-mismatch.yaml +80 -0
- package/rules/heading-end-punctuation-mix.yaml +1 -1
- package/rules/heading-level-skip.yaml +1 -1
- package/rules/heading-numbering-mix.yaml +3 -3
- package/rules/homophone-slip.yaml +1 -1
- package/rules/humble-for-others.yaml +1 -1
- package/rules/idiom-misuse.yaml +1 -1
- package/rules/ime-residue.yaml +1 -1
- package/rules/impossible-date.yaml +10 -6
- package/rules/installment-total-mismatch.yaml +63 -0
- package/rules/interest-mismatch.yaml +50 -0
- package/rules/interval-count-mismatch.yaml +1 -1
- package/rules/invisible-character.yaml +1 -1
- package/rules/kana-function-word.yaml +2 -2
- package/rules/katakana-density.yaml +1 -1
- package/rules/katakana-long-vowel.yaml +2 -2
- package/rules/kutoten-consistency.yaml +1 -1
- package/rules/latin-spacing.yaml +20 -6
- package/rules/layout-code-mismatch.yaml +1 -1
- package/rules/less-for-fewer.yaml +1 -1
- package/rules/line-amount-mismatch.yaml +8 -7
- package/rules/link-text-url-mismatch.yaml +1 -1
- package/rules/list-item-form-mix.yaml +1 -1
- package/rules/lookalike-character.yaml +1 -1
- package/rules/max-kanji-continuous.yaml +1 -1
- package/rules/meter-usage-mismatch.yaml +64 -0
- package/rules/misconversion.yaml +1 -1
- package/rules/modal-conflict.yaml +1 -1
- package/rules/name-variant.yaml +12 -3
- package/rules/net-amount-mismatch.yaml +57 -0
- package/rules/net-over-gross.yaml +57 -0
- package/rules/no-doubled-joshi.yaml +1 -1
- package/rules/no-mixed-desumasu.yaml +1 -1
- package/rules/no-nakaguro-parallel.yaml +1 -1
- package/rules/nominalization.yaml +1 -1
- package/rules/nonstandard-word.yaml +1 -1
- package/rules/number-style-consistency.yaml +3 -3
- package/rules/number-without-unit.yaml +1 -1
- package/rules/number-word-figure-mismatch.yaml +1 -1
- package/rules/numbering-gap.yaml +1 -1
- package/rules/obligation-without-deadline.yaml +1 -1
- package/rules/ordinal-suffix-mismatch.yaml +1 -1
- package/rules/orthographic-variant.yaml +5 -5
- package/rules/outside-announced-list.yaml +1 -1
- package/rules/padded-intro.yaml +1 -1
- package/rules/paragraph-restatement.yaml +1 -1
- package/rules/party-role-name.yaml +3 -3
- package/rules/percent-sum-mismatch.yaml +2 -2
- package/rules/period-label-conflict.yaml +68 -0
- package/rules/period-multiple-mismatch.yaml +61 -0
- package/rules/period-part-exceeds-whole.yaml +62 -0
- package/rules/person-consistency.yaml +1 -1
- package/rules/phone-number-variant.yaml +3 -3
- package/rules/preferred-term.yaml +2 -2
- package/rules/prerequisite-after-step.yaml +1 -1
- package/rules/product-exceeds-maximum.yaml +49 -0
- package/rules/proper-noun-density.yaml +1 -1
- package/rules/quantity-range-reversed.yaml +2 -2
- package/rules/range-band-mismatch.yaml +1 -1
- package/rules/ratio-mismatch.yaml +64 -0
- package/rules/reference-flag-mismatch.yaml +74 -0
- package/rules/reference-number-repeated.yaml +63 -0
- package/rules/reference-number-variant.yaml +81 -0
- package/rules/reference-title-mismatch.yaml +1 -1
- package/rules/reference-topic-missing.yaml +1 -1
- package/rules/reference-unit-mismatch.yaml +62 -0
- package/rules/relative-date-mismatch.yaml +1 -1
- package/rules/request-without-deadline.yaml +3 -3
- package/rules/required-listed-as-preferred.yaml +1 -1
- package/rules/required-sections.yaml +2 -2
- package/rules/requirement-modal.yaml +2 -2
- package/rules/requirement-smell.yaml +1 -1
- package/rules/revision-direction-mismatch.yaml +66 -0
- package/rules/risk-disclosure.yaml +1 -1
- package/rules/running-balance-mismatch.yaml +59 -0
- package/rules/scaled-quantity-mismatch.yaml +1 -1
- package/rules/serial-range-reversed.yaml +52 -0
- package/rules/share-amount-mismatch.yaml +58 -0
- package/rules/share-over-hundred.yaml +1 -1
- package/rules/shell-prompt-mix.yaml +1 -1
- package/rules/space-before-punctuation.yaml +1 -1
- package/rules/spelling-consistency.yaml +1 -1
- package/rules/step-statement-mix.yaml +3 -3
- package/rules/stock-transition.yaml +1 -1
- package/rules/summary-fact-mismatch.yaml +1 -1
- package/rules/table-header-variant.yaml +1 -1
- package/rules/table-unit-mix.yaml +82 -0
- package/rules/taigen-dome-in-prose.yaml +1 -1
- package/rules/tax-mismatch.yaml +13 -7
- package/rules/tier-threshold-mismatch.yaml +73 -0
- package/rules/time-order.yaml +7 -4
- package/rules/time-range-reversed.yaml +9 -4
- package/rules/toc-heading-mismatch.yaml +1 -1
- package/rules/topic-predicate-distance.yaml +1 -1
- package/rules/total-mismatch.yaml +5 -5
- package/rules/ui-label-variant.yaml +1 -1
- package/rules/unclosed-code-fence.yaml +1 -1
- package/rules/uncomparable-graded.yaml +2 -2
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +2 -2
- package/rules/unit-mismatch.yaml +1 -1
- package/rules/unit-spacing-consistency.yaml +1 -1
- package/rules/unknown-word.yaml +1 -1
- package/rules/url-run-on.yaml +1 -1
- package/rules/vague-deadline.yaml +1 -1
- package/rules/vague-figure-reference.yaml +1 -1
- package/rules/vague-word-density.yaml +2 -2
- package/rules/variance-mismatch.yaml +67 -0
- package/rules/very-adjective.yaml +1 -1
- package/rules/walk-time-distance-mismatch.yaml +1 -1
- package/rules/warning-without-action.yaml +1 -1
- package/rules/weasel-word.yaml +2 -2
- package/rules/wordy-phrase.yaml +2 -2
- package/rules/yori-as-from.yaml +1 -1
- package/skills/chaff/SKILL.md +59 -9
- package/src/cli-text.ts +2 -2
- package/src/company-kana-spelling.ts +105 -0
- package/src/company-names.ts +159 -26
- package/src/contacts/table-rows.ts +51 -0
- package/src/cross-run.ts +1 -0
- package/src/derived/age-on-date.ts +161 -0
- package/src/derived/durations.ts +83 -12
- package/src/derived/hours-and-minutes.ts +41 -0
- package/src/derived/hyphenated-counts.ts +38 -0
- package/src/derived/marked-dates.ts +61 -0
- package/src/derived/money-span.ts +10 -0
- package/src/derived/period-parts.ts +360 -0
- package/src/derived/readable-date.ts +63 -0
- package/src/derived/stays.ts +7 -2
- package/src/derived/timesheet-hours.ts +112 -0
- package/src/derived/use-maximum.ts +158 -0
- package/src/derived/working-hours.ts +2 -2
- package/src/detectors/agreement-slip.ts +3 -0
- package/src/detectors/annual-holidays-mismatch.ts +41 -0
- package/src/detectors/annual-pay-mismatch.ts +71 -0
- package/src/detectors/blank-structure.ts +54 -14
- package/src/detectors/bmi-mismatch.ts +82 -0
- package/src/detectors/change-rate.ts +27 -4
- package/src/detectors/closing-balance-mismatch.ts +52 -0
- package/src/detectors/contact-variant.ts +8 -2
- package/src/detectors/cumulative-below-current.ts +30 -0
- package/src/detectors/currency-column.ts +37 -0
- package/src/detectors/date-any-year.ts +130 -0
- package/src/detectors/date-outside-period.ts +4 -10
- package/src/detectors/date-stamp-order.ts +2 -1
- package/src/detectors/date-year.ts +55 -13
- package/src/detectors/deductible-exceeds-limit.ts +55 -0
- package/src/detectors/defined-term-form.ts +6 -23
- package/src/detectors/derived-numbers.ts +50 -89
- package/src/detectors/discount-rate.ts +41 -0
- package/src/detectors/due-date.ts +21 -7
- package/src/detectors/email-letter.ts +45 -15
- package/src/detectors/event-deadline.ts +13 -3
- package/src/detectors/fact-consistency.ts +145 -7
- package/src/detectors/formula-amount.ts +59 -0
- package/src/detectors/gloss-year.ts +21 -0
- package/src/detectors/gpa-mismatch.ts +43 -0
- package/src/detectors/impossible-date.ts +25 -3
- package/src/detectors/installment-total-mismatch.ts +94 -0
- package/src/detectors/interest.ts +43 -0
- package/src/detectors/lab-columns.ts +9 -0
- package/src/detectors/labelled-age.ts +154 -0
- package/src/detectors/line-amount.ts +58 -3
- package/src/detectors/measured-facts.ts +1 -1
- package/src/detectors/meter-usage.ts +49 -0
- package/src/detectors/name-field.ts +43 -0
- package/src/detectors/name-variant.ts +160 -16
- package/src/detectors/net-amount-mismatch.ts +86 -0
- package/src/detectors/net-gross-weight.ts +39 -0
- package/src/detectors/nominal-step.ts +35 -0
- package/src/detectors/number-style.ts +11 -2
- package/src/detectors/order-quantity.ts +46 -0
- package/src/detectors/orthographic-variant.ts +43 -11
- package/src/detectors/orthography.ts +27 -11
- package/src/detectors/period-label-conflict.ts +43 -0
- package/src/detectors/period-multiple-mismatch.ts +54 -0
- package/src/detectors/period-part.ts +71 -0
- package/src/detectors/range-words.ts +17 -0
- package/src/detectors/ratio-mismatch.ts +116 -0
- package/src/detectors/readable-dates.ts +36 -0
- package/src/detectors/reference-flag.ts +36 -0
- package/src/detectors/reference-number-repeated.ts +25 -0
- package/src/detectors/reference-number-variant.ts +44 -0
- package/src/detectors/reference-unit.ts +24 -0
- package/src/detectors/registry/annual-holidays-mismatch.ts +4 -0
- package/src/detectors/registry/annual-pay-mismatch.ts +4 -0
- package/src/detectors/registry/backorder-mismatch.ts +4 -0
- package/src/detectors/registry/bmi-mismatch.ts +4 -0
- package/src/detectors/registry/closing-balance-mismatch.ts +4 -0
- package/src/detectors/registry/cumulative-below-current.ts +4 -0
- package/src/detectors/registry/currency-column-mix.ts +4 -0
- package/src/detectors/registry/deductible-exceeds-limit.ts +4 -0
- package/src/detectors/registry/delivered-over-ordered.ts +4 -0
- package/src/detectors/registry/discount-rate.ts +4 -0
- package/src/detectors/registry/elapsed-years-mismatch.ts +1 -1
- package/src/detectors/registry/formula-amount.ts +4 -0
- package/src/detectors/registry/gpa-mismatch.ts +4 -0
- package/src/detectors/registry/installment-total-mismatch.ts +4 -0
- package/src/detectors/registry/interest.ts +4 -0
- package/src/detectors/registry/meter-usage.ts +4 -0
- package/src/detectors/registry/net-amount-mismatch.ts +4 -0
- package/src/detectors/registry/net-over-gross.ts +4 -0
- package/src/detectors/registry/period-label-conflict.ts +4 -0
- package/src/detectors/registry/period-multiple-mismatch.ts +4 -0
- package/src/detectors/registry/period-part-exceeds-whole.ts +4 -0
- package/src/detectors/registry/product-exceeds-maximum.ts +4 -0
- package/src/detectors/registry/ratio-mismatch.ts +4 -0
- package/src/detectors/registry/reference-flag-mismatch.ts +4 -0
- package/src/detectors/registry/reference-number-repeated.ts +4 -0
- package/src/detectors/registry/reference-number-variant.ts +4 -0
- package/src/detectors/registry/reference-unit.ts +4 -0
- package/src/detectors/registry/revision-direction.ts +4 -0
- package/src/detectors/registry/running-balance.ts +4 -0
- package/src/detectors/registry/serial-range.ts +4 -0
- package/src/detectors/registry/share-amount.ts +4 -0
- package/src/detectors/registry/table-unit-mix.ts +4 -0
- package/src/detectors/registry/tier-threshold.ts +4 -0
- package/src/detectors/registry/variance-mismatch.ts +4 -0
- package/src/detectors/relative-dates.ts +2 -1
- package/src/detectors/relative-day-words.ts +2 -1
- package/src/detectors/rent-multiple-mismatch.ts +3 -2
- package/src/detectors/request-owner.ts +5 -2
- package/src/detectors/revision-direction.ts +44 -0
- package/src/detectors/row-sentence-amounts.ts +96 -0
- package/src/detectors/running-balance.ts +31 -0
- package/src/detectors/scaled-quantity.ts +1 -1
- package/src/detectors/serial-range.ts +37 -0
- package/src/detectors/share-amount.ts +51 -0
- package/src/detectors/structure-tree.ts +62 -12
- package/src/detectors/table-scale.ts +37 -0
- package/src/detectors/tax-amount.ts +45 -13
- package/src/detectors/technical-docs.ts +4 -2
- package/src/detectors/tier-threshold.ts +108 -0
- package/src/detectors/time-order.ts +52 -18
- package/src/detectors/use-maximum.ts +38 -0
- package/src/detectors/variance.ts +33 -0
- package/src/detectors/whole-count-findings.ts +48 -0
- package/src/detectors/working-hours-findings.ts +100 -0
- package/src/eval.ts +3 -3
- package/src/facts/age-values.ts +124 -0
- package/src/facts/cell-keys.ts +21 -0
- package/src/facts/count-labels.ts +28 -0
- package/src/facts/document-terms.ts +107 -0
- package/src/facts/duration-scale.ts +22 -0
- package/src/facts/duration-values.ts +44 -0
- package/src/facts/fact-values.ts +36 -7
- package/src/facts/labelled-facts.ts +66 -9
- package/src/facts/measure-units.ts +28 -10
- package/src/facts/measures.ts +11 -11
- package/src/facts/qualified-labels.ts +126 -0
- package/src/facts/rate-values.ts +117 -0
- package/src/facts/row-sentence-amounts.ts +113 -0
- package/src/facts/superscript-power.ts +5 -0
- package/src/facts/table-facts.ts +35 -7
- package/src/facts/term-values.ts +236 -0
- package/src/facts/unit-word.ts +13 -0
- package/src/facts/verb-quantity-facts.ts +84 -0
- package/src/facts/whole-counts.ts +183 -0
- package/src/fix-plan/text.ts +2 -2
- package/src/lexicon-genres.ts +11 -0
- package/src/name-char-reading.ts +24 -0
- package/src/name-line-block.ts +40 -0
- package/src/name-lookalike-chars.ts +53 -0
- package/src/name-neighbours.ts +58 -0
- package/src/name-ordinary-word.ts +68 -0
- package/src/name-person.ts +31 -0
- package/src/name-separator.ts +48 -0
- package/src/name-variants.ts +42 -86
- package/src/name-weight.ts +12 -0
- package/src/person-field.ts +43 -0
- package/src/person-full-name.ts +70 -0
- package/src/phone-numbers.ts +54 -18
- package/src/plugin.ts +8 -0
- package/src/product-names.ts +98 -0
- package/src/profile/parse.ts +8 -0
- package/src/reference-numbers.ts +55 -0
- package/src/run.ts +1 -0
- package/src/spaced-person-name.ts +97 -0
- package/src/spacing-code.ts +22 -1
- package/src/structure/annual-holidays.ts +222 -0
- package/src/structure/annual-pay.ts +339 -0
- package/src/structure/bmi.ts +133 -0
- package/src/structure/change-rate-table.ts +135 -0
- package/src/structure/change-rate.ts +54 -17
- package/src/structure/closing-balance.ts +104 -0
- package/src/structure/column-date-order.ts +73 -0
- package/src/structure/compound-hours.ts +49 -0
- package/src/structure/cumulative-below-current.ts +66 -0
- package/src/structure/currency-column.ts +97 -0
- package/src/structure/date-deadline-mark.ts +30 -0
- package/src/structure/date-outside-period.ts +17 -9
- package/src/structure/date-range.ts +9 -11
- package/src/structure/deadline-after-event.ts +125 -8
- package/src/structure/deductible-limit.ts +255 -0
- package/src/structure/discount-rate.ts +209 -0
- package/src/structure/formula-amount.ts +236 -0
- package/src/structure/generic-role.ts +8 -0
- package/src/structure/gpa.ts +218 -0
- package/src/structure/installment-fee.ts +201 -0
- package/src/structure/installment-total.ts +343 -0
- package/src/structure/interest.ts +133 -0
- package/src/structure/key-value-row.ts +45 -0
- package/src/structure/lab-columns.ts +21 -0
- package/src/structure/labelled-date-order.ts +68 -52
- package/src/structure/labelled-order.ts +122 -0
- package/src/structure/labelled-time-order.ts +100 -0
- package/src/structure/line-amount-label.ts +100 -0
- package/src/structure/line-amount-rate.ts +178 -0
- package/src/structure/line-amount-unit.ts +16 -0
- package/src/structure/line-amount.ts +200 -48
- package/src/structure/meter-usage-read.ts +139 -0
- package/src/structure/meter-usage.ts +224 -0
- package/src/structure/net-amount.ts +243 -0
- package/src/structure/net-gross-weight.ts +97 -0
- package/src/structure/order-quantity.ts +125 -0
- package/src/structure/party-role.ts +4 -1
- package/src/structure/percent-sum.ts +3 -0
- package/src/structure/period-label-conflict.ts +174 -0
- package/src/structure/period-labels.ts +147 -0
- package/src/structure/period-multiple.ts +186 -0
- package/src/structure/quantity-range.ts +1 -8
- package/src/structure/range-bands.ts +1 -1
- package/src/structure/range-years.ts +75 -0
- package/src/structure/ratio.ts +296 -0
- package/src/structure/reference-flags.ts +156 -0
- package/src/structure/reference-number-repeated.ts +57 -0
- package/src/structure/reference-unit.ts +105 -0
- package/src/structure/rent-multiple.ts +12 -82
- package/src/structure/revision-direction.ts +214 -0
- package/src/structure/running-balance.ts +157 -0
- package/src/structure/scaled-quantities.ts +20 -6
- package/src/structure/serial-range.ts +52 -0
- package/src/structure/share-amount.ts +206 -0
- package/src/structure/shift-times.ts +136 -0
- package/src/structure/span-label.ts +26 -0
- package/src/structure/start-end-range.ts +120 -0
- package/src/structure/stated-multiple.ts +82 -0
- package/src/structure/stated-period.ts +23 -11
- package/src/structure/table-scale.ts +239 -0
- package/src/structure/tax-price.ts +136 -0
- package/src/structure/tax.ts +55 -20
- package/src/structure/tier-threshold.ts +218 -0
- package/src/structure/time-range.ts +9 -3
- package/src/structure/total-line.ts +174 -5
- package/src/structure/total-row-blank.ts +23 -0
- package/src/structure/total.ts +122 -13
- package/src/structure/variance-table.ts +167 -0
- package/src/table-names.ts +6 -6
- package/src/unlabelled-references.ts +83 -0
- package/src/vehicle-plates.ts +142 -0
- package/src/whole-word-runs.ts +38 -0
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
// tree's quantities, the numbers counted with a word ("1,200 companies"), the calendar years, and the lexicons change-direction,
|
|
3
3
|
// change-base, change-target, change-break, percent-unit and amount-multiplier.
|
|
4
4
|
import type { Detector, Finding, LexiconEntry, ProseDocument, Span, StructureNode, Token } from "../plugin.ts";
|
|
5
|
-
import { inDocumentOrder } from "../structure/issues.ts";
|
|
5
|
+
import { inDocumentOrder, type StructureIssue } from "../structure/issues.ts";
|
|
6
6
|
import { startsOtherSubject } from "../structure/subject-change.ts";
|
|
7
7
|
import { changeRateMismatches, type BaseMark, type Break, type Direction, type Figure, type Period, type Rate } from "../structure/change-rate.ts";
|
|
8
8
|
import { escapeRegExp } from "../orthography.ts";
|
|
9
9
|
import { quoteAt } from "./structure-tree.ts";
|
|
10
|
+
import { tableRateMismatches, type ChangeTable, type ColumnRole, type ColumnWord } from "../structure/change-rate-table.ts";
|
|
11
|
+
import { cellsOf, tablesOf } from "../facts/table-facts.ts";
|
|
12
|
+
import { linesOf } from "../structure/lines.ts";
|
|
13
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
10
14
|
|
|
11
15
|
const patternsOf = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
|
|
12
16
|
|
|
@@ -137,7 +141,23 @@ const marksOf = (doc: ProseDocument, lexicon: string): BaseMark[] =>
|
|
|
137
141
|
entry.position === undefined ? [] : spansOf(doc.source, entry.pattern).map((span) => ({ ...span, position: entry.position ?? "before" })),
|
|
138
142
|
);
|
|
139
143
|
|
|
140
|
-
|
|
144
|
+
const ROLES: readonly string[] = ["base", "current", "rate", "change"] satisfies readonly ColumnRole[];
|
|
145
|
+
const isRole = (group: string | undefined): group is ColumnRole => group !== undefined && ROLES.includes(group);
|
|
146
|
+
|
|
147
|
+
/** Lexicon change-column: the heading words that say which column holds the earlier value, the later one and the rate. */
|
|
148
|
+
const columnWordsOf = (doc: ProseDocument): ColumnWord[] =>
|
|
149
|
+
(doc.lexicons["change-column"] ?? []).flatMap((entry) => (isRole(entry.group) ? [{ pattern: entry.pattern, role: entry.group }] : []));
|
|
150
|
+
|
|
151
|
+
/** The document's Markdown tables (outside code and quotes): the heading cells and the body rows' cells. */
|
|
152
|
+
const changeTablesOf = (doc: ProseDocument): ChangeTable[] =>
|
|
153
|
+
tablesOf(linesOf(proseAndTablesOf(doc))).map((table) => ({ header: cellsOf(table.header), rows: table.rows.map(cellsOf) }));
|
|
154
|
+
|
|
155
|
+
const tableIssues = (doc: ProseDocument): StructureIssue[] => {
|
|
156
|
+
const words = columnWordsOf(doc);
|
|
157
|
+
return words.length === 0 ? [] : tableRateMismatches(changeTablesOf(doc), words);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const sentenceIssues = (doc: ProseDocument): StructureIssue[] => {
|
|
141
161
|
if (doc.structure === undefined) return [];
|
|
142
162
|
const nodes = quantityNodes(doc.structure);
|
|
143
163
|
const units = patternsOf(doc, "percent-unit");
|
|
@@ -155,7 +175,11 @@ export const changeRate: Detector = (doc): Finding[] => {
|
|
|
155
175
|
breaks: breaksOf(doc),
|
|
156
176
|
source: doc.source,
|
|
157
177
|
};
|
|
158
|
-
return changeRateMismatches(text)
|
|
178
|
+
return changeRateMismatches(text);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const changeRate: Detector = (doc): Finding[] =>
|
|
182
|
+
[...sentenceIssues(doc), ...tableIssues(doc)].map((issue) => ({
|
|
159
183
|
rule: "change-rate-mismatch",
|
|
160
184
|
severity: "warning",
|
|
161
185
|
line: 0,
|
|
@@ -163,4 +187,3 @@ export const changeRate: Detector = (doc): Finding[] => {
|
|
|
163
187
|
quote: quoteAt(doc.source, issue.offset),
|
|
164
188
|
values: { ...issue.values, offset: issue.offset },
|
|
165
189
|
}));
|
|
166
|
-
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// closing-balance-mismatch: the reading half. Reads tables and each section's label-and-amount lines the way
|
|
2
|
+
// net-amount-mismatch does, with the words of lexicon closing-balance-label, and leaves the deciding to
|
|
3
|
+
// structure/closing-balance.ts.
|
|
4
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
5
|
+
import { linesOf, type Line } from "../structure/lines.ts";
|
|
6
|
+
import { tablesOf } from "../facts/table-facts.ts";
|
|
7
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
8
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
9
|
+
import { labelledLineOf, patternsOf, plainCellsOf, sectionsOf } from "./net-amount-mismatch.ts";
|
|
10
|
+
import { BALANCE_ROLES, sectionClosingMismatch, tableClosingMismatches, type BalanceWords } from "../structure/closing-balance.ts";
|
|
11
|
+
import type { NetIssue } from "../structure/net-amount.ts";
|
|
12
|
+
|
|
13
|
+
const RULE = "closing-balance-mismatch";
|
|
14
|
+
const LEXICON = "closing-balance-label";
|
|
15
|
+
|
|
16
|
+
const wordsOf = (doc: ProseDocument): BalanceWords => ({
|
|
17
|
+
labels: {
|
|
18
|
+
opening: patternsOf(doc, LEXICON, "opening"),
|
|
19
|
+
inflow: patternsOf(doc, LEXICON, "inflow"),
|
|
20
|
+
outflow: patternsOf(doc, LEXICON, "outflow"),
|
|
21
|
+
closing: patternsOf(doc, LEXICON, "closing"),
|
|
22
|
+
},
|
|
23
|
+
magnitudes: patternsOf(doc, "amount-multiplier"),
|
|
24
|
+
percentUnits: patternsOf(doc, "percent-unit"),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const tableIssues = (lines: readonly Line[], words: BalanceWords): NetIssue[] =>
|
|
28
|
+
tablesOf(lines).flatMap((table) => tableClosingMismatches(plainCellsOf(table.header), table.rows.map(plainCellsOf), words));
|
|
29
|
+
|
|
30
|
+
const sectionIssues = (lines: readonly Line[], source: string, words: BalanceWords): NetIssue[] =>
|
|
31
|
+
sectionsOf(lines, linesOf(source)).flatMap((section) => {
|
|
32
|
+
const issue = sectionClosingMismatch(section.filter((line) => !line.text.includes("|")).flatMap(labelledLineOf), words);
|
|
33
|
+
return issue === undefined ? [] : [issue];
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const closingBalanceMismatch: Detector = (doc): Finding[] => {
|
|
37
|
+
const words = wordsOf(doc);
|
|
38
|
+
if (BALANCE_ROLES.some((role) => words.labels[role].length === 0)) return [];
|
|
39
|
+
const lines = linesOf(proseAndTablesOf(doc));
|
|
40
|
+
const issues = [...tableIssues(lines, words), ...sectionIssues(lines, doc.source, words)];
|
|
41
|
+
return issues
|
|
42
|
+
.filter((issue, index) => issues.findIndex((other) => other.offset === issue.offset) === index)
|
|
43
|
+
.toSorted((left, right) => left.offset - right.offset)
|
|
44
|
+
.map((issue) => ({
|
|
45
|
+
rule: RULE,
|
|
46
|
+
severity: "warning",
|
|
47
|
+
line: 0,
|
|
48
|
+
column: 0,
|
|
49
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
50
|
+
values: { ...issue.values, offset: issue.offset },
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// contact-variant: one email address or postal address written two ways in one document (contacts/emails.ts,
|
|
2
|
-
// contacts/addresses.ts). The address labels come from the language's address-label lexicon
|
|
2
|
+
// contacts/addresses.ts). The address labels come from the language's address-label lexicon; a two-column table row named
|
|
3
|
+
// by one is read as that label's line for addresses (contacts/table-rows.ts); emails in tables stay unread.
|
|
3
4
|
import { addressVariants } from "../contacts/addresses.ts";
|
|
4
5
|
import { emailVariants } from "../contacts/emails.ts";
|
|
6
|
+
import { proseWithLabelledRows } from "../contacts/table-rows.ts";
|
|
7
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
5
8
|
import type { Variant, Writing } from "../contacts/variants.ts";
|
|
6
9
|
import { quoteAt } from "./structure-tree.ts";
|
|
7
10
|
import type { Detector, Finding } from "../plugin.ts";
|
|
@@ -17,8 +20,11 @@ const findingOf = (source: string, { writing, other }: Variant<Writing>, variant
|
|
|
17
20
|
});
|
|
18
21
|
|
|
19
22
|
export const contactVariant: Detector = (doc, options): Finding[] => {
|
|
23
|
+
const labels = options.lexicon ?? [];
|
|
20
24
|
const text = doc.prose ?? doc.source;
|
|
21
25
|
const emails = emailVariants(text).map((found) => findingOf(doc.source, found));
|
|
22
|
-
const addresses = addressVariants(text,
|
|
26
|
+
const addresses = addressVariants(proseWithLabelledRows(text, proseAndTablesOf(doc), labels), labels).map(({ variant, found }) =>
|
|
27
|
+
findingOf(doc.source, found, variant),
|
|
28
|
+
);
|
|
23
29
|
return [...emails, ...addresses].toSorted((a, b) => Number(a.values?.["offset"]) - Number(b.values?.["offset"]));
|
|
24
30
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// cumulative-below-current: the reading half. Reads the document's Markdown tables and the lexicon cumulative-table, and
|
|
2
|
+
// leaves the deciding to structure/cumulative-below-current.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 { cumulativeBelowCurrent, type CumulativeRole, type CumulativeWord } from "../structure/cumulative-below-current.ts";
|
|
9
|
+
|
|
10
|
+
const RULE = "cumulative-below-current";
|
|
11
|
+
const ROLES: readonly string[] = ["current", "cumulative", "prior", "level"] satisfies readonly CumulativeRole[];
|
|
12
|
+
const isRole = (group: string | undefined): group is CumulativeRole => group !== undefined && ROLES.includes(group);
|
|
13
|
+
|
|
14
|
+
/** Lexicon cumulative-table: the heading words of the this-period and cumulative columns, and the row labels of levels. */
|
|
15
|
+
const wordsOf = (doc: ProseDocument): CumulativeWord[] =>
|
|
16
|
+
(doc.lexicons["cumulative-table"] ?? []).flatMap((entry) => (isRole(entry.group) ? [{ pattern: entry.pattern, role: entry.group }] : []));
|
|
17
|
+
|
|
18
|
+
export const cumulativeBelow: Detector = (doc): Finding[] => {
|
|
19
|
+
const words = wordsOf(doc);
|
|
20
|
+
if (words.length === 0) return [];
|
|
21
|
+
const tables = tablesOf(linesOf(proseAndTablesOf(doc))).map((table) => ({ header: cellsOf(table.header), rows: table.rows.map(cellsOf) }));
|
|
22
|
+
return cumulativeBelowCurrent(tables, words).map((issue) => ({
|
|
23
|
+
rule: RULE,
|
|
24
|
+
severity: "warning",
|
|
25
|
+
line: 0,
|
|
26
|
+
column: 0,
|
|
27
|
+
quote: quoteAt(doc.source, issue.offset),
|
|
28
|
+
values: { ...issue.values, offset: issue.offset },
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// currency-column-mix: the reading half. The amounts and their currencies are currency-notation's, read with
|
|
2
|
+
// amount-multiplier's words of scale; the heading words of a column of currencies or exchange rates are currency-column's.
|
|
3
|
+
// The deciding is structure/currency-column.ts.
|
|
4
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
5
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
6
|
+
import { cellsOf, tablesOf } from "../facts/table-facts.ts";
|
|
7
|
+
import { linesOf } from "../structure/lines.ts";
|
|
8
|
+
import { proseAndTablesOf } from "../table-text.ts";
|
|
9
|
+
import { currencyColumnMix, type CurrencyColumnWords } from "../structure/currency-column.ts";
|
|
10
|
+
import { amountsIn, formsOf } from "./currency-notation.ts";
|
|
11
|
+
|
|
12
|
+
const RULE = "currency-column-mix";
|
|
13
|
+
|
|
14
|
+
const wordsOf = (doc: ProseDocument): CurrencyColumnWords => {
|
|
15
|
+
const forms = formsOf(doc);
|
|
16
|
+
const multipliers = (doc.lexicons["amount-multiplier"] ?? []).map((entry) => entry.pattern);
|
|
17
|
+
return {
|
|
18
|
+
currencies: forms.map((form) => ({ pattern: form.pattern, currency: form.currency })),
|
|
19
|
+
columns: (doc.lexicons["currency-column"] ?? []).map((entry) => entry.pattern),
|
|
20
|
+
amountCurrencies: (text) => amountsIn(text, forms, multipliers).map((amount) => amount.currency),
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const currencyColumnMixDetector: Detector = (doc): Finding[] => {
|
|
25
|
+
const words = wordsOf(doc);
|
|
26
|
+
if (words.currencies.length === 0) return [];
|
|
27
|
+
const text = proseAndTablesOf(doc);
|
|
28
|
+
const tables = tablesOf(linesOf(text)).map((table) => ({ header: cellsOf(table.header), rows: table.rows.map(cellsOf) }));
|
|
29
|
+
return currencyColumnMix(tables, words).map((issue) => ({
|
|
30
|
+
rule: RULE,
|
|
31
|
+
severity: "warning",
|
|
32
|
+
line: 0,
|
|
33
|
+
column: 0,
|
|
34
|
+
quote: quoteAt(text, issue.offset),
|
|
35
|
+
values: { ...issue.values, offset: issue.offset },
|
|
36
|
+
}));
|
|
37
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// A yearless date that is no date of one year: a day that comes round every year (毎年4月1日, 年末年始(12月29日~1月3日),
|
|
2
|
+
// "each December 31") or a date in a worked example (例えば…4月1日, "e.g. March 31"). There is no year to write. Pure.
|
|
3
|
+
|
|
4
|
+
/** The words that make a yearless date any year's: a recurring day or a worked example. Their `group` says where they reach. */
|
|
5
|
+
export const ANY_YEAR_MARKER_LEXICON = "any-year-marker";
|
|
6
|
+
|
|
7
|
+
/** The words that join the two ends of a period (から, ~, "to"): 「4月1日から翌年3月31日まで」 is every year's. */
|
|
8
|
+
export const YEAR_SPAN_JOINER_LEXICON = "year-span-joiner";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Where a marker reaches. `sentence`: earlier in the date's sentence, not closed off by a bracket (例えば…4月1日), or the
|
|
12
|
+
* line a list of dates hangs from ("for example:"). `adjacent`: just before the date ("each December 31"). `label`: before
|
|
13
|
+
* the bracket the date is in (年末年始閉庁日(12月29日~1月3日)).
|
|
14
|
+
*/
|
|
15
|
+
export type MarkerReach = "sentence" | "adjacent" | "label";
|
|
16
|
+
|
|
17
|
+
export type AnyYearMarker = { readonly word: string; readonly reach: MarkerReach };
|
|
18
|
+
|
|
19
|
+
/** The span of a yearless date in the source. */
|
|
20
|
+
export type DateSpan = { readonly offset: number; readonly end: number };
|
|
21
|
+
|
|
22
|
+
/** How far apart the two ends of a period may stand: the joiner and a year word (「から翌年」, " to "). */
|
|
23
|
+
const SPAN_GAP_REACH = 12;
|
|
24
|
+
|
|
25
|
+
/** How many lines above a list item its introducing line is looked for: a longer list is read as no example. */
|
|
26
|
+
const LIST_REACH = 64;
|
|
27
|
+
|
|
28
|
+
/** The end of a sentence: 。, a line break, or a full stop before a capital or a digit ("Mar 3. The", "so. 10 November"). */
|
|
29
|
+
const SENTENCE_END = /[。!?\n]|[.!?]["'”’)\]]*\s+(?=[A-Z0-9])/u;
|
|
30
|
+
const OPENERS = "((「『[【〔";
|
|
31
|
+
const CLOSERS = "))」』]】〕";
|
|
32
|
+
/** What ends a bracket's label, going back from the bracket: a comma, a full stop, another bracket. */
|
|
33
|
+
const LABEL_END = /[、,,。.\n((「『[【〔))」』\]】〕]/u;
|
|
34
|
+
const LIST_ITEM = /^\s*(?:[-*+・]|\d+[.).])\s/u;
|
|
35
|
+
const LETTER = /\p{L}/u;
|
|
36
|
+
const LATIN_START = /^[A-Za-z]/u;
|
|
37
|
+
const LATIN_END = /[A-Za-z]$/u;
|
|
38
|
+
const COLON_END = /[::]$/u;
|
|
39
|
+
|
|
40
|
+
/** Lower case for Latin letters only, so every offset in the text stays where it was ("For example" finds "for example"). */
|
|
41
|
+
const latinLower = (text: string): string => text.replace(/[A-Z]/gu, (char) => char.toLowerCase());
|
|
42
|
+
|
|
43
|
+
const lineStart = (source: string, offset: number): number => source.lastIndexOf("\n", offset - 1) + 1;
|
|
44
|
+
|
|
45
|
+
/** A word of letters ("each") starts a word; 「例えば」 may follow anything. */
|
|
46
|
+
const startsWord = (text: string, index: number, word: string): boolean => !LATIN_START.test(word) || index === 0 || !LETTER.test(text.charAt(index - 1));
|
|
47
|
+
|
|
48
|
+
/** "to" in "today": a word of letters that runs on past its end. */
|
|
49
|
+
const runsOn = (text: string, word: string): boolean => LATIN_END.test(word) && LETTER.test(text.charAt(word.length));
|
|
50
|
+
|
|
51
|
+
const lastWordAt = (text: string, word: string): number => {
|
|
52
|
+
const found = text.lastIndexOf(word);
|
|
53
|
+
if (found === -1 || (startsWord(text, found, word) && !runsOn(text.slice(found), word))) return found;
|
|
54
|
+
return lastWordAt(text.slice(0, found), word);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const depthStep = (char: string): number => (OPENERS.includes(char) ? 1 : 0) - (CLOSERS.includes(char) ? 1 : 0);
|
|
58
|
+
|
|
59
|
+
/** A bracket closes in the text without opening in it: what came before it is cut off from what comes after. */
|
|
60
|
+
const closesBracket = (text: string): boolean => [...text].reduce((depth, char) => (depth < 0 ? depth : depth + depthStep(char)), 0) < 0;
|
|
61
|
+
|
|
62
|
+
/** `dateStart` is the date's first character: a full stop just before "10 November" ends a sentence only by what follows it. */
|
|
63
|
+
const inSentence = (before: string, dateStart: string, word: string): boolean => {
|
|
64
|
+
const found = lastWordAt(latinLower(before), word);
|
|
65
|
+
if (found === -1) return false;
|
|
66
|
+
const between = before.slice(found + word.length);
|
|
67
|
+
return !SENTENCE_END.test(`${between}${dateStart}`) && !closesBracket(between);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const isAdjacent = (before: string, word: string): boolean => {
|
|
71
|
+
const trimmed = before.trimEnd();
|
|
72
|
+
return trimmed.endsWith(word) && startsWord(trimmed, trimmed.length - word.length, word);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** Where the bracket still open at the end of the text opens. */
|
|
76
|
+
const openBracketAt = (text: string): number | undefined =>
|
|
77
|
+
[...text]
|
|
78
|
+
.reduce<number[]>((open, char, index) => {
|
|
79
|
+
const step = depthStep(char);
|
|
80
|
+
if (step > 0) return [...open, index];
|
|
81
|
+
return step < 0 ? open.slice(0, -1) : open;
|
|
82
|
+
}, [])
|
|
83
|
+
.at(-1);
|
|
84
|
+
|
|
85
|
+
/** The text from the bracket the date is in back to the end of the clause before it: 「年末年始閉庁日」 of 「年末年始閉庁日(12月29日」. */
|
|
86
|
+
const labelOf = (before: string): string | undefined => {
|
|
87
|
+
const opener = openBracketAt(before);
|
|
88
|
+
if (opener === undefined) return undefined;
|
|
89
|
+
const head = [...before].slice(0, opener);
|
|
90
|
+
return head.slice(head.findLastIndex((char) => LABEL_END.test(char)) + 1).join("");
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** The line a list's run of items hangs from: back over the run and the blank lines before it. */
|
|
94
|
+
const introducingLine = (lines: readonly string[]): string | undefined => {
|
|
95
|
+
const above = lines.slice(0, lines.findLastIndex((line) => !LIST_ITEM.test(line)) + 1);
|
|
96
|
+
return above.findLast((line) => line.trim() !== "");
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** Where the line `lines` lines above the one at `offset` starts (or the text, if it starts sooner). */
|
|
100
|
+
const startLinesBack = (source: string, offset: number, lines: number): number => {
|
|
101
|
+
const previous = source.lastIndexOf("\n", offset - 1);
|
|
102
|
+
return previous === -1 || lines === 0 ? previous + 1 : startLinesBack(source, previous, lines - 1);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** The line a list item's list hangs from ("we use 'to' in date ranges – for example:"), looked for within LIST_REACH lines. */
|
|
106
|
+
const introOf = (source: string, before: string, offset: number): string | undefined =>
|
|
107
|
+
LIST_ITEM.test(before) ? introducingLine(source.slice(startLinesBack(source, offset, LIST_REACH), offset).split("\n"))?.trimEnd() : undefined;
|
|
108
|
+
|
|
109
|
+
/** The line ends with the marker, before or after its colon: 「例:」 and "for example:" alike. */
|
|
110
|
+
const introEndsWith = (intro: string, word: string): boolean => isAdjacent(intro, word) || isAdjacent(intro.replace(COLON_END, ""), word);
|
|
111
|
+
|
|
112
|
+
/** The date is a recurring day or a worked example: a marker stands where its reach covers the date. */
|
|
113
|
+
export const anyYearDate = (date: DateSpan, source: string, markers: readonly AnyYearMarker[]): boolean => {
|
|
114
|
+
const before = source.slice(lineStart(source, date.offset), date.offset);
|
|
115
|
+
const intro = introOf(source, before, date.offset);
|
|
116
|
+
return markers.some(({ word: written, reach }) => {
|
|
117
|
+
const word = latinLower(written);
|
|
118
|
+
if (word === "") return false;
|
|
119
|
+
if (reach === "adjacent") return isAdjacent(latinLower(before), word);
|
|
120
|
+
if (reach === "label") return latinLower(labelOf(before) ?? "").includes(word);
|
|
121
|
+
return inSentence(before, source.charAt(date.offset), word) || (intro !== undefined && introEndsWith(latinLower(intro), word));
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/** The date opens a period whose other end, just after it, follows a joiner (「4月1日から翌年3月31日」). */
|
|
126
|
+
export const opensSpan = (date: DateSpan, next: DateSpan | undefined, source: string, joiners: readonly string[]): boolean => {
|
|
127
|
+
if (next === undefined || next.offset - date.end > SPAN_GAP_REACH) return false;
|
|
128
|
+
const gap = source.slice(date.end, next.offset).trimStart();
|
|
129
|
+
return !SENTENCE_END.test(gap) && joiners.some((joiner) => joiner !== "" && gap.startsWith(joiner) && !runsOn(gap, joiner));
|
|
130
|
+
};
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
2
2
|
import { inDocumentOrder } from "../structure/issues.ts";
|
|
3
3
|
import { datesOutsidePeriod, type OutsideWords } from "../structure/date-outside-period.ts";
|
|
4
|
-
import {
|
|
4
|
+
import { periodWordsOf } from "./range-words.ts";
|
|
5
5
|
import { quoteAt } from "./structure-tree.ts";
|
|
6
6
|
|
|
7
7
|
const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/** 期間の語、期間の外に置く語、文書の仕事の期間の語、締め切りの語、期間の後に来てよい仕事の語、日付を締め切りにする語、概要の節の見出しの語、範囲の記号(range-connector、range-opener、range-frame の間の語)、月と曜日の名は語彙表から取る。 */
|
|
10
10
|
const wordsOf = (doc: ProseDocument): OutsideWords => ({
|
|
11
|
-
|
|
11
|
+
...periodWordsOf(doc, patternsOf(doc, "period-label")),
|
|
12
12
|
terms: patternsOf(doc, "period-term-label"),
|
|
13
13
|
asides: patternsOf(doc, "period-aside"),
|
|
14
14
|
deadlines: patternsOf(doc, "period-deadline"),
|
|
15
15
|
overviews: patternsOf(doc, "period-overview-heading"),
|
|
16
16
|
afterTerm: patternsOf(doc, "period-after-term"),
|
|
17
|
-
|
|
18
|
-
...patternsOf(doc, "range-connector"),
|
|
19
|
-
...patternsOf(doc, "range-opener"),
|
|
20
|
-
...patternsOf(doc, "range-frame").flatMap((pattern) => rangeFrameOf(pattern)?.joint ?? []),
|
|
21
|
-
],
|
|
22
|
-
months: patternsOf(doc, "month-name"),
|
|
23
|
-
weekdays: patternsOf(doc, "weekday"),
|
|
17
|
+
deadlineMarks: doc.lexicons["date-deadline-mark"] ?? [],
|
|
24
18
|
});
|
|
25
19
|
|
|
26
20
|
/** 書いた期間(旅行期間:…)の外の日付を持つ、その後ろの日程の項目、表の行、見出し。 */
|
|
@@ -5,6 +5,7 @@ import { inDocumentOrder } from "../structure/issues.ts";
|
|
|
5
5
|
import { stampOrderIssues } from "../structure/stamp-order.ts";
|
|
6
6
|
import { proseAndTablesOf } from "../table-text.ts";
|
|
7
7
|
import { quoteAt } from "./structure-tree.ts";
|
|
8
|
+
import { readableDates, withReadableDates } from "./readable-dates.ts";
|
|
8
9
|
|
|
9
10
|
export const dateStampOrder: Detector = (doc, options): Finding[] => {
|
|
10
11
|
if (doc.structure === undefined) return [];
|
|
@@ -21,7 +22,7 @@ export const dateStampOrder: Detector = (doc, options): Finding[] => {
|
|
|
21
22
|
line: 0,
|
|
22
23
|
column: 0,
|
|
23
24
|
quote: quoteAt(doc.source, offset),
|
|
24
|
-
values: { ...dated, offset },
|
|
25
|
+
values: { ...withReadableDates(dated, ["established", "updated"], readableDates(doc)), offset },
|
|
25
26
|
...(side === undefined ? {} : { variant: String(side) }),
|
|
26
27
|
};
|
|
27
28
|
});
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
// A date written without its year where the
|
|
2
|
-
//
|
|
1
|
+
// A date written without its year where the reader cannot tell which year it is: the document's dated dates span more
|
|
2
|
+
// than one year, or its dates cross the turn of a year. Pure; reads the date nodes of the structure tree.
|
|
3
3
|
import type { Detector, Finding, LexiconEntry, ProseDocument, StructureNode } from "../plugin.ts";
|
|
4
4
|
import { inDocumentOrder } from "../structure/issues.ts";
|
|
5
5
|
import { quoteAt } from "./structure-tree.ts";
|
|
6
|
+
import { ANY_YEAR_MARKER_LEXICON, YEAR_SPAN_JOINER_LEXICON, anyYearDate, opensSpan, type AnyYearMarker, type MarkerReach } from "./date-any-year.ts";
|
|
7
|
+
|
|
8
|
+
/** The words that make a yearless date any year's (毎年, 例えば, "each") and that join a period's two ends (から, "to"). */
|
|
9
|
+
export type AnyYearWords = { readonly markers: readonly AnyYearMarker[]; readonly joiners: readonly string[] };
|
|
10
|
+
|
|
11
|
+
const NO_ANY_YEAR_WORDS: AnyYearWords = { markers: [], joiners: [] };
|
|
6
12
|
|
|
7
13
|
/** A date as the tree reads it: "2026-10-14" with its year, "10-14" without. */
|
|
8
14
|
export type DatePoint = { readonly offset: number; readonly end: number; readonly value: string };
|
|
9
15
|
|
|
10
|
-
|
|
16
|
+
/** The first and the last year of the document's dated dates. */
|
|
17
|
+
export type YearSpan = { readonly from: number; readonly to: number };
|
|
18
|
+
|
|
19
|
+
export type YearGap = { readonly point: DatePoint; readonly kind: "years" | "boundary"; readonly span: YearSpan | undefined };
|
|
11
20
|
|
|
12
21
|
/**
|
|
13
22
|
* The words beside a date that give its year in words (その年の, 同年, 毎年; "of each year"): the date has a year, or means
|
|
@@ -30,6 +39,14 @@ const YEAR_WORD_REACH = 6;
|
|
|
30
39
|
const YEAR_END = new Set([11, 12]);
|
|
31
40
|
const YEAR_START = new Set([1, 2]);
|
|
32
41
|
|
|
42
|
+
const yearOf = (value: string): number => Number(value.slice(0, 4));
|
|
43
|
+
|
|
44
|
+
const spanOf = (dated: readonly DatePoint[]): YearSpan | undefined => {
|
|
45
|
+
if (dated.length === 0) return undefined;
|
|
46
|
+
const years = dated.map((point) => yearOf(point.value));
|
|
47
|
+
return { from: Math.min(...years), to: Math.max(...years) };
|
|
48
|
+
};
|
|
49
|
+
|
|
33
50
|
const monthOf = (pattern: RegExp, value: string): number | undefined => {
|
|
34
51
|
const month = pattern.exec(value)?.[1];
|
|
35
52
|
return month === undefined ? undefined : Number(month);
|
|
@@ -93,20 +110,34 @@ const yearGiven = (point: DatePoint, anchors: readonly DatePoint[], source: stri
|
|
|
93
110
|
};
|
|
94
111
|
|
|
95
112
|
/**
|
|
96
|
-
* The yearless dates
|
|
97
|
-
*
|
|
98
|
-
* year is
|
|
113
|
+
* The yearless dates whose year the reader cannot tell. Where most dates carry a year (at least two, and more than the
|
|
114
|
+
* yearless ones) and those years differ, every yearless one is reported: in a one-year document the year is plain. Where
|
|
115
|
+
* the year is written once and the rest are month and day, that is the document's style, and only a date across the turn
|
|
116
|
+
* of a year is reported. A date whose year the text gives in words or earlier on its line is never reported, nor counted.
|
|
99
117
|
*/
|
|
100
|
-
export const yearGaps = (
|
|
118
|
+
export const yearGaps = (
|
|
119
|
+
points: readonly DatePoint[],
|
|
120
|
+
source = "",
|
|
121
|
+
yearWords: readonly YearWord[] = [],
|
|
122
|
+
anyYear: AnyYearWords = NO_ANY_YEAR_WORDS,
|
|
123
|
+
): YearGap[] => {
|
|
101
124
|
const dated = points.filter((point) => FULL.test(point.value));
|
|
102
125
|
const anchors = [...dated, ...points.filter((point) => hasYearWord(point, source, yearWords))];
|
|
103
|
-
const
|
|
104
|
-
const
|
|
126
|
+
const nextOf = new Map(points.map((point, index) => [point, points[index + 1]]));
|
|
127
|
+
const yearOfAny = (point: DatePoint): boolean => {
|
|
128
|
+
const next = nextOf.get(point);
|
|
129
|
+
if (anyYearDate(point, source, anyYear.markers)) return true;
|
|
130
|
+
return next !== undefined && opensSpan(point, next, source, anyYear.joiners) && hasYearWord(next, source, yearWords);
|
|
131
|
+
};
|
|
132
|
+
// A recurring day or an example's date has no year to write, and is not the document's way of writing dates either.
|
|
133
|
+
const yearless = points.filter((point) => MONTH_DAY.test(point.value) && !yearGiven(point, anchors, source, yearWords) && !yearOfAny(point));
|
|
134
|
+
const span = spanOf(dated);
|
|
135
|
+
const unclear = dated.length >= 2 && yearless.length < dated.length && span !== undefined && span.to > span.from;
|
|
105
136
|
const datedSides = new Set(dated.flatMap((point) => sideOf(monthOf(FULL, point.value)) ?? []));
|
|
106
137
|
const previousOf = new Map(points.map((point, index) => [point, points[index - 1]]));
|
|
107
138
|
return yearless.flatMap((point): YearGap[] => {
|
|
108
|
-
if (
|
|
109
|
-
return crossesYear(point, previousOf.get(point), datedSides) ? [{ point, kind: "boundary",
|
|
139
|
+
if (unclear) return [{ point, kind: "years", span }];
|
|
140
|
+
return crossesYear(point, previousOf.get(point), datedSides) ? [{ point, kind: "boundary", span }] : [];
|
|
110
141
|
});
|
|
111
142
|
};
|
|
112
143
|
|
|
@@ -116,15 +147,26 @@ export const datePoints = (tree: StructureNode): DatePoint[] =>
|
|
|
116
147
|
const yearWordsOf = (doc: ProseDocument): YearWord[] =>
|
|
117
148
|
(doc.lexicons[YEAR_REFERENCE_LEXICON] ?? []).map((entry: LexiconEntry) => ({ word: entry.pattern, position: entry.position }));
|
|
118
149
|
|
|
150
|
+
const reachOf = (group: string | undefined): MarkerReach => (group === "adjacent" || group === "label" ? group : "sentence");
|
|
151
|
+
|
|
152
|
+
const anyYearWordsOf = (doc: ProseDocument): AnyYearWords => ({
|
|
153
|
+
markers: (doc.lexicons[ANY_YEAR_MARKER_LEXICON] ?? []).map((entry: LexiconEntry) => ({ word: entry.pattern, reach: reachOf(entry.group) })),
|
|
154
|
+
joiners: (doc.lexicons[YEAR_SPAN_JOINER_LEXICON] ?? []).map((entry: LexiconEntry) => entry.pattern),
|
|
155
|
+
});
|
|
156
|
+
|
|
119
157
|
export const dateWithoutYear: Detector = (doc: ProseDocument): Finding[] =>
|
|
120
158
|
doc.structure === undefined
|
|
121
159
|
? []
|
|
122
|
-
: yearGaps(datePoints(doc.structure), doc.source, yearWordsOf(doc)).map((gap) => ({
|
|
160
|
+
: yearGaps(datePoints(doc.structure), doc.source, yearWordsOf(doc), anyYearWordsOf(doc)).map((gap) => ({
|
|
123
161
|
rule: "date-without-year",
|
|
124
162
|
severity: "warning",
|
|
125
163
|
line: 0,
|
|
126
164
|
column: 0,
|
|
127
165
|
quote: quoteAt(doc.source, gap.point.offset),
|
|
128
166
|
...(gap.kind === "boundary" ? { variant: "boundary" } : {}),
|
|
129
|
-
values: {
|
|
167
|
+
values: {
|
|
168
|
+
date: doc.source.slice(gap.point.offset, gap.point.end),
|
|
169
|
+
...(gap.span === undefined ? {} : { from: gap.span.from, to: gap.span.to }),
|
|
170
|
+
offset: gap.point.offset,
|
|
171
|
+
},
|
|
130
172
|
}));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// deductible-exceeds-limit: the reading half. Takes the words from the lexicons deductible-word, benefit-limit-word,
|
|
2
|
+
// deductible-basis, approximate-marker, range-connector, currency-notation and amount-multiplier, and leaves the deciding to
|
|
3
|
+
// structure/deductible-limit.ts, one sentence at a time, with the structure tree's quantities as the amounts.
|
|
4
|
+
import type { Detector, Finding, ProseDocument } from "../plugin.ts";
|
|
5
|
+
import { quoteAt } from "./structure-tree.ts";
|
|
6
|
+
import { sentenceDeductibleOverLimit, type DeductibleWords } from "../structure/deductible-limit.ts";
|
|
7
|
+
import { proseQuantitiesOf } from "../structure/ratio.ts";
|
|
8
|
+
|
|
9
|
+
const RULE = "deductible-exceeds-limit";
|
|
10
|
+
const NOT = "not";
|
|
11
|
+
|
|
12
|
+
const entriesOf = (doc: ProseDocument, id: string) => doc.lexicons[id] ?? [];
|
|
13
|
+
const patternsOf = (doc: ProseDocument, id: string, keep: (group: string | undefined) => boolean = () => true): string[] =>
|
|
14
|
+
entriesOf(doc, id)
|
|
15
|
+
.filter((entry) => keep(entry.group))
|
|
16
|
+
.map((entry) => entry.pattern);
|
|
17
|
+
const atSide = (doc: ProseDocument, id: string, position: "before" | "after"): string[] =>
|
|
18
|
+
entriesOf(doc, id)
|
|
19
|
+
.filter((entry) => entry.position === position)
|
|
20
|
+
.map((entry) => entry.pattern);
|
|
21
|
+
|
|
22
|
+
const wordsOf = (doc: ProseDocument): DeductibleWords => ({
|
|
23
|
+
deductibles: patternsOf(doc, "deductible-word", (group) => group !== NOT),
|
|
24
|
+
limits: patternsOf(doc, "benefit-limit-word", (group) => group !== NOT),
|
|
25
|
+
notDeductibles: patternsOf(doc, "deductible-word", (group) => group === NOT),
|
|
26
|
+
notLimits: patternsOf(doc, "benefit-limit-word", (group) => group === NOT),
|
|
27
|
+
bases: entriesOf(doc, "deductible-basis").flatMap((entry) =>
|
|
28
|
+
entry.group === undefined ? [] : [{ pattern: entry.pattern, basis: entry.group, rank: entry.weight }],
|
|
29
|
+
),
|
|
30
|
+
approximate: { before: atSide(doc, "approximate-marker", "before"), after: atSide(doc, "approximate-marker", "after") },
|
|
31
|
+
rangeMarks: patternsOf(doc, "range-connector"),
|
|
32
|
+
multipliers: entriesOf(doc, "amount-multiplier").flatMap((entry) => (entry.weight === undefined ? [] : [{ word: entry.pattern, value: entry.weight }])),
|
|
33
|
+
amounts: {
|
|
34
|
+
before: atSide(doc, "currency-notation", "before"),
|
|
35
|
+
after: atSide(doc, "currency-notation", "after"),
|
|
36
|
+
multipliers: patternsOf(doc, "amount-multiplier"),
|
|
37
|
+
percentUnits: patternsOf(doc, "percent-unit"),
|
|
38
|
+
},
|
|
39
|
+
currencies: entriesOf(doc, "currency-notation").flatMap((entry) => (entry.group === undefined ? [] : [{ pattern: entry.pattern, currency: entry.group }])),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/** A deductible larger than the most paid for the same benefit, read in one sentence. */
|
|
43
|
+
export const deductibleExceedsLimit: Detector = (doc): Finding[] => {
|
|
44
|
+
const words = wordsOf(doc);
|
|
45
|
+
if (words.deductibles.length === 0 || words.limits.length === 0) return [];
|
|
46
|
+
const quantities = proseQuantitiesOf(doc.structure);
|
|
47
|
+
return doc.sentences.flatMap((sentence): Finding[] => {
|
|
48
|
+
const text = doc.source.slice(sentence.span.start, sentence.span.end);
|
|
49
|
+
const issue = sentenceDeductibleOverLimit(text, sentence.span.start, quantities, words);
|
|
50
|
+
if (issue === undefined) return [];
|
|
51
|
+
return [
|
|
52
|
+
{ rule: RULE, severity: "warning", line: 0, column: 0, quote: quoteAt(doc.source, issue.offset), values: { ...issue.values, offset: issue.offset } },
|
|
53
|
+
];
|
|
54
|
+
});
|
|
55
|
+
};
|
|
@@ -7,6 +7,7 @@ import { prefixGroupsOf, prefixVariants, variantUses } from "../structure/term-p
|
|
|
7
7
|
import { quoteAt } from "./structure-tree.ts";
|
|
8
8
|
import { isPartOfAddress } from "./address-word.ts";
|
|
9
9
|
import { exactOffsets, extendedAfter, extendedBefore } from "./term-extension.ts";
|
|
10
|
+
import { CLOSES_SENTENCE, isNameField, isSignatureLine, opensClosingBlock, SLACK } from "./name-field.ts";
|
|
10
11
|
import type { Detector, Finding, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
|
|
11
12
|
|
|
12
13
|
const bodyOf = (doc: ProseDocument): BodyText[] => doc.sentences.map((sentence) => ({ start: sentence.span.start, text: sentence.text }));
|
|
@@ -238,26 +239,6 @@ const bracketBefore = (source: string, definition: Span): number => {
|
|
|
238
239
|
|
|
239
240
|
export type RepeatedName = { readonly offset: number; readonly name: string; readonly term: string; readonly line: number };
|
|
240
241
|
|
|
241
|
-
/** How many characters a line may add to the long name and still be a line that only names the party. */
|
|
242
|
-
const SLACK = 12;
|
|
243
|
-
|
|
244
|
-
/** A field label on its own line, after a list marker (Attention:, 宛先:): short, and not a sentence. */
|
|
245
|
-
const FIELD_LABEL = /^(?:[-*+]\s+)?[^::。.]{1,20}[::]\s*/u;
|
|
246
|
-
/**
|
|
247
|
-
* What may follow the name in an address field: nothing, a comma and the next part (, Member Support), or a space and a part
|
|
248
|
-
* that does not go on in lower case (株式会社みなと 総務部). A particle or a verb (は支払う, shall pay) makes the line a sentence.
|
|
249
|
-
*/
|
|
250
|
-
const NEXT_PART = /^\.?(?:$|\s*[,、,]|\s+(?!\p{Ll}))/u;
|
|
251
|
-
const CLOSES_SENTENCE = /[.。!?!?]$/u;
|
|
252
|
-
|
|
253
|
-
/** A field whose value is the name and a little more, not a sentence (Attention: Hibari Lab Inc., Member Support). */
|
|
254
|
-
const isNameField = (line: string, name: string): boolean => {
|
|
255
|
-
const label = FIELD_LABEL.exec(line);
|
|
256
|
-
const value = label === null ? "" : line.slice(label[0].length);
|
|
257
|
-
const rest = value.slice(name.length);
|
|
258
|
-
return value.startsWith(name) && NEXT_PART.test(rest) && [...rest].length <= SLACK * 2 && !CLOSES_SENTENCE.test(rest.slice(1));
|
|
259
|
-
};
|
|
260
|
-
|
|
261
242
|
/** A contact field's label: after a bullet or a number (1. 連絡先:), and as long as a label in English runs (Privacy Contact:). */
|
|
262
243
|
const CONTACT_LABEL = /^(?:(?:[-*+]|\d+[.)])\s+)?([^::。.]{1,40})[::]\s*/u;
|
|
263
244
|
const LABEL_MARKS = /[*_\s]+/gu;
|
|
@@ -288,17 +269,19 @@ const isContactField = (line: string, name: string, contactLabels: readonly stri
|
|
|
288
269
|
|
|
289
270
|
/**
|
|
290
271
|
* A line that holds the short name too (甲 株式会社みなと), little else than the long name (a signature block names both),
|
|
291
|
-
* or a field whose value is the name (Attention: …, 宛先:…): an address gives the name in full.
|
|
272
|
+
* or a field whose value is the name (Attention: …, 宛先:…), or a signature opening the closing block: an address gives the name in full.
|
|
292
273
|
*/
|
|
293
274
|
const isNameLine = (source: string, offset: number, name: string, term: string, contactLabels: readonly string[]): boolean => {
|
|
294
275
|
const start = source.lastIndexOf("\n", offset - 1) + 1;
|
|
295
|
-
const
|
|
296
|
-
const
|
|
276
|
+
const newline = source.indexOf("\n", offset);
|
|
277
|
+
const end = newline === -1 ? source.length : newline;
|
|
278
|
+
const line = source.slice(start, end).trim();
|
|
297
279
|
// The short name inside the long one ("Pinecone" in "Pinecone Software Ltd") is not the short name written beside it.
|
|
298
280
|
return (
|
|
299
281
|
line.replaceAll(name, "").includes(term) ||
|
|
300
282
|
[...line].length <= [...name].length + SLACK ||
|
|
301
283
|
isNameField(line, name) ||
|
|
284
|
+
(isSignatureLine(line, name) && opensClosingBlock(source, start, end)) ||
|
|
302
285
|
isContactField(line, name, contactLabels)
|
|
303
286
|
);
|
|
304
287
|
};
|