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.
Files changed (1320) hide show
  1. package/README.ja.md +330 -0
  2. package/README.md +124 -255
  3. package/dist/cli-text.js +2 -2
  4. package/dist/company-kana-spelling.d.ts +31 -0
  5. package/dist/company-kana-spelling.d.ts.map +1 -0
  6. package/dist/company-kana-spelling.js +79 -0
  7. package/dist/company-kana-spelling.js.map +1 -0
  8. package/dist/company-names.d.ts +32 -1
  9. package/dist/company-names.d.ts.map +1 -1
  10. package/dist/company-names.js +129 -22
  11. package/dist/company-names.js.map +1 -1
  12. package/dist/contacts/table-rows.d.ts +7 -0
  13. package/dist/contacts/table-rows.d.ts.map +1 -0
  14. package/dist/contacts/table-rows.js +42 -0
  15. package/dist/contacts/table-rows.js.map +1 -0
  16. package/dist/cross-run.d.ts.map +1 -1
  17. package/dist/cross-run.js +1 -0
  18. package/dist/cross-run.js.map +1 -1
  19. package/dist/derived/age-on-date.d.ts +53 -0
  20. package/dist/derived/age-on-date.d.ts.map +1 -0
  21. package/dist/derived/age-on-date.js +114 -0
  22. package/dist/derived/age-on-date.js.map +1 -0
  23. package/dist/derived/durations.d.ts +17 -2
  24. package/dist/derived/durations.d.ts.map +1 -1
  25. package/dist/derived/durations.js +61 -10
  26. package/dist/derived/durations.js.map +1 -1
  27. package/dist/derived/hours-and-minutes.d.ts +26 -0
  28. package/dist/derived/hours-and-minutes.d.ts.map +1 -0
  29. package/dist/derived/hours-and-minutes.js +24 -0
  30. package/dist/derived/hours-and-minutes.js.map +1 -0
  31. package/dist/derived/hyphenated-counts.d.ts +15 -0
  32. package/dist/derived/hyphenated-counts.d.ts.map +1 -0
  33. package/dist/derived/hyphenated-counts.js +31 -0
  34. package/dist/derived/hyphenated-counts.js.map +1 -0
  35. package/dist/derived/marked-dates.d.ts +15 -0
  36. package/dist/derived/marked-dates.d.ts.map +1 -0
  37. package/dist/derived/marked-dates.js +41 -0
  38. package/dist/derived/marked-dates.js.map +1 -0
  39. package/dist/derived/money-span.d.ts +9 -0
  40. package/dist/derived/money-span.d.ts.map +1 -0
  41. package/dist/derived/money-span.js +6 -0
  42. package/dist/derived/money-span.js.map +1 -0
  43. package/dist/derived/period-parts.d.ts +55 -0
  44. package/dist/derived/period-parts.d.ts.map +1 -0
  45. package/dist/derived/period-parts.js +283 -0
  46. package/dist/derived/period-parts.js.map +1 -0
  47. package/dist/derived/readable-date.d.ts +20 -0
  48. package/dist/derived/readable-date.d.ts.map +1 -0
  49. package/dist/derived/readable-date.js +50 -0
  50. package/dist/derived/readable-date.js.map +1 -0
  51. package/dist/derived/stays.d.ts +3 -1
  52. package/dist/derived/stays.d.ts.map +1 -1
  53. package/dist/derived/stays.js +3 -0
  54. package/dist/derived/stays.js.map +1 -1
  55. package/dist/derived/timesheet-hours.d.ts +27 -0
  56. package/dist/derived/timesheet-hours.d.ts.map +1 -0
  57. package/dist/derived/timesheet-hours.js +86 -0
  58. package/dist/derived/timesheet-hours.js.map +1 -0
  59. package/dist/derived/use-maximum.d.ts +27 -0
  60. package/dist/derived/use-maximum.d.ts.map +1 -0
  61. package/dist/derived/use-maximum.js +104 -0
  62. package/dist/derived/use-maximum.js.map +1 -0
  63. package/dist/derived/working-hours.d.ts +4 -5
  64. package/dist/derived/working-hours.d.ts.map +1 -1
  65. package/dist/detectors/agreement-slip.d.ts.map +1 -1
  66. package/dist/detectors/agreement-slip.js +4 -0
  67. package/dist/detectors/agreement-slip.js.map +1 -1
  68. package/dist/detectors/annual-holidays-mismatch.d.ts +3 -0
  69. package/dist/detectors/annual-holidays-mismatch.d.ts.map +1 -0
  70. package/dist/detectors/annual-holidays-mismatch.js +29 -0
  71. package/dist/detectors/annual-holidays-mismatch.js.map +1 -0
  72. package/dist/detectors/annual-pay-mismatch.d.ts +3 -0
  73. package/dist/detectors/annual-pay-mismatch.d.ts.map +1 -0
  74. package/dist/detectors/annual-pay-mismatch.js +52 -0
  75. package/dist/detectors/annual-pay-mismatch.js.map +1 -0
  76. package/dist/detectors/blank-structure.d.ts +3 -1
  77. package/dist/detectors/blank-structure.d.ts.map +1 -1
  78. package/dist/detectors/blank-structure.js +45 -12
  79. package/dist/detectors/blank-structure.js.map +1 -1
  80. package/dist/detectors/bmi-mismatch.d.ts +3 -0
  81. package/dist/detectors/bmi-mismatch.d.ts.map +1 -0
  82. package/dist/detectors/bmi-mismatch.js +70 -0
  83. package/dist/detectors/bmi-mismatch.js.map +1 -0
  84. package/dist/detectors/change-rate.d.ts.map +1 -1
  85. package/dist/detectors/change-rate.js +24 -9
  86. package/dist/detectors/change-rate.js.map +1 -1
  87. package/dist/detectors/closing-balance-mismatch.d.ts +3 -0
  88. package/dist/detectors/closing-balance-mismatch.d.ts.map +1 -0
  89. package/dist/detectors/closing-balance-mismatch.js +42 -0
  90. package/dist/detectors/closing-balance-mismatch.js.map +1 -0
  91. package/dist/detectors/contact-variant.d.ts.map +1 -1
  92. package/dist/detectors/contact-variant.js +6 -2
  93. package/dist/detectors/contact-variant.js.map +1 -1
  94. package/dist/detectors/cumulative-below-current.d.ts +3 -0
  95. package/dist/detectors/cumulative-below-current.d.ts.map +1 -0
  96. package/dist/detectors/cumulative-below-current.js +25 -0
  97. package/dist/detectors/cumulative-below-current.js.map +1 -0
  98. package/dist/detectors/currency-column.d.ts +3 -0
  99. package/dist/detectors/currency-column.d.ts.map +1 -0
  100. package/dist/detectors/currency-column.js +32 -0
  101. package/dist/detectors/currency-column.js.map +1 -0
  102. package/dist/detectors/date-any-year.d.ts +24 -0
  103. package/dist/detectors/date-any-year.d.ts.map +1 -0
  104. package/dist/detectors/date-any-year.js +103 -0
  105. package/dist/detectors/date-any-year.js.map +1 -0
  106. package/dist/detectors/date-outside-period.d.ts.map +1 -1
  107. package/dist/detectors/date-outside-period.js +4 -10
  108. package/dist/detectors/date-outside-period.js.map +1 -1
  109. package/dist/detectors/date-stamp-order.d.ts.map +1 -1
  110. package/dist/detectors/date-stamp-order.js +2 -1
  111. package/dist/detectors/date-stamp-order.js.map +1 -1
  112. package/dist/detectors/date-year.d.ts +18 -6
  113. package/dist/detectors/date-year.d.ts.map +1 -1
  114. package/dist/detectors/date-year.js +39 -11
  115. package/dist/detectors/date-year.js.map +1 -1
  116. package/dist/detectors/deductible-exceeds-limit.d.ts +4 -0
  117. package/dist/detectors/deductible-exceeds-limit.d.ts.map +1 -0
  118. package/dist/detectors/deductible-exceeds-limit.js +46 -0
  119. package/dist/detectors/deductible-exceeds-limit.js.map +1 -0
  120. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  121. package/dist/detectors/defined-term-form.js +6 -20
  122. package/dist/detectors/defined-term-form.js.map +1 -1
  123. package/dist/detectors/derived-numbers.d.ts +4 -3
  124. package/dist/detectors/derived-numbers.d.ts.map +1 -1
  125. package/dist/detectors/derived-numbers.js +43 -70
  126. package/dist/detectors/derived-numbers.js.map +1 -1
  127. package/dist/detectors/discount-rate.d.ts +3 -0
  128. package/dist/detectors/discount-rate.d.ts.map +1 -0
  129. package/dist/detectors/discount-rate.js +35 -0
  130. package/dist/detectors/discount-rate.js.map +1 -0
  131. package/dist/detectors/due-date.d.ts.map +1 -1
  132. package/dist/detectors/due-date.js +11 -4
  133. package/dist/detectors/due-date.js.map +1 -1
  134. package/dist/detectors/email-letter.d.ts +10 -2
  135. package/dist/detectors/email-letter.d.ts.map +1 -1
  136. package/dist/detectors/email-letter.js +24 -5
  137. package/dist/detectors/email-letter.js.map +1 -1
  138. package/dist/detectors/event-deadline.d.ts.map +1 -1
  139. package/dist/detectors/event-deadline.js +11 -2
  140. package/dist/detectors/event-deadline.js.map +1 -1
  141. package/dist/detectors/fact-consistency.d.ts.map +1 -1
  142. package/dist/detectors/fact-consistency.js +112 -5
  143. package/dist/detectors/fact-consistency.js.map +1 -1
  144. package/dist/detectors/formula-amount.d.ts +3 -0
  145. package/dist/detectors/formula-amount.d.ts.map +1 -0
  146. package/dist/detectors/formula-amount.js +41 -0
  147. package/dist/detectors/formula-amount.js.map +1 -0
  148. package/dist/detectors/gloss-year.d.ts +11 -0
  149. package/dist/detectors/gloss-year.d.ts.map +1 -0
  150. package/dist/detectors/gloss-year.js +14 -0
  151. package/dist/detectors/gloss-year.js.map +1 -0
  152. package/dist/detectors/gpa-mismatch.d.ts +3 -0
  153. package/dist/detectors/gpa-mismatch.d.ts.map +1 -0
  154. package/dist/detectors/gpa-mismatch.js +39 -0
  155. package/dist/detectors/gpa-mismatch.js.map +1 -0
  156. package/dist/detectors/impossible-date.d.ts.map +1 -1
  157. package/dist/detectors/impossible-date.js +22 -6
  158. package/dist/detectors/impossible-date.js.map +1 -1
  159. package/dist/detectors/installment-total-mismatch.d.ts +3 -0
  160. package/dist/detectors/installment-total-mismatch.d.ts.map +1 -0
  161. package/dist/detectors/installment-total-mismatch.js +68 -0
  162. package/dist/detectors/installment-total-mismatch.js.map +1 -0
  163. package/dist/detectors/interest.d.ts +3 -0
  164. package/dist/detectors/interest.d.ts.map +1 -0
  165. package/dist/detectors/interest.js +38 -0
  166. package/dist/detectors/interest.js.map +1 -0
  167. package/dist/detectors/lab-columns.d.ts +4 -0
  168. package/dist/detectors/lab-columns.d.ts.map +1 -0
  169. package/dist/detectors/lab-columns.js +3 -0
  170. package/dist/detectors/lab-columns.js.map +1 -0
  171. package/dist/detectors/labelled-age.d.ts +4 -0
  172. package/dist/detectors/labelled-age.d.ts.map +1 -0
  173. package/dist/detectors/labelled-age.js +110 -0
  174. package/dist/detectors/labelled-age.js.map +1 -0
  175. package/dist/detectors/line-amount.d.ts.map +1 -1
  176. package/dist/detectors/line-amount.js +45 -2
  177. package/dist/detectors/line-amount.js.map +1 -1
  178. package/dist/detectors/measured-facts.d.ts +1 -1
  179. package/dist/detectors/measured-facts.d.ts.map +1 -1
  180. package/dist/detectors/measured-facts.js.map +1 -1
  181. package/dist/detectors/meter-usage.d.ts +3 -0
  182. package/dist/detectors/meter-usage.d.ts.map +1 -0
  183. package/dist/detectors/meter-usage.js +37 -0
  184. package/dist/detectors/meter-usage.js.map +1 -0
  185. package/dist/detectors/name-field.d.ts +13 -0
  186. package/dist/detectors/name-field.d.ts.map +1 -0
  187. package/dist/detectors/name-field.js +38 -0
  188. package/dist/detectors/name-field.js.map +1 -0
  189. package/dist/detectors/name-variant.d.ts.map +1 -1
  190. package/dist/detectors/name-variant.js +128 -14
  191. package/dist/detectors/name-variant.js.map +1 -1
  192. package/dist/detectors/net-amount-mismatch.d.ts +10 -0
  193. package/dist/detectors/net-amount-mismatch.d.ts.map +1 -0
  194. package/dist/detectors/net-amount-mismatch.js +70 -0
  195. package/dist/detectors/net-amount-mismatch.js.map +1 -0
  196. package/dist/detectors/net-gross-weight.d.ts +3 -0
  197. package/dist/detectors/net-gross-weight.d.ts.map +1 -0
  198. package/dist/detectors/net-gross-weight.js +35 -0
  199. package/dist/detectors/net-gross-weight.js.map +1 -0
  200. package/dist/detectors/nominal-step.d.ts +3 -0
  201. package/dist/detectors/nominal-step.d.ts.map +1 -0
  202. package/dist/detectors/nominal-step.js +28 -0
  203. package/dist/detectors/nominal-step.js.map +1 -0
  204. package/dist/detectors/number-style.d.ts +2 -0
  205. package/dist/detectors/number-style.d.ts.map +1 -1
  206. package/dist/detectors/number-style.js +8 -2
  207. package/dist/detectors/number-style.js.map +1 -1
  208. package/dist/detectors/order-quantity.d.ts +10 -0
  209. package/dist/detectors/order-quantity.d.ts.map +1 -0
  210. package/dist/detectors/order-quantity.js +35 -0
  211. package/dist/detectors/order-quantity.js.map +1 -0
  212. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  213. package/dist/detectors/orthographic-variant.js +37 -11
  214. package/dist/detectors/orthographic-variant.js.map +1 -1
  215. package/dist/detectors/orthography.d.ts.map +1 -1
  216. package/dist/detectors/orthography.js +15 -7
  217. package/dist/detectors/orthography.js.map +1 -1
  218. package/dist/detectors/period-label-conflict.d.ts +4 -0
  219. package/dist/detectors/period-label-conflict.d.ts.map +1 -0
  220. package/dist/detectors/period-label-conflict.js +34 -0
  221. package/dist/detectors/period-label-conflict.js.map +1 -0
  222. package/dist/detectors/period-multiple-mismatch.d.ts +3 -0
  223. package/dist/detectors/period-multiple-mismatch.d.ts.map +1 -0
  224. package/dist/detectors/period-multiple-mismatch.js +36 -0
  225. package/dist/detectors/period-multiple-mismatch.js.map +1 -0
  226. package/dist/detectors/period-part.d.ts +4 -0
  227. package/dist/detectors/period-part.d.ts.map +1 -0
  228. package/dist/detectors/period-part.js +58 -0
  229. package/dist/detectors/period-part.js.map +1 -0
  230. package/dist/detectors/range-words.d.ts +5 -0
  231. package/dist/detectors/range-words.d.ts.map +1 -0
  232. package/dist/detectors/range-words.js +14 -0
  233. package/dist/detectors/range-words.js.map +1 -0
  234. package/dist/detectors/ratio-mismatch.d.ts +7 -0
  235. package/dist/detectors/ratio-mismatch.d.ts.map +1 -0
  236. package/dist/detectors/ratio-mismatch.js +89 -0
  237. package/dist/detectors/ratio-mismatch.js.map +1 -0
  238. package/dist/detectors/readable-dates.d.ts +9 -0
  239. package/dist/detectors/readable-dates.d.ts.map +1 -0
  240. package/dist/detectors/readable-dates.js +23 -0
  241. package/dist/detectors/readable-dates.js.map +1 -0
  242. package/dist/detectors/reference-flag.d.ts +3 -0
  243. package/dist/detectors/reference-flag.d.ts.map +1 -0
  244. package/dist/detectors/reference-flag.js +31 -0
  245. package/dist/detectors/reference-flag.js.map +1 -0
  246. package/dist/detectors/reference-number-repeated.d.ts +3 -0
  247. package/dist/detectors/reference-number-repeated.d.ts.map +1 -0
  248. package/dist/detectors/reference-number-repeated.js +22 -0
  249. package/dist/detectors/reference-number-repeated.js.map +1 -0
  250. package/dist/detectors/reference-number-variant.d.ts +3 -0
  251. package/dist/detectors/reference-number-variant.d.ts.map +1 -0
  252. package/dist/detectors/reference-number-variant.js +40 -0
  253. package/dist/detectors/reference-number-variant.js.map +1 -0
  254. package/dist/detectors/reference-unit.d.ts +3 -0
  255. package/dist/detectors/reference-unit.d.ts.map +1 -0
  256. package/dist/detectors/reference-unit.js +19 -0
  257. package/dist/detectors/reference-unit.js.map +1 -0
  258. package/dist/detectors/registry/annual-holidays-mismatch.d.ts +3 -0
  259. package/dist/detectors/registry/annual-holidays-mismatch.d.ts.map +1 -0
  260. package/dist/detectors/registry/annual-holidays-mismatch.js +3 -0
  261. package/dist/detectors/registry/annual-holidays-mismatch.js.map +1 -0
  262. package/dist/detectors/registry/annual-pay-mismatch.d.ts +3 -0
  263. package/dist/detectors/registry/annual-pay-mismatch.d.ts.map +1 -0
  264. package/dist/detectors/registry/annual-pay-mismatch.js +3 -0
  265. package/dist/detectors/registry/annual-pay-mismatch.js.map +1 -0
  266. package/dist/detectors/registry/backorder-mismatch.d.ts +3 -0
  267. package/dist/detectors/registry/backorder-mismatch.d.ts.map +1 -0
  268. package/dist/detectors/registry/backorder-mismatch.js +3 -0
  269. package/dist/detectors/registry/backorder-mismatch.js.map +1 -0
  270. package/dist/detectors/registry/bmi-mismatch.d.ts +3 -0
  271. package/dist/detectors/registry/bmi-mismatch.d.ts.map +1 -0
  272. package/dist/detectors/registry/bmi-mismatch.js +3 -0
  273. package/dist/detectors/registry/bmi-mismatch.js.map +1 -0
  274. package/dist/detectors/registry/closing-balance-mismatch.d.ts +3 -0
  275. package/dist/detectors/registry/closing-balance-mismatch.d.ts.map +1 -0
  276. package/dist/detectors/registry/closing-balance-mismatch.js +3 -0
  277. package/dist/detectors/registry/closing-balance-mismatch.js.map +1 -0
  278. package/dist/detectors/registry/cumulative-below-current.d.ts +3 -0
  279. package/dist/detectors/registry/cumulative-below-current.d.ts.map +1 -0
  280. package/dist/detectors/registry/cumulative-below-current.js +3 -0
  281. package/dist/detectors/registry/cumulative-below-current.js.map +1 -0
  282. package/dist/detectors/registry/currency-column-mix.d.ts +3 -0
  283. package/dist/detectors/registry/currency-column-mix.d.ts.map +1 -0
  284. package/dist/detectors/registry/currency-column-mix.js +3 -0
  285. package/dist/detectors/registry/currency-column-mix.js.map +1 -0
  286. package/dist/detectors/registry/deductible-exceeds-limit.d.ts +3 -0
  287. package/dist/detectors/registry/deductible-exceeds-limit.d.ts.map +1 -0
  288. package/dist/detectors/registry/deductible-exceeds-limit.js +3 -0
  289. package/dist/detectors/registry/deductible-exceeds-limit.js.map +1 -0
  290. package/dist/detectors/registry/delivered-over-ordered.d.ts +3 -0
  291. package/dist/detectors/registry/delivered-over-ordered.d.ts.map +1 -0
  292. package/dist/detectors/registry/delivered-over-ordered.js +3 -0
  293. package/dist/detectors/registry/delivered-over-ordered.js.map +1 -0
  294. package/dist/detectors/registry/discount-rate.d.ts +3 -0
  295. package/dist/detectors/registry/discount-rate.d.ts.map +1 -0
  296. package/dist/detectors/registry/discount-rate.js +3 -0
  297. package/dist/detectors/registry/discount-rate.js.map +1 -0
  298. package/dist/detectors/registry/elapsed-years-mismatch.js +1 -1
  299. package/dist/detectors/registry/elapsed-years-mismatch.js.map +1 -1
  300. package/dist/detectors/registry/formula-amount.d.ts +3 -0
  301. package/dist/detectors/registry/formula-amount.d.ts.map +1 -0
  302. package/dist/detectors/registry/formula-amount.js +3 -0
  303. package/dist/detectors/registry/formula-amount.js.map +1 -0
  304. package/dist/detectors/registry/gpa-mismatch.d.ts +3 -0
  305. package/dist/detectors/registry/gpa-mismatch.d.ts.map +1 -0
  306. package/dist/detectors/registry/gpa-mismatch.js +3 -0
  307. package/dist/detectors/registry/gpa-mismatch.js.map +1 -0
  308. package/dist/detectors/registry/installment-total-mismatch.d.ts +3 -0
  309. package/dist/detectors/registry/installment-total-mismatch.d.ts.map +1 -0
  310. package/dist/detectors/registry/installment-total-mismatch.js +3 -0
  311. package/dist/detectors/registry/installment-total-mismatch.js.map +1 -0
  312. package/dist/detectors/registry/interest.d.ts +3 -0
  313. package/dist/detectors/registry/interest.d.ts.map +1 -0
  314. package/dist/detectors/registry/interest.js +3 -0
  315. package/dist/detectors/registry/interest.js.map +1 -0
  316. package/dist/detectors/registry/meter-usage.d.ts +3 -0
  317. package/dist/detectors/registry/meter-usage.d.ts.map +1 -0
  318. package/dist/detectors/registry/meter-usage.js +3 -0
  319. package/dist/detectors/registry/meter-usage.js.map +1 -0
  320. package/dist/detectors/registry/net-amount-mismatch.d.ts +3 -0
  321. package/dist/detectors/registry/net-amount-mismatch.d.ts.map +1 -0
  322. package/dist/detectors/registry/net-amount-mismatch.js +3 -0
  323. package/dist/detectors/registry/net-amount-mismatch.js.map +1 -0
  324. package/dist/detectors/registry/net-over-gross.d.ts +3 -0
  325. package/dist/detectors/registry/net-over-gross.d.ts.map +1 -0
  326. package/dist/detectors/registry/net-over-gross.js +3 -0
  327. package/dist/detectors/registry/net-over-gross.js.map +1 -0
  328. package/dist/detectors/registry/period-label-conflict.d.ts +3 -0
  329. package/dist/detectors/registry/period-label-conflict.d.ts.map +1 -0
  330. package/dist/detectors/registry/period-label-conflict.js +3 -0
  331. package/dist/detectors/registry/period-label-conflict.js.map +1 -0
  332. package/dist/detectors/registry/period-multiple-mismatch.d.ts +3 -0
  333. package/dist/detectors/registry/period-multiple-mismatch.d.ts.map +1 -0
  334. package/dist/detectors/registry/period-multiple-mismatch.js +3 -0
  335. package/dist/detectors/registry/period-multiple-mismatch.js.map +1 -0
  336. package/dist/detectors/registry/period-part-exceeds-whole.d.ts +3 -0
  337. package/dist/detectors/registry/period-part-exceeds-whole.d.ts.map +1 -0
  338. package/dist/detectors/registry/period-part-exceeds-whole.js +3 -0
  339. package/dist/detectors/registry/period-part-exceeds-whole.js.map +1 -0
  340. package/dist/detectors/registry/product-exceeds-maximum.d.ts +3 -0
  341. package/dist/detectors/registry/product-exceeds-maximum.d.ts.map +1 -0
  342. package/dist/detectors/registry/product-exceeds-maximum.js +3 -0
  343. package/dist/detectors/registry/product-exceeds-maximum.js.map +1 -0
  344. package/dist/detectors/registry/ratio-mismatch.d.ts +3 -0
  345. package/dist/detectors/registry/ratio-mismatch.d.ts.map +1 -0
  346. package/dist/detectors/registry/ratio-mismatch.js +3 -0
  347. package/dist/detectors/registry/ratio-mismatch.js.map +1 -0
  348. package/dist/detectors/registry/reference-flag-mismatch.d.ts +3 -0
  349. package/dist/detectors/registry/reference-flag-mismatch.d.ts.map +1 -0
  350. package/dist/detectors/registry/reference-flag-mismatch.js +3 -0
  351. package/dist/detectors/registry/reference-flag-mismatch.js.map +1 -0
  352. package/dist/detectors/registry/reference-number-repeated.d.ts +3 -0
  353. package/dist/detectors/registry/reference-number-repeated.d.ts.map +1 -0
  354. package/dist/detectors/registry/reference-number-repeated.js +3 -0
  355. package/dist/detectors/registry/reference-number-repeated.js.map +1 -0
  356. package/dist/detectors/registry/reference-number-variant.d.ts +3 -0
  357. package/dist/detectors/registry/reference-number-variant.d.ts.map +1 -0
  358. package/dist/detectors/registry/reference-number-variant.js +3 -0
  359. package/dist/detectors/registry/reference-number-variant.js.map +1 -0
  360. package/dist/detectors/registry/reference-unit.d.ts +3 -0
  361. package/dist/detectors/registry/reference-unit.d.ts.map +1 -0
  362. package/dist/detectors/registry/reference-unit.js +3 -0
  363. package/dist/detectors/registry/reference-unit.js.map +1 -0
  364. package/dist/detectors/registry/revision-direction.d.ts +3 -0
  365. package/dist/detectors/registry/revision-direction.d.ts.map +1 -0
  366. package/dist/detectors/registry/revision-direction.js +3 -0
  367. package/dist/detectors/registry/revision-direction.js.map +1 -0
  368. package/dist/detectors/registry/running-balance.d.ts +3 -0
  369. package/dist/detectors/registry/running-balance.d.ts.map +1 -0
  370. package/dist/detectors/registry/running-balance.js +3 -0
  371. package/dist/detectors/registry/running-balance.js.map +1 -0
  372. package/dist/detectors/registry/serial-range.d.ts +3 -0
  373. package/dist/detectors/registry/serial-range.d.ts.map +1 -0
  374. package/dist/detectors/registry/serial-range.js +3 -0
  375. package/dist/detectors/registry/serial-range.js.map +1 -0
  376. package/dist/detectors/registry/share-amount.d.ts +3 -0
  377. package/dist/detectors/registry/share-amount.d.ts.map +1 -0
  378. package/dist/detectors/registry/share-amount.js +3 -0
  379. package/dist/detectors/registry/share-amount.js.map +1 -0
  380. package/dist/detectors/registry/table-unit-mix.d.ts +3 -0
  381. package/dist/detectors/registry/table-unit-mix.d.ts.map +1 -0
  382. package/dist/detectors/registry/table-unit-mix.js +3 -0
  383. package/dist/detectors/registry/table-unit-mix.js.map +1 -0
  384. package/dist/detectors/registry/tier-threshold.d.ts +3 -0
  385. package/dist/detectors/registry/tier-threshold.d.ts.map +1 -0
  386. package/dist/detectors/registry/tier-threshold.js +3 -0
  387. package/dist/detectors/registry/tier-threshold.js.map +1 -0
  388. package/dist/detectors/registry/variance-mismatch.d.ts +3 -0
  389. package/dist/detectors/registry/variance-mismatch.d.ts.map +1 -0
  390. package/dist/detectors/registry/variance-mismatch.js +3 -0
  391. package/dist/detectors/registry/variance-mismatch.js.map +1 -0
  392. package/dist/detectors/relative-dates.d.ts.map +1 -1
  393. package/dist/detectors/relative-dates.js +2 -1
  394. package/dist/detectors/relative-dates.js.map +1 -1
  395. package/dist/detectors/relative-day-words.d.ts.map +1 -1
  396. package/dist/detectors/relative-day-words.js +2 -1
  397. package/dist/detectors/relative-day-words.js.map +1 -1
  398. package/dist/detectors/rent-multiple-mismatch.d.ts.map +1 -1
  399. package/dist/detectors/rent-multiple-mismatch.js.map +1 -1
  400. package/dist/detectors/request-owner.d.ts +3 -1
  401. package/dist/detectors/request-owner.d.ts.map +1 -1
  402. package/dist/detectors/request-owner.js +5 -2
  403. package/dist/detectors/request-owner.js.map +1 -1
  404. package/dist/detectors/revision-direction.d.ts +3 -0
  405. package/dist/detectors/revision-direction.d.ts.map +1 -0
  406. package/dist/detectors/revision-direction.js +32 -0
  407. package/dist/detectors/revision-direction.js.map +1 -0
  408. package/dist/detectors/row-sentence-amounts.d.ts +5 -0
  409. package/dist/detectors/row-sentence-amounts.d.ts.map +1 -0
  410. package/dist/detectors/row-sentence-amounts.js +71 -0
  411. package/dist/detectors/row-sentence-amounts.js.map +1 -0
  412. package/dist/detectors/running-balance.d.ts +3 -0
  413. package/dist/detectors/running-balance.d.ts.map +1 -0
  414. package/dist/detectors/running-balance.js +26 -0
  415. package/dist/detectors/running-balance.js.map +1 -0
  416. package/dist/detectors/scaled-quantity.js +1 -1
  417. package/dist/detectors/scaled-quantity.js.map +1 -1
  418. package/dist/detectors/serial-range.d.ts +3 -0
  419. package/dist/detectors/serial-range.d.ts.map +1 -0
  420. package/dist/detectors/serial-range.js +29 -0
  421. package/dist/detectors/serial-range.js.map +1 -0
  422. package/dist/detectors/share-amount.d.ts +3 -0
  423. package/dist/detectors/share-amount.d.ts.map +1 -0
  424. package/dist/detectors/share-amount.js +45 -0
  425. package/dist/detectors/share-amount.js.map +1 -0
  426. package/dist/detectors/structure-tree.d.ts +1 -1
  427. package/dist/detectors/structure-tree.d.ts.map +1 -1
  428. package/dist/detectors/structure-tree.js +46 -12
  429. package/dist/detectors/structure-tree.js.map +1 -1
  430. package/dist/detectors/table-scale.d.ts +3 -0
  431. package/dist/detectors/table-scale.d.ts.map +1 -0
  432. package/dist/detectors/table-scale.js +32 -0
  433. package/dist/detectors/table-scale.js.map +1 -0
  434. package/dist/detectors/tax-amount.d.ts.map +1 -1
  435. package/dist/detectors/tax-amount.js +34 -10
  436. package/dist/detectors/tax-amount.js.map +1 -1
  437. package/dist/detectors/technical-docs.d.ts +1 -1
  438. package/dist/detectors/technical-docs.d.ts.map +1 -1
  439. package/dist/detectors/technical-docs.js +3 -2
  440. package/dist/detectors/technical-docs.js.map +1 -1
  441. package/dist/detectors/tier-threshold.d.ts +3 -0
  442. package/dist/detectors/tier-threshold.d.ts.map +1 -0
  443. package/dist/detectors/tier-threshold.js +86 -0
  444. package/dist/detectors/tier-threshold.js.map +1 -0
  445. package/dist/detectors/time-order.d.ts +1 -0
  446. package/dist/detectors/time-order.d.ts.map +1 -1
  447. package/dist/detectors/time-order.js +43 -13
  448. package/dist/detectors/time-order.js.map +1 -1
  449. package/dist/detectors/use-maximum.d.ts +3 -0
  450. package/dist/detectors/use-maximum.d.ts.map +1 -0
  451. package/dist/detectors/use-maximum.js +32 -0
  452. package/dist/detectors/use-maximum.js.map +1 -0
  453. package/dist/detectors/variance.d.ts +3 -0
  454. package/dist/detectors/variance.d.ts.map +1 -0
  455. package/dist/detectors/variance.js +28 -0
  456. package/dist/detectors/variance.js.map +1 -0
  457. package/dist/detectors/whole-count-findings.d.ts +4 -0
  458. package/dist/detectors/whole-count-findings.d.ts.map +1 -0
  459. package/dist/detectors/whole-count-findings.js +38 -0
  460. package/dist/detectors/whole-count-findings.js.map +1 -0
  461. package/dist/detectors/working-hours-findings.d.ts +9 -0
  462. package/dist/detectors/working-hours-findings.d.ts.map +1 -0
  463. package/dist/detectors/working-hours-findings.js +79 -0
  464. package/dist/detectors/working-hours-findings.js.map +1 -0
  465. package/dist/eval.js +3 -3
  466. package/dist/eval.js.map +1 -1
  467. package/dist/facts/age-values.d.ts +22 -0
  468. package/dist/facts/age-values.d.ts.map +1 -0
  469. package/dist/facts/age-values.js +76 -0
  470. package/dist/facts/age-values.js.map +1 -0
  471. package/dist/facts/cell-keys.d.ts +12 -0
  472. package/dist/facts/cell-keys.d.ts.map +1 -0
  473. package/dist/facts/cell-keys.js +19 -0
  474. package/dist/facts/cell-keys.js.map +1 -0
  475. package/dist/facts/count-labels.d.ts +15 -0
  476. package/dist/facts/count-labels.d.ts.map +1 -0
  477. package/dist/facts/count-labels.js +19 -0
  478. package/dist/facts/count-labels.js.map +1 -0
  479. package/dist/facts/document-terms.d.ts +43 -0
  480. package/dist/facts/document-terms.d.ts.map +1 -0
  481. package/dist/facts/document-terms.js +74 -0
  482. package/dist/facts/document-terms.js.map +1 -0
  483. package/dist/facts/duration-scale.d.ts +11 -0
  484. package/dist/facts/duration-scale.d.ts.map +1 -0
  485. package/dist/facts/duration-scale.js +14 -0
  486. package/dist/facts/duration-scale.js.map +1 -0
  487. package/dist/facts/duration-values.d.ts +15 -0
  488. package/dist/facts/duration-values.d.ts.map +1 -0
  489. package/dist/facts/duration-values.js +29 -0
  490. package/dist/facts/duration-values.js.map +1 -0
  491. package/dist/facts/fact-values.d.ts +9 -1
  492. package/dist/facts/fact-values.d.ts.map +1 -1
  493. package/dist/facts/fact-values.js +19 -6
  494. package/dist/facts/fact-values.js.map +1 -1
  495. package/dist/facts/labelled-facts.d.ts +15 -1
  496. package/dist/facts/labelled-facts.d.ts.map +1 -1
  497. package/dist/facts/labelled-facts.js +51 -8
  498. package/dist/facts/labelled-facts.js.map +1 -1
  499. package/dist/facts/measure-units.d.ts.map +1 -1
  500. package/dist/facts/measure-units.js +23 -8
  501. package/dist/facts/measure-units.js.map +1 -1
  502. package/dist/facts/measures.js +11 -9
  503. package/dist/facts/measures.js.map +1 -1
  504. package/dist/facts/qualified-labels.d.ts +28 -0
  505. package/dist/facts/qualified-labels.d.ts.map +1 -0
  506. package/dist/facts/qualified-labels.js +96 -0
  507. package/dist/facts/qualified-labels.js.map +1 -0
  508. package/dist/facts/rate-values.d.ts +40 -0
  509. package/dist/facts/rate-values.d.ts.map +1 -0
  510. package/dist/facts/rate-values.js +68 -0
  511. package/dist/facts/rate-values.js.map +1 -0
  512. package/dist/facts/row-sentence-amounts.d.ts +51 -0
  513. package/dist/facts/row-sentence-amounts.d.ts.map +1 -0
  514. package/dist/facts/row-sentence-amounts.js +71 -0
  515. package/dist/facts/row-sentence-amounts.js.map +1 -0
  516. package/dist/facts/superscript-power.d.ts +3 -0
  517. package/dist/facts/superscript-power.d.ts.map +1 -0
  518. package/dist/facts/superscript-power.js +5 -0
  519. package/dist/facts/superscript-power.js.map +1 -0
  520. package/dist/facts/table-facts.d.ts +18 -2
  521. package/dist/facts/table-facts.d.ts.map +1 -1
  522. package/dist/facts/table-facts.js +16 -6
  523. package/dist/facts/table-facts.js.map +1 -1
  524. package/dist/facts/term-values.d.ts +34 -0
  525. package/dist/facts/term-values.d.ts.map +1 -0
  526. package/dist/facts/term-values.js +195 -0
  527. package/dist/facts/term-values.js.map +1 -0
  528. package/dist/facts/unit-word.d.ts +5 -0
  529. package/dist/facts/unit-word.d.ts.map +1 -1
  530. package/dist/facts/unit-word.js +9 -0
  531. package/dist/facts/unit-word.js.map +1 -1
  532. package/dist/facts/verb-quantity-facts.d.ts +22 -0
  533. package/dist/facts/verb-quantity-facts.d.ts.map +1 -0
  534. package/dist/facts/verb-quantity-facts.js +58 -0
  535. package/dist/facts/verb-quantity-facts.js.map +1 -0
  536. package/dist/facts/whole-counts.d.ts +58 -0
  537. package/dist/facts/whole-counts.d.ts.map +1 -0
  538. package/dist/facts/whole-counts.js +118 -0
  539. package/dist/facts/whole-counts.js.map +1 -0
  540. package/dist/fix-plan/text.js +2 -2
  541. package/dist/fix-plan/text.js.map +1 -1
  542. package/dist/lexicon-genres.d.ts +7 -0
  543. package/dist/lexicon-genres.d.ts.map +1 -0
  544. package/dist/lexicon-genres.js +8 -0
  545. package/dist/lexicon-genres.js.map +1 -0
  546. package/dist/name-char-reading.d.ts +16 -0
  547. package/dist/name-char-reading.d.ts.map +1 -0
  548. package/dist/name-char-reading.js +18 -0
  549. package/dist/name-char-reading.js.map +1 -0
  550. package/dist/name-line-block.d.ts +6 -0
  551. package/dist/name-line-block.d.ts.map +1 -0
  552. package/dist/name-line-block.js +35 -0
  553. package/dist/name-line-block.js.map +1 -0
  554. package/dist/name-lookalike-chars.d.ts +16 -0
  555. package/dist/name-lookalike-chars.d.ts.map +1 -0
  556. package/dist/name-lookalike-chars.js +41 -0
  557. package/dist/name-lookalike-chars.js.map +1 -0
  558. package/dist/name-neighbours.d.ts +7 -0
  559. package/dist/name-neighbours.d.ts.map +1 -0
  560. package/dist/name-neighbours.js +55 -0
  561. package/dist/name-neighbours.js.map +1 -0
  562. package/dist/name-ordinary-word.d.ts +13 -0
  563. package/dist/name-ordinary-word.d.ts.map +1 -0
  564. package/dist/name-ordinary-word.js +54 -0
  565. package/dist/name-ordinary-word.js.map +1 -0
  566. package/dist/name-person.d.ts +9 -0
  567. package/dist/name-person.d.ts.map +1 -0
  568. package/dist/name-person.js +25 -0
  569. package/dist/name-person.js.map +1 -0
  570. package/dist/name-separator.d.ts +14 -0
  571. package/dist/name-separator.d.ts.map +1 -0
  572. package/dist/name-separator.js +33 -0
  573. package/dist/name-separator.js.map +1 -0
  574. package/dist/name-variants.d.ts +8 -8
  575. package/dist/name-variants.d.ts.map +1 -1
  576. package/dist/name-variants.js +28 -81
  577. package/dist/name-variants.js.map +1 -1
  578. package/dist/name-weight.d.ts +10 -0
  579. package/dist/name-weight.d.ts.map +1 -0
  580. package/dist/name-weight.js +7 -0
  581. package/dist/name-weight.js.map +1 -0
  582. package/dist/person-field.d.ts +6 -0
  583. package/dist/person-field.d.ts.map +1 -0
  584. package/dist/person-field.js +40 -0
  585. package/dist/person-field.js.map +1 -0
  586. package/dist/person-full-name.d.ts +12 -0
  587. package/dist/person-full-name.d.ts.map +1 -0
  588. package/dist/person-full-name.js +52 -0
  589. package/dist/person-full-name.js.map +1 -0
  590. package/dist/phone-numbers.d.ts +23 -3
  591. package/dist/phone-numbers.d.ts.map +1 -1
  592. package/dist/phone-numbers.js +49 -21
  593. package/dist/phone-numbers.js.map +1 -1
  594. package/dist/plugin.d.ts +8 -0
  595. package/dist/plugin.d.ts.map +1 -1
  596. package/dist/product-names.d.ts +33 -0
  597. package/dist/product-names.d.ts.map +1 -0
  598. package/dist/product-names.js +74 -0
  599. package/dist/product-names.js.map +1 -0
  600. package/dist/profile/parse.d.ts.map +1 -1
  601. package/dist/profile/parse.js +5 -0
  602. package/dist/profile/parse.js.map +1 -1
  603. package/dist/reference-numbers.d.ts +26 -0
  604. package/dist/reference-numbers.d.ts.map +1 -0
  605. package/dist/reference-numbers.js +43 -0
  606. package/dist/reference-numbers.js.map +1 -0
  607. package/dist/run.d.ts.map +1 -1
  608. package/dist/run.js +1 -0
  609. package/dist/run.js.map +1 -1
  610. package/dist/spaced-person-name.d.ts +17 -0
  611. package/dist/spaced-person-name.d.ts.map +1 -0
  612. package/dist/spaced-person-name.js +82 -0
  613. package/dist/spaced-person-name.js.map +1 -0
  614. package/dist/spacing-code.d.ts +1 -0
  615. package/dist/spacing-code.d.ts.map +1 -1
  616. package/dist/spacing-code.js +15 -1
  617. package/dist/spacing-code.js.map +1 -1
  618. package/dist/structure/annual-holidays.d.ts +56 -0
  619. package/dist/structure/annual-holidays.d.ts.map +1 -0
  620. package/dist/structure/annual-holidays.js +159 -0
  621. package/dist/structure/annual-holidays.js.map +1 -0
  622. package/dist/structure/annual-pay.d.ts +97 -0
  623. package/dist/structure/annual-pay.d.ts.map +1 -0
  624. package/dist/structure/annual-pay.js +236 -0
  625. package/dist/structure/annual-pay.js.map +1 -0
  626. package/dist/structure/bmi.d.ts +63 -0
  627. package/dist/structure/bmi.d.ts.map +1 -0
  628. package/dist/structure/bmi.js +106 -0
  629. package/dist/structure/bmi.js.map +1 -0
  630. package/dist/structure/change-rate-table.d.ts +46 -0
  631. package/dist/structure/change-rate-table.d.ts.map +1 -0
  632. package/dist/structure/change-rate-table.js +110 -0
  633. package/dist/structure/change-rate-table.js.map +1 -0
  634. package/dist/structure/change-rate.d.ts +13 -1
  635. package/dist/structure/change-rate.d.ts.map +1 -1
  636. package/dist/structure/change-rate.js +51 -19
  637. package/dist/structure/change-rate.js.map +1 -1
  638. package/dist/structure/closing-balance.d.ts +24 -0
  639. package/dist/structure/closing-balance.d.ts.map +1 -0
  640. package/dist/structure/closing-balance.js +79 -0
  641. package/dist/structure/closing-balance.js.map +1 -0
  642. package/dist/structure/column-date-order.d.ts +5 -0
  643. package/dist/structure/column-date-order.d.ts.map +1 -0
  644. package/dist/structure/column-date-order.js +57 -0
  645. package/dist/structure/column-date-order.js.map +1 -0
  646. package/dist/structure/compound-hours.d.ts +5 -0
  647. package/dist/structure/compound-hours.d.ts.map +1 -0
  648. package/dist/structure/compound-hours.js +45 -0
  649. package/dist/structure/compound-hours.js.map +1 -0
  650. package/dist/structure/cumulative-below-current.d.ts +21 -0
  651. package/dist/structure/cumulative-below-current.d.ts.map +1 -0
  652. package/dist/structure/cumulative-below-current.js +48 -0
  653. package/dist/structure/cumulative-below-current.js.map +1 -0
  654. package/dist/structure/currency-column.d.ts +21 -0
  655. package/dist/structure/currency-column.d.ts.map +1 -0
  656. package/dist/structure/currency-column.js +74 -0
  657. package/dist/structure/currency-column.js.map +1 -0
  658. package/dist/structure/date-deadline-mark.d.ts +15 -0
  659. package/dist/structure/date-deadline-mark.d.ts.map +1 -0
  660. package/dist/structure/date-deadline-mark.js +22 -0
  661. package/dist/structure/date-deadline-mark.js.map +1 -0
  662. package/dist/structure/date-outside-period.d.ts +5 -1
  663. package/dist/structure/date-outside-period.d.ts.map +1 -1
  664. package/dist/structure/date-outside-period.js +13 -9
  665. package/dist/structure/date-outside-period.js.map +1 -1
  666. package/dist/structure/date-range.d.ts +5 -3
  667. package/dist/structure/date-range.d.ts.map +1 -1
  668. package/dist/structure/date-range.js +7 -9
  669. package/dist/structure/date-range.js.map +1 -1
  670. package/dist/structure/deadline-after-event.d.ts +35 -2
  671. package/dist/structure/deadline-after-event.d.ts.map +1 -1
  672. package/dist/structure/deadline-after-event.js +77 -6
  673. package/dist/structure/deadline-after-event.js.map +1 -1
  674. package/dist/structure/deductible-limit.d.ts +69 -0
  675. package/dist/structure/deductible-limit.d.ts.map +1 -0
  676. package/dist/structure/deductible-limit.js +191 -0
  677. package/dist/structure/deductible-limit.js.map +1 -0
  678. package/dist/structure/discount-rate.d.ts +35 -0
  679. package/dist/structure/discount-rate.d.ts.map +1 -0
  680. package/dist/structure/discount-rate.js +172 -0
  681. package/dist/structure/discount-rate.js.map +1 -0
  682. package/dist/structure/formula-amount.d.ts +38 -0
  683. package/dist/structure/formula-amount.d.ts.map +1 -0
  684. package/dist/structure/formula-amount.js +187 -0
  685. package/dist/structure/formula-amount.js.map +1 -0
  686. package/dist/structure/generic-role.d.ts +2 -0
  687. package/dist/structure/generic-role.d.ts.map +1 -0
  688. package/dist/structure/generic-role.js +8 -0
  689. package/dist/structure/generic-role.js.map +1 -0
  690. package/dist/structure/gpa.d.ts +74 -0
  691. package/dist/structure/gpa.d.ts.map +1 -0
  692. package/dist/structure/gpa.js +170 -0
  693. package/dist/structure/gpa.js.map +1 -0
  694. package/dist/structure/installment-fee.d.ts +52 -0
  695. package/dist/structure/installment-fee.d.ts.map +1 -0
  696. package/dist/structure/installment-fee.js +110 -0
  697. package/dist/structure/installment-fee.js.map +1 -0
  698. package/dist/structure/installment-total.d.ts +117 -0
  699. package/dist/structure/installment-total.d.ts.map +1 -0
  700. package/dist/structure/installment-total.js +224 -0
  701. package/dist/structure/installment-total.js.map +1 -0
  702. package/dist/structure/interest.d.ts +22 -0
  703. package/dist/structure/interest.d.ts.map +1 -0
  704. package/dist/structure/interest.js +107 -0
  705. package/dist/structure/interest.js.map +1 -0
  706. package/dist/structure/key-value-row.d.ts +14 -0
  707. package/dist/structure/key-value-row.d.ts.map +1 -0
  708. package/dist/structure/key-value-row.js +38 -0
  709. package/dist/structure/key-value-row.js.map +1 -0
  710. package/dist/structure/lab-columns.d.ts +12 -0
  711. package/dist/structure/lab-columns.d.ts.map +1 -0
  712. package/dist/structure/lab-columns.js +11 -0
  713. package/dist/structure/lab-columns.js.map +1 -0
  714. package/dist/structure/labelled-date-order.d.ts +33 -16
  715. package/dist/structure/labelled-date-order.d.ts.map +1 -1
  716. package/dist/structure/labelled-date-order.js +38 -30
  717. package/dist/structure/labelled-date-order.js.map +1 -1
  718. package/dist/structure/labelled-order.d.ts +59 -0
  719. package/dist/structure/labelled-order.d.ts.map +1 -0
  720. package/dist/structure/labelled-order.js +65 -0
  721. package/dist/structure/labelled-order.js.map +1 -0
  722. package/dist/structure/labelled-time-order.d.ts +17 -0
  723. package/dist/structure/labelled-time-order.d.ts.map +1 -0
  724. package/dist/structure/labelled-time-order.js +79 -0
  725. package/dist/structure/labelled-time-order.js.map +1 -0
  726. package/dist/structure/line-amount-label.d.ts +31 -0
  727. package/dist/structure/line-amount-label.d.ts.map +1 -0
  728. package/dist/structure/line-amount-label.js +77 -0
  729. package/dist/structure/line-amount-label.js.map +1 -0
  730. package/dist/structure/line-amount-rate.d.ts +47 -0
  731. package/dist/structure/line-amount-rate.d.ts.map +1 -0
  732. package/dist/structure/line-amount-rate.js +141 -0
  733. package/dist/structure/line-amount-rate.js.map +1 -0
  734. package/dist/structure/line-amount-unit.d.ts +7 -0
  735. package/dist/structure/line-amount-unit.d.ts.map +1 -1
  736. package/dist/structure/line-amount-unit.js +11 -0
  737. package/dist/structure/line-amount-unit.js.map +1 -1
  738. package/dist/structure/line-amount.d.ts +33 -7
  739. package/dist/structure/line-amount.d.ts.map +1 -1
  740. package/dist/structure/line-amount.js +152 -42
  741. package/dist/structure/line-amount.js.map +1 -1
  742. package/dist/structure/meter-usage-read.d.ts +21 -0
  743. package/dist/structure/meter-usage-read.d.ts.map +1 -0
  744. package/dist/structure/meter-usage-read.js +116 -0
  745. package/dist/structure/meter-usage-read.js.map +1 -0
  746. package/dist/structure/meter-usage.d.ts +62 -0
  747. package/dist/structure/meter-usage.d.ts.map +1 -0
  748. package/dist/structure/meter-usage.js +157 -0
  749. package/dist/structure/meter-usage.js.map +1 -0
  750. package/dist/structure/net-amount.d.ts +81 -0
  751. package/dist/structure/net-amount.d.ts.map +1 -0
  752. package/dist/structure/net-amount.js +161 -0
  753. package/dist/structure/net-amount.js.map +1 -0
  754. package/dist/structure/net-gross-weight.d.ts +30 -0
  755. package/dist/structure/net-gross-weight.d.ts.map +1 -0
  756. package/dist/structure/net-gross-weight.js +79 -0
  757. package/dist/structure/net-gross-weight.js.map +1 -0
  758. package/dist/structure/order-quantity.d.ts +38 -0
  759. package/dist/structure/order-quantity.d.ts.map +1 -0
  760. package/dist/structure/order-quantity.js +104 -0
  761. package/dist/structure/order-quantity.js.map +1 -0
  762. package/dist/structure/party-role.d.ts.map +1 -1
  763. package/dist/structure/party-role.js +4 -1
  764. package/dist/structure/party-role.js.map +1 -1
  765. package/dist/structure/percent-sum.d.ts +2 -0
  766. package/dist/structure/percent-sum.d.ts.map +1 -1
  767. package/dist/structure/percent-sum.js +2 -0
  768. package/dist/structure/percent-sum.js.map +1 -1
  769. package/dist/structure/period-label-conflict.d.ts +52 -0
  770. package/dist/structure/period-label-conflict.d.ts.map +1 -0
  771. package/dist/structure/period-label-conflict.js +105 -0
  772. package/dist/structure/period-label-conflict.js.map +1 -0
  773. package/dist/structure/period-labels.d.ts +36 -0
  774. package/dist/structure/period-labels.d.ts.map +1 -0
  775. package/dist/structure/period-labels.js +86 -0
  776. package/dist/structure/period-labels.js.map +1 -0
  777. package/dist/structure/period-multiple.d.ts +46 -0
  778. package/dist/structure/period-multiple.d.ts.map +1 -0
  779. package/dist/structure/period-multiple.js +123 -0
  780. package/dist/structure/period-multiple.js.map +1 -0
  781. package/dist/structure/quantity-range.d.ts.map +1 -1
  782. package/dist/structure/quantity-range.js +1 -5
  783. package/dist/structure/quantity-range.js.map +1 -1
  784. package/dist/structure/range-bands.d.ts +2 -0
  785. package/dist/structure/range-bands.d.ts.map +1 -1
  786. package/dist/structure/range-bands.js +1 -1
  787. package/dist/structure/range-bands.js.map +1 -1
  788. package/dist/structure/range-years.d.ts +18 -0
  789. package/dist/structure/range-years.d.ts.map +1 -0
  790. package/dist/structure/range-years.js +60 -0
  791. package/dist/structure/range-years.js.map +1 -0
  792. package/dist/structure/ratio.d.ts +136 -0
  793. package/dist/structure/ratio.d.ts.map +1 -0
  794. package/dist/structure/ratio.js +214 -0
  795. package/dist/structure/ratio.js.map +1 -0
  796. package/dist/structure/reference-flags.d.ts +55 -0
  797. package/dist/structure/reference-flags.d.ts.map +1 -0
  798. package/dist/structure/reference-flags.js +116 -0
  799. package/dist/structure/reference-flags.js.map +1 -0
  800. package/dist/structure/reference-number-repeated.d.ts +12 -0
  801. package/dist/structure/reference-number-repeated.d.ts.map +1 -0
  802. package/dist/structure/reference-number-repeated.js +43 -0
  803. package/dist/structure/reference-number-repeated.js.map +1 -0
  804. package/dist/structure/reference-unit.d.ts +24 -0
  805. package/dist/structure/reference-unit.d.ts.map +1 -0
  806. package/dist/structure/reference-unit.js +80 -0
  807. package/dist/structure/reference-unit.js.map +1 -0
  808. package/dist/structure/rent-multiple.d.ts +2 -22
  809. package/dist/structure/rent-multiple.d.ts.map +1 -1
  810. package/dist/structure/rent-multiple.js +2 -49
  811. package/dist/structure/rent-multiple.js.map +1 -1
  812. package/dist/structure/revision-direction.d.ts +51 -0
  813. package/dist/structure/revision-direction.d.ts.map +1 -0
  814. package/dist/structure/revision-direction.js +163 -0
  815. package/dist/structure/revision-direction.js.map +1 -0
  816. package/dist/structure/running-balance.d.ts +36 -0
  817. package/dist/structure/running-balance.d.ts.map +1 -0
  818. package/dist/structure/running-balance.js +126 -0
  819. package/dist/structure/running-balance.js.map +1 -0
  820. package/dist/structure/scaled-quantities.d.ts +1 -1
  821. package/dist/structure/scaled-quantities.d.ts.map +1 -1
  822. package/dist/structure/scaled-quantities.js +23 -6
  823. package/dist/structure/scaled-quantities.js.map +1 -1
  824. package/dist/structure/serial-range.d.ts +9 -0
  825. package/dist/structure/serial-range.d.ts.map +1 -0
  826. package/dist/structure/serial-range.js +41 -0
  827. package/dist/structure/serial-range.js.map +1 -0
  828. package/dist/structure/share-amount.d.ts +55 -0
  829. package/dist/structure/share-amount.d.ts.map +1 -0
  830. package/dist/structure/share-amount.js +162 -0
  831. package/dist/structure/share-amount.js.map +1 -0
  832. package/dist/structure/shift-times.d.ts +32 -0
  833. package/dist/structure/shift-times.d.ts.map +1 -0
  834. package/dist/structure/shift-times.js +112 -0
  835. package/dist/structure/shift-times.js.map +1 -0
  836. package/dist/structure/span-label.d.ts +3 -0
  837. package/dist/structure/span-label.d.ts.map +1 -0
  838. package/dist/structure/span-label.js +27 -0
  839. package/dist/structure/span-label.js.map +1 -0
  840. package/dist/structure/start-end-range.d.ts +30 -0
  841. package/dist/structure/start-end-range.d.ts.map +1 -0
  842. package/dist/structure/start-end-range.js +79 -0
  843. package/dist/structure/start-end-range.js.map +1 -0
  844. package/dist/structure/stated-multiple.d.ts +39 -0
  845. package/dist/structure/stated-multiple.d.ts.map +1 -0
  846. package/dist/structure/stated-multiple.js +49 -0
  847. package/dist/structure/stated-multiple.js.map +1 -0
  848. package/dist/structure/stated-period.d.ts +3 -2
  849. package/dist/structure/stated-period.d.ts.map +1 -1
  850. package/dist/structure/stated-period.js +17 -11
  851. package/dist/structure/stated-period.js.map +1 -1
  852. package/dist/structure/table-scale.d.ts +45 -0
  853. package/dist/structure/table-scale.d.ts.map +1 -0
  854. package/dist/structure/table-scale.js +188 -0
  855. package/dist/structure/table-scale.js.map +1 -0
  856. package/dist/structure/tax-price.d.ts +29 -0
  857. package/dist/structure/tax-price.d.ts.map +1 -0
  858. package/dist/structure/tax-price.js +112 -0
  859. package/dist/structure/tax-price.js.map +1 -0
  860. package/dist/structure/tax.d.ts +2 -0
  861. package/dist/structure/tax.d.ts.map +1 -1
  862. package/dist/structure/tax.js +46 -23
  863. package/dist/structure/tax.js.map +1 -1
  864. package/dist/structure/tier-threshold.d.ts +65 -0
  865. package/dist/structure/tier-threshold.d.ts.map +1 -0
  866. package/dist/structure/tier-threshold.js +170 -0
  867. package/dist/structure/tier-threshold.js.map +1 -0
  868. package/dist/structure/time-range.d.ts +2 -0
  869. package/dist/structure/time-range.d.ts.map +1 -1
  870. package/dist/structure/time-range.js +7 -2
  871. package/dist/structure/time-range.js.map +1 -1
  872. package/dist/structure/total-line.d.ts +34 -2
  873. package/dist/structure/total-line.d.ts.map +1 -1
  874. package/dist/structure/total-line.js +124 -3
  875. package/dist/structure/total-line.js.map +1 -1
  876. package/dist/structure/total-row-blank.d.ts +10 -0
  877. package/dist/structure/total-row-blank.d.ts.map +1 -0
  878. package/dist/structure/total-row-blank.js +15 -0
  879. package/dist/structure/total-row-blank.js.map +1 -0
  880. package/dist/structure/total.d.ts +13 -3
  881. package/dist/structure/total.d.ts.map +1 -1
  882. package/dist/structure/total.js +80 -7
  883. package/dist/structure/total.js.map +1 -1
  884. package/dist/structure/variance-table.d.ts +34 -0
  885. package/dist/structure/variance-table.d.ts.map +1 -0
  886. package/dist/structure/variance-table.js +130 -0
  887. package/dist/structure/variance-table.js.map +1 -0
  888. package/dist/table-names.d.ts +4 -3
  889. package/dist/table-names.d.ts.map +1 -1
  890. package/dist/table-names.js +6 -6
  891. package/dist/table-names.js.map +1 -1
  892. package/dist/unlabelled-references.d.ts +16 -0
  893. package/dist/unlabelled-references.d.ts.map +1 -0
  894. package/dist/unlabelled-references.js +73 -0
  895. package/dist/unlabelled-references.js.map +1 -0
  896. package/dist/vehicle-plates.d.ts +28 -0
  897. package/dist/vehicle-plates.d.ts.map +1 -0
  898. package/dist/vehicle-plates.js +116 -0
  899. package/dist/vehicle-plates.js.map +1 -0
  900. package/dist/whole-word-runs.d.ts +24 -0
  901. package/dist/whole-word-runs.d.ts.map +1 -0
  902. package/dist/whole-word-runs.js +26 -0
  903. package/dist/whole-word-runs.js.map +1 -0
  904. package/package.json +5 -4
  905. package/profiles/property-sale.yaml +21 -0
  906. package/rules/absolute-exception.yaml +1 -1
  907. package/rules/ai-generated-composite.yaml +1 -1
  908. package/rules/ai-tell.yaml +1 -1
  909. package/rules/amount-range-reversed.yaml +1 -1
  910. package/rules/amount-scale-consistency.yaml +1 -1
  911. package/rules/announcing-opener.yaml +1 -1
  912. package/rules/annual-holidays-mismatch.yaml +65 -0
  913. package/rules/annual-pay-mismatch.yaml +64 -0
  914. package/rules/article-sound.yaml +1 -1
  915. package/rules/assistant-residue.yaml +1 -1
  916. package/rules/attachment-not-attached.yaml +1 -1
  917. package/rules/backorder-mismatch.yaml +57 -0
  918. package/rules/bmi-mismatch.yaml +63 -0
  919. package/rules/bold-label-list.yaml +1 -1
  920. package/rules/broken-link.yaml +1 -1
  921. package/rules/capacity-runtime-mismatch.yaml +1 -1
  922. package/rules/change-rate-mismatch.yaml +6 -6
  923. package/rules/chat-citation-residue.yaml +2 -2
  924. package/rules/cliche.yaml +2 -2
  925. package/rules/closing-balance-mismatch.yaml +63 -0
  926. package/rules/colon-lead-in.yaml +1 -1
  927. package/rules/comparative-without-baseline.yaml +1 -1
  928. package/rules/concrete-evidence-density.yaml +1 -1
  929. package/rules/connection-time-short.yaml +1 -1
  930. package/rules/contact-variant.yaml +4 -4
  931. package/rules/contrast-framing.yaml +2 -2
  932. package/rules/cross-doc-broken-link.yaml +1 -1
  933. package/rules/cross-doc-fact-conflict.yaml +1 -1
  934. package/rules/cross-doc-term-variant.yaml +1 -1
  935. package/rules/cumulative-below-current.yaml +59 -0
  936. package/rules/currency-column-mix.yaml +70 -0
  937. package/rules/currency-notation-consistency.yaml +2 -2
  938. package/rules/cushion-phrase-density.yaml +1 -1
  939. package/rules/dangling-participle.yaml +2 -2
  940. package/rules/dangling-reference.yaml +1 -1
  941. package/rules/date-format-consistency.yaml +1 -1
  942. package/rules/date-outside-period.yaml +5 -5
  943. package/rules/date-range-reversed.yaml +4 -4
  944. package/rules/date-stamp-order.yaml +2 -2
  945. package/rules/date-without-year.yaml +12 -12
  946. package/rules/deadline-after-event.yaml +11 -6
  947. package/rules/deductible-exceeds-limit.yaml +54 -0
  948. package/rules/defined-name-repeated.yaml +3 -3
  949. package/rules/defined-term-form.yaml +2 -2
  950. package/rules/delivered-over-ordered.yaml +57 -0
  951. package/rules/demonstrative-opener-run.yaml +1 -1
  952. package/rules/discount-rate-mismatch.yaml +66 -0
  953. package/rules/due-before-issue.yaml +33 -12
  954. package/rules/duration-mismatch.yaml +16 -7
  955. package/rules/duration-product-mismatch.yaml +11 -3
  956. package/rules/elapsed-years-mismatch.yaml +11 -6
  957. package/rules/email-greeting-closing.yaml +2 -2
  958. package/rules/empty-conclusion.yaml +1 -1
  959. package/rules/empty-intensifier.yaml +1 -1
  960. package/rules/empty-list-item.yaml +1 -1
  961. package/rules/empty-section.yaml +1 -1
  962. package/rules/empty-table-cell.yaml +2 -2
  963. package/rules/expletive-construction.yaml +1 -1
  964. package/rules/fact-conflict.yaml +16 -4
  965. package/rules/figurative-density.yaml +1 -1
  966. package/rules/figure-reference-order.yaml +1 -1
  967. package/rules/footnote-mismatch.yaml +1 -1
  968. package/rules/formula-amount-mismatch.yaml +67 -0
  969. package/rules/fullwidth-alnum-consistency.yaml +1 -1
  970. package/rules/gpa-mismatch.yaml +80 -0
  971. package/rules/heading-end-punctuation-mix.yaml +1 -1
  972. package/rules/heading-level-skip.yaml +1 -1
  973. package/rules/heading-numbering-mix.yaml +3 -3
  974. package/rules/homophone-slip.yaml +1 -1
  975. package/rules/humble-for-others.yaml +1 -1
  976. package/rules/idiom-misuse.yaml +1 -1
  977. package/rules/ime-residue.yaml +1 -1
  978. package/rules/impossible-date.yaml +10 -6
  979. package/rules/installment-total-mismatch.yaml +63 -0
  980. package/rules/interest-mismatch.yaml +50 -0
  981. package/rules/interval-count-mismatch.yaml +1 -1
  982. package/rules/invisible-character.yaml +1 -1
  983. package/rules/kana-function-word.yaml +2 -2
  984. package/rules/katakana-density.yaml +1 -1
  985. package/rules/katakana-long-vowel.yaml +2 -2
  986. package/rules/kutoten-consistency.yaml +1 -1
  987. package/rules/latin-spacing.yaml +20 -6
  988. package/rules/layout-code-mismatch.yaml +1 -1
  989. package/rules/less-for-fewer.yaml +1 -1
  990. package/rules/line-amount-mismatch.yaml +8 -7
  991. package/rules/link-text-url-mismatch.yaml +1 -1
  992. package/rules/list-item-form-mix.yaml +1 -1
  993. package/rules/lookalike-character.yaml +1 -1
  994. package/rules/max-kanji-continuous.yaml +1 -1
  995. package/rules/meter-usage-mismatch.yaml +64 -0
  996. package/rules/misconversion.yaml +1 -1
  997. package/rules/modal-conflict.yaml +1 -1
  998. package/rules/name-variant.yaml +12 -3
  999. package/rules/net-amount-mismatch.yaml +57 -0
  1000. package/rules/net-over-gross.yaml +57 -0
  1001. package/rules/no-doubled-joshi.yaml +1 -1
  1002. package/rules/no-mixed-desumasu.yaml +1 -1
  1003. package/rules/no-nakaguro-parallel.yaml +1 -1
  1004. package/rules/nominalization.yaml +1 -1
  1005. package/rules/nonstandard-word.yaml +1 -1
  1006. package/rules/number-style-consistency.yaml +3 -3
  1007. package/rules/number-without-unit.yaml +1 -1
  1008. package/rules/number-word-figure-mismatch.yaml +1 -1
  1009. package/rules/numbering-gap.yaml +1 -1
  1010. package/rules/obligation-without-deadline.yaml +1 -1
  1011. package/rules/ordinal-suffix-mismatch.yaml +1 -1
  1012. package/rules/orthographic-variant.yaml +5 -5
  1013. package/rules/outside-announced-list.yaml +1 -1
  1014. package/rules/padded-intro.yaml +1 -1
  1015. package/rules/paragraph-restatement.yaml +1 -1
  1016. package/rules/party-role-name.yaml +3 -3
  1017. package/rules/percent-sum-mismatch.yaml +2 -2
  1018. package/rules/period-label-conflict.yaml +68 -0
  1019. package/rules/period-multiple-mismatch.yaml +61 -0
  1020. package/rules/period-part-exceeds-whole.yaml +62 -0
  1021. package/rules/person-consistency.yaml +1 -1
  1022. package/rules/phone-number-variant.yaml +3 -3
  1023. package/rules/preferred-term.yaml +2 -2
  1024. package/rules/prerequisite-after-step.yaml +1 -1
  1025. package/rules/product-exceeds-maximum.yaml +49 -0
  1026. package/rules/proper-noun-density.yaml +1 -1
  1027. package/rules/quantity-range-reversed.yaml +2 -2
  1028. package/rules/range-band-mismatch.yaml +1 -1
  1029. package/rules/ratio-mismatch.yaml +64 -0
  1030. package/rules/reference-flag-mismatch.yaml +74 -0
  1031. package/rules/reference-number-repeated.yaml +63 -0
  1032. package/rules/reference-number-variant.yaml +81 -0
  1033. package/rules/reference-title-mismatch.yaml +1 -1
  1034. package/rules/reference-topic-missing.yaml +1 -1
  1035. package/rules/reference-unit-mismatch.yaml +62 -0
  1036. package/rules/relative-date-mismatch.yaml +1 -1
  1037. package/rules/request-without-deadline.yaml +3 -3
  1038. package/rules/required-listed-as-preferred.yaml +1 -1
  1039. package/rules/required-sections.yaml +2 -2
  1040. package/rules/requirement-modal.yaml +2 -2
  1041. package/rules/requirement-smell.yaml +1 -1
  1042. package/rules/revision-direction-mismatch.yaml +66 -0
  1043. package/rules/risk-disclosure.yaml +1 -1
  1044. package/rules/running-balance-mismatch.yaml +59 -0
  1045. package/rules/scaled-quantity-mismatch.yaml +1 -1
  1046. package/rules/serial-range-reversed.yaml +52 -0
  1047. package/rules/share-amount-mismatch.yaml +58 -0
  1048. package/rules/share-over-hundred.yaml +1 -1
  1049. package/rules/shell-prompt-mix.yaml +1 -1
  1050. package/rules/space-before-punctuation.yaml +1 -1
  1051. package/rules/spelling-consistency.yaml +1 -1
  1052. package/rules/step-statement-mix.yaml +3 -3
  1053. package/rules/stock-transition.yaml +1 -1
  1054. package/rules/summary-fact-mismatch.yaml +1 -1
  1055. package/rules/table-header-variant.yaml +1 -1
  1056. package/rules/table-unit-mix.yaml +82 -0
  1057. package/rules/taigen-dome-in-prose.yaml +1 -1
  1058. package/rules/tax-mismatch.yaml +13 -7
  1059. package/rules/tier-threshold-mismatch.yaml +73 -0
  1060. package/rules/time-order.yaml +7 -4
  1061. package/rules/time-range-reversed.yaml +9 -4
  1062. package/rules/toc-heading-mismatch.yaml +1 -1
  1063. package/rules/topic-predicate-distance.yaml +1 -1
  1064. package/rules/total-mismatch.yaml +5 -5
  1065. package/rules/ui-label-variant.yaml +1 -1
  1066. package/rules/unclosed-code-fence.yaml +1 -1
  1067. package/rules/uncomparable-graded.yaml +2 -2
  1068. package/rules/undefined-term.yaml +2 -2
  1069. package/rules/unfilled-placeholder.yaml +2 -2
  1070. package/rules/unit-mismatch.yaml +1 -1
  1071. package/rules/unit-spacing-consistency.yaml +1 -1
  1072. package/rules/unknown-word.yaml +1 -1
  1073. package/rules/url-run-on.yaml +1 -1
  1074. package/rules/vague-deadline.yaml +1 -1
  1075. package/rules/vague-figure-reference.yaml +1 -1
  1076. package/rules/vague-word-density.yaml +2 -2
  1077. package/rules/variance-mismatch.yaml +67 -0
  1078. package/rules/very-adjective.yaml +1 -1
  1079. package/rules/walk-time-distance-mismatch.yaml +1 -1
  1080. package/rules/warning-without-action.yaml +1 -1
  1081. package/rules/weasel-word.yaml +2 -2
  1082. package/rules/wordy-phrase.yaml +2 -2
  1083. package/rules/yori-as-from.yaml +1 -1
  1084. package/skills/chaff/SKILL.md +59 -9
  1085. package/src/cli-text.ts +2 -2
  1086. package/src/company-kana-spelling.ts +105 -0
  1087. package/src/company-names.ts +159 -26
  1088. package/src/contacts/table-rows.ts +51 -0
  1089. package/src/cross-run.ts +1 -0
  1090. package/src/derived/age-on-date.ts +161 -0
  1091. package/src/derived/durations.ts +83 -12
  1092. package/src/derived/hours-and-minutes.ts +41 -0
  1093. package/src/derived/hyphenated-counts.ts +38 -0
  1094. package/src/derived/marked-dates.ts +61 -0
  1095. package/src/derived/money-span.ts +10 -0
  1096. package/src/derived/period-parts.ts +360 -0
  1097. package/src/derived/readable-date.ts +63 -0
  1098. package/src/derived/stays.ts +7 -2
  1099. package/src/derived/timesheet-hours.ts +112 -0
  1100. package/src/derived/use-maximum.ts +158 -0
  1101. package/src/derived/working-hours.ts +2 -2
  1102. package/src/detectors/agreement-slip.ts +3 -0
  1103. package/src/detectors/annual-holidays-mismatch.ts +41 -0
  1104. package/src/detectors/annual-pay-mismatch.ts +71 -0
  1105. package/src/detectors/blank-structure.ts +54 -14
  1106. package/src/detectors/bmi-mismatch.ts +82 -0
  1107. package/src/detectors/change-rate.ts +27 -4
  1108. package/src/detectors/closing-balance-mismatch.ts +52 -0
  1109. package/src/detectors/contact-variant.ts +8 -2
  1110. package/src/detectors/cumulative-below-current.ts +30 -0
  1111. package/src/detectors/currency-column.ts +37 -0
  1112. package/src/detectors/date-any-year.ts +130 -0
  1113. package/src/detectors/date-outside-period.ts +4 -10
  1114. package/src/detectors/date-stamp-order.ts +2 -1
  1115. package/src/detectors/date-year.ts +55 -13
  1116. package/src/detectors/deductible-exceeds-limit.ts +55 -0
  1117. package/src/detectors/defined-term-form.ts +6 -23
  1118. package/src/detectors/derived-numbers.ts +50 -89
  1119. package/src/detectors/discount-rate.ts +41 -0
  1120. package/src/detectors/due-date.ts +21 -7
  1121. package/src/detectors/email-letter.ts +45 -15
  1122. package/src/detectors/event-deadline.ts +13 -3
  1123. package/src/detectors/fact-consistency.ts +145 -7
  1124. package/src/detectors/formula-amount.ts +59 -0
  1125. package/src/detectors/gloss-year.ts +21 -0
  1126. package/src/detectors/gpa-mismatch.ts +43 -0
  1127. package/src/detectors/impossible-date.ts +25 -3
  1128. package/src/detectors/installment-total-mismatch.ts +94 -0
  1129. package/src/detectors/interest.ts +43 -0
  1130. package/src/detectors/lab-columns.ts +9 -0
  1131. package/src/detectors/labelled-age.ts +154 -0
  1132. package/src/detectors/line-amount.ts +58 -3
  1133. package/src/detectors/measured-facts.ts +1 -1
  1134. package/src/detectors/meter-usage.ts +49 -0
  1135. package/src/detectors/name-field.ts +43 -0
  1136. package/src/detectors/name-variant.ts +160 -16
  1137. package/src/detectors/net-amount-mismatch.ts +86 -0
  1138. package/src/detectors/net-gross-weight.ts +39 -0
  1139. package/src/detectors/nominal-step.ts +35 -0
  1140. package/src/detectors/number-style.ts +11 -2
  1141. package/src/detectors/order-quantity.ts +46 -0
  1142. package/src/detectors/orthographic-variant.ts +43 -11
  1143. package/src/detectors/orthography.ts +27 -11
  1144. package/src/detectors/period-label-conflict.ts +43 -0
  1145. package/src/detectors/period-multiple-mismatch.ts +54 -0
  1146. package/src/detectors/period-part.ts +71 -0
  1147. package/src/detectors/range-words.ts +17 -0
  1148. package/src/detectors/ratio-mismatch.ts +116 -0
  1149. package/src/detectors/readable-dates.ts +36 -0
  1150. package/src/detectors/reference-flag.ts +36 -0
  1151. package/src/detectors/reference-number-repeated.ts +25 -0
  1152. package/src/detectors/reference-number-variant.ts +44 -0
  1153. package/src/detectors/reference-unit.ts +24 -0
  1154. package/src/detectors/registry/annual-holidays-mismatch.ts +4 -0
  1155. package/src/detectors/registry/annual-pay-mismatch.ts +4 -0
  1156. package/src/detectors/registry/backorder-mismatch.ts +4 -0
  1157. package/src/detectors/registry/bmi-mismatch.ts +4 -0
  1158. package/src/detectors/registry/closing-balance-mismatch.ts +4 -0
  1159. package/src/detectors/registry/cumulative-below-current.ts +4 -0
  1160. package/src/detectors/registry/currency-column-mix.ts +4 -0
  1161. package/src/detectors/registry/deductible-exceeds-limit.ts +4 -0
  1162. package/src/detectors/registry/delivered-over-ordered.ts +4 -0
  1163. package/src/detectors/registry/discount-rate.ts +4 -0
  1164. package/src/detectors/registry/elapsed-years-mismatch.ts +1 -1
  1165. package/src/detectors/registry/formula-amount.ts +4 -0
  1166. package/src/detectors/registry/gpa-mismatch.ts +4 -0
  1167. package/src/detectors/registry/installment-total-mismatch.ts +4 -0
  1168. package/src/detectors/registry/interest.ts +4 -0
  1169. package/src/detectors/registry/meter-usage.ts +4 -0
  1170. package/src/detectors/registry/net-amount-mismatch.ts +4 -0
  1171. package/src/detectors/registry/net-over-gross.ts +4 -0
  1172. package/src/detectors/registry/period-label-conflict.ts +4 -0
  1173. package/src/detectors/registry/period-multiple-mismatch.ts +4 -0
  1174. package/src/detectors/registry/period-part-exceeds-whole.ts +4 -0
  1175. package/src/detectors/registry/product-exceeds-maximum.ts +4 -0
  1176. package/src/detectors/registry/ratio-mismatch.ts +4 -0
  1177. package/src/detectors/registry/reference-flag-mismatch.ts +4 -0
  1178. package/src/detectors/registry/reference-number-repeated.ts +4 -0
  1179. package/src/detectors/registry/reference-number-variant.ts +4 -0
  1180. package/src/detectors/registry/reference-unit.ts +4 -0
  1181. package/src/detectors/registry/revision-direction.ts +4 -0
  1182. package/src/detectors/registry/running-balance.ts +4 -0
  1183. package/src/detectors/registry/serial-range.ts +4 -0
  1184. package/src/detectors/registry/share-amount.ts +4 -0
  1185. package/src/detectors/registry/table-unit-mix.ts +4 -0
  1186. package/src/detectors/registry/tier-threshold.ts +4 -0
  1187. package/src/detectors/registry/variance-mismatch.ts +4 -0
  1188. package/src/detectors/relative-dates.ts +2 -1
  1189. package/src/detectors/relative-day-words.ts +2 -1
  1190. package/src/detectors/rent-multiple-mismatch.ts +3 -2
  1191. package/src/detectors/request-owner.ts +5 -2
  1192. package/src/detectors/revision-direction.ts +44 -0
  1193. package/src/detectors/row-sentence-amounts.ts +96 -0
  1194. package/src/detectors/running-balance.ts +31 -0
  1195. package/src/detectors/scaled-quantity.ts +1 -1
  1196. package/src/detectors/serial-range.ts +37 -0
  1197. package/src/detectors/share-amount.ts +51 -0
  1198. package/src/detectors/structure-tree.ts +62 -12
  1199. package/src/detectors/table-scale.ts +37 -0
  1200. package/src/detectors/tax-amount.ts +45 -13
  1201. package/src/detectors/technical-docs.ts +4 -2
  1202. package/src/detectors/tier-threshold.ts +108 -0
  1203. package/src/detectors/time-order.ts +52 -18
  1204. package/src/detectors/use-maximum.ts +38 -0
  1205. package/src/detectors/variance.ts +33 -0
  1206. package/src/detectors/whole-count-findings.ts +48 -0
  1207. package/src/detectors/working-hours-findings.ts +100 -0
  1208. package/src/eval.ts +3 -3
  1209. package/src/facts/age-values.ts +124 -0
  1210. package/src/facts/cell-keys.ts +21 -0
  1211. package/src/facts/count-labels.ts +28 -0
  1212. package/src/facts/document-terms.ts +107 -0
  1213. package/src/facts/duration-scale.ts +22 -0
  1214. package/src/facts/duration-values.ts +44 -0
  1215. package/src/facts/fact-values.ts +36 -7
  1216. package/src/facts/labelled-facts.ts +66 -9
  1217. package/src/facts/measure-units.ts +28 -10
  1218. package/src/facts/measures.ts +11 -11
  1219. package/src/facts/qualified-labels.ts +126 -0
  1220. package/src/facts/rate-values.ts +117 -0
  1221. package/src/facts/row-sentence-amounts.ts +113 -0
  1222. package/src/facts/superscript-power.ts +5 -0
  1223. package/src/facts/table-facts.ts +35 -7
  1224. package/src/facts/term-values.ts +236 -0
  1225. package/src/facts/unit-word.ts +13 -0
  1226. package/src/facts/verb-quantity-facts.ts +84 -0
  1227. package/src/facts/whole-counts.ts +183 -0
  1228. package/src/fix-plan/text.ts +2 -2
  1229. package/src/lexicon-genres.ts +11 -0
  1230. package/src/name-char-reading.ts +24 -0
  1231. package/src/name-line-block.ts +40 -0
  1232. package/src/name-lookalike-chars.ts +53 -0
  1233. package/src/name-neighbours.ts +58 -0
  1234. package/src/name-ordinary-word.ts +68 -0
  1235. package/src/name-person.ts +31 -0
  1236. package/src/name-separator.ts +48 -0
  1237. package/src/name-variants.ts +42 -86
  1238. package/src/name-weight.ts +12 -0
  1239. package/src/person-field.ts +43 -0
  1240. package/src/person-full-name.ts +70 -0
  1241. package/src/phone-numbers.ts +54 -18
  1242. package/src/plugin.ts +8 -0
  1243. package/src/product-names.ts +98 -0
  1244. package/src/profile/parse.ts +8 -0
  1245. package/src/reference-numbers.ts +55 -0
  1246. package/src/run.ts +1 -0
  1247. package/src/spaced-person-name.ts +97 -0
  1248. package/src/spacing-code.ts +22 -1
  1249. package/src/structure/annual-holidays.ts +222 -0
  1250. package/src/structure/annual-pay.ts +339 -0
  1251. package/src/structure/bmi.ts +133 -0
  1252. package/src/structure/change-rate-table.ts +135 -0
  1253. package/src/structure/change-rate.ts +54 -17
  1254. package/src/structure/closing-balance.ts +104 -0
  1255. package/src/structure/column-date-order.ts +73 -0
  1256. package/src/structure/compound-hours.ts +49 -0
  1257. package/src/structure/cumulative-below-current.ts +66 -0
  1258. package/src/structure/currency-column.ts +97 -0
  1259. package/src/structure/date-deadline-mark.ts +30 -0
  1260. package/src/structure/date-outside-period.ts +17 -9
  1261. package/src/structure/date-range.ts +9 -11
  1262. package/src/structure/deadline-after-event.ts +125 -8
  1263. package/src/structure/deductible-limit.ts +255 -0
  1264. package/src/structure/discount-rate.ts +209 -0
  1265. package/src/structure/formula-amount.ts +236 -0
  1266. package/src/structure/generic-role.ts +8 -0
  1267. package/src/structure/gpa.ts +218 -0
  1268. package/src/structure/installment-fee.ts +201 -0
  1269. package/src/structure/installment-total.ts +343 -0
  1270. package/src/structure/interest.ts +133 -0
  1271. package/src/structure/key-value-row.ts +45 -0
  1272. package/src/structure/lab-columns.ts +21 -0
  1273. package/src/structure/labelled-date-order.ts +68 -52
  1274. package/src/structure/labelled-order.ts +122 -0
  1275. package/src/structure/labelled-time-order.ts +100 -0
  1276. package/src/structure/line-amount-label.ts +100 -0
  1277. package/src/structure/line-amount-rate.ts +178 -0
  1278. package/src/structure/line-amount-unit.ts +16 -0
  1279. package/src/structure/line-amount.ts +200 -48
  1280. package/src/structure/meter-usage-read.ts +139 -0
  1281. package/src/structure/meter-usage.ts +224 -0
  1282. package/src/structure/net-amount.ts +243 -0
  1283. package/src/structure/net-gross-weight.ts +97 -0
  1284. package/src/structure/order-quantity.ts +125 -0
  1285. package/src/structure/party-role.ts +4 -1
  1286. package/src/structure/percent-sum.ts +3 -0
  1287. package/src/structure/period-label-conflict.ts +174 -0
  1288. package/src/structure/period-labels.ts +147 -0
  1289. package/src/structure/period-multiple.ts +186 -0
  1290. package/src/structure/quantity-range.ts +1 -8
  1291. package/src/structure/range-bands.ts +1 -1
  1292. package/src/structure/range-years.ts +75 -0
  1293. package/src/structure/ratio.ts +296 -0
  1294. package/src/structure/reference-flags.ts +156 -0
  1295. package/src/structure/reference-number-repeated.ts +57 -0
  1296. package/src/structure/reference-unit.ts +105 -0
  1297. package/src/structure/rent-multiple.ts +12 -82
  1298. package/src/structure/revision-direction.ts +214 -0
  1299. package/src/structure/running-balance.ts +157 -0
  1300. package/src/structure/scaled-quantities.ts +20 -6
  1301. package/src/structure/serial-range.ts +52 -0
  1302. package/src/structure/share-amount.ts +206 -0
  1303. package/src/structure/shift-times.ts +136 -0
  1304. package/src/structure/span-label.ts +26 -0
  1305. package/src/structure/start-end-range.ts +120 -0
  1306. package/src/structure/stated-multiple.ts +82 -0
  1307. package/src/structure/stated-period.ts +23 -11
  1308. package/src/structure/table-scale.ts +239 -0
  1309. package/src/structure/tax-price.ts +136 -0
  1310. package/src/structure/tax.ts +55 -20
  1311. package/src/structure/tier-threshold.ts +218 -0
  1312. package/src/structure/time-range.ts +9 -3
  1313. package/src/structure/total-line.ts +174 -5
  1314. package/src/structure/total-row-blank.ts +23 -0
  1315. package/src/structure/total.ts +122 -13
  1316. package/src/structure/variance-table.ts +167 -0
  1317. package/src/table-names.ts +6 -6
  1318. package/src/unlabelled-references.ts +83 -0
  1319. package/src/vehicle-plates.ts +142 -0
  1320. package/src/whole-word-runs.ts +38 -0
@@ -0,0 +1,343 @@
1
+ import { escapeRegExp } from "../orthography.ts";
2
+ import type { StructureIssue } from "./issues.ts";
3
+
4
+ /**
5
+ * installment-total-mismatch: a number of payments times the amount of each that is not the stated total of payments
6
+ * (お支払回数 60回、毎月のお支払額 32,800円、お支払総額 1,968,000円; "48 monthly payments of $537.50; total of payments
7
+ * $25,800"). A first or a final payment stated apart is added as written: first + (n − 2) × each + last. The plan is read
8
+ * from labels (each kind stated once, or always with the same value) or, without them, from the payments of one sentence
9
+ * (47 payments of $550.53 and 1 payment of $550.71), when only one of them repeats (two repeated ones are choices). Each repeated payment may be rounded by half its last written digit.
10
+ * An approximate amount, a range, two different values of one kind, a word that adds payments of another kind (bonus,
11
+ * balloon, down payment), and a stated rounding with no first or final payment are not compared. Words come from the
12
+ * lexicons. Pure.
13
+ */
14
+
15
+ /** One amount of money as read: its currency, its value, and the value of the word of scale written in it (万), if any. */
16
+ export type InstallmentAmount = {
17
+ readonly offset: number;
18
+ readonly end: number;
19
+ readonly currency: string;
20
+ readonly value: number;
21
+ readonly scale: number | undefined;
22
+ };
23
+
24
+ export type PositionedWord = { readonly word: string; readonly position: "before" | "after" };
25
+
26
+ export type InstallmentWords = {
27
+ readonly labels: {
28
+ /** The number of payments (お支払回数, Number of payments). */
29
+ readonly count: readonly string[];
30
+ /** The amount of each regular payment (毎月のお支払額, 2回目以降, Monthly payment). */
31
+ readonly each: readonly string[];
32
+ /** A first payment stated apart (初回, First payment). */
33
+ readonly first: readonly string[];
34
+ /** A final payment stated apart (最終回, Final payment). */
35
+ readonly last: readonly string[];
36
+ /** The total of all payments (お支払総額, Total of payments). */
37
+ readonly total: readonly string[];
38
+ };
39
+ /** Words after a count that make it a number of payments (回, payments). */
40
+ readonly units: readonly string[];
41
+ /** Words that may stand between a count and its unit (monthly, equal). */
42
+ readonly qualifiers: readonly string[];
43
+ /** Words that may stand between a label and its value (は, の, is). */
44
+ readonly links: readonly string[];
45
+ /** Words that join a count of payments to the amount of each (of, at, ×). */
46
+ readonly per: readonly string[];
47
+ /** Words that say a payment absorbs a remainder (端数, adjusted). */
48
+ readonly rounding: readonly string[];
49
+ /** Words of payments outside the plan (ボーナス, balloon, down payment); a document with one is not compared. */
50
+ readonly skips: readonly string[];
51
+ /** Marks of a rough amount (約, about). */
52
+ readonly markers: readonly PositionedWord[];
53
+ /** Marks and words that join the two ends of a range (〜, to). */
54
+ readonly connectors: readonly string[];
55
+ /** Numbers written as words (forty-eight is not one; twelve is) and their values. */
56
+ readonly numberWords: readonly { readonly word: string; readonly value: number }[];
57
+ };
58
+
59
+ type Span = { readonly start: number; readonly end: number };
60
+ type Interval = { readonly low: number; readonly high: number };
61
+ type LabelKind = keyof InstallmentWords["labels"];
62
+
63
+ /** A labelled value: an interval of money, a count, or undefined when the statement is not one plain value. */
64
+ type Field = {
65
+ readonly kind: LabelKind;
66
+ readonly label: Span;
67
+ readonly amount: InstallmentAmount | undefined;
68
+ readonly count: number | undefined;
69
+ readonly clear: boolean;
70
+ };
71
+
72
+ /** One part of a plan: this many payments of this amount. */
73
+ export type Part = { readonly count: number; readonly amount: InstallmentAmount; readonly written: string };
74
+
75
+ const LABEL_KINDS: readonly LabelKind[] = ["count", "each", "first", "last", "total"];
76
+ const LATIN = /[A-Za-z]/u;
77
+ const SEPARATORS = /[\s||::==、,,・()()[\][]]/gu;
78
+ const SENTENCE_END = /[。!?;;]|[.!?](?=\s|$)/gu;
79
+ const DIGITS = "[0-90-9]+";
80
+ /** Floating point slack when amounts with cents are multiplied and added. */
81
+ const EPSILON = 1e-6;
82
+
83
+ const wordPattern = (word: string): string => {
84
+ const edgeStart = LATIN.test(word.charAt(0)) ? "(?<![A-Za-z])" : "";
85
+ const edgeEnd = LATIN.test(word.charAt(word.length - 1)) ? "(?![A-Za-z])" : "";
86
+ return `${edgeStart}${escapeRegExp(word)}${edgeEnd}`;
87
+ };
88
+
89
+ /** One alternation of the words, longest first so 初回お支払額 wins over 初回. Undefined when there are none. */
90
+ export const alternation = (words: readonly string[]): string | undefined =>
91
+ words.length === 0
92
+ ? undefined
93
+ : words
94
+ .toSorted((left, right) => right.length - left.length)
95
+ .map(wordPattern)
96
+ .join("|");
97
+
98
+ export const occurrences = (text: string, words: readonly string[]): Span[] => {
99
+ const pattern = alternation(words);
100
+ if (pattern === undefined) return [];
101
+ return [...text.matchAll(new RegExp(pattern, "giu"))].map((match) => ({ start: match.index, end: match.index + match[0].length }));
102
+ };
103
+
104
+ const withoutWords = (text: string, words: readonly string[]): string => {
105
+ const pattern = alternation(words);
106
+ return pattern === undefined ? text : text.replace(new RegExp(pattern, "giu"), "");
107
+ };
108
+
109
+ /** Whether only separators and these words stand in a gap on one line (「:」, "の", " of "). */
110
+ export const isPlainGap = (gap: string, words: readonly string[]): boolean => !gap.includes("\n") && withoutWords(gap, words).replace(SEPARATORS, "") === "";
111
+
112
+ export const lineBounds = (text: string, offset: number): Span => {
113
+ const end = text.indexOf("\n", offset);
114
+ return { start: text.lastIndexOf("\n", offset - 1) + 1, end: end === -1 ? text.length : end };
115
+ };
116
+
117
+ /** The sentence around a span, within its line. */
118
+ export const sentenceAround = (text: string, span: Span): Span => {
119
+ const line = lineBounds(text, span.start);
120
+ const ends = [...text.slice(line.start, line.end).matchAll(SENTENCE_END)].map((match) => line.start + match.index);
121
+ const start = ends.filter((end) => end < span.start).at(-1);
122
+ return { start: start === undefined ? line.start : start + 1, end: ends.find((at) => at >= span.end) ?? line.end };
123
+ };
124
+
125
+ const decimalsOf = (written: string): number => /[..]([0-90-9]+)/u.exec(written)?.[1]?.length ?? 0;
126
+
127
+ /** The interval a payment's digits allow: half its last written digit either way (9.8万 is 97,500 to 98,500; $550.53 ± half a cent). */
128
+ export const intervalOf = (amount: InstallmentAmount, written: string): Interval => {
129
+ const half = ((amount.scale ?? 1) * 10 ** -decimalsOf(written)) / 2;
130
+ return { low: amount.value - half, high: amount.value + half };
131
+ };
132
+
133
+ /** The stated total's interval: exact for plain digits, half the last digit of a word of scale (196.8万). */
134
+ const totalInterval = (amount: InstallmentAmount, written: string): Interval =>
135
+ amount.scale === undefined ? { low: amount.value, high: amount.value } : intervalOf(amount, written);
136
+
137
+ const countOf = (written: string, words: InstallmentWords): number =>
138
+ words.numberWords.find((entry) => entry.word.toLowerCase() === written.toLowerCase())?.value ?? Number(written.normalize("NFKC"));
139
+
140
+ const countPattern = (words: InstallmentWords): string => {
141
+ const numberWords = alternation(words.numberWords.map((entry) => entry.word));
142
+ return numberWords === undefined ? DIGITS : `${DIGITS}|${numberWords}`;
143
+ };
144
+
145
+ export const hasWord = (text: string, words: readonly string[]): boolean => occurrences(text, words).length > 0;
146
+
147
+ /** How far around a value its marks are looked for. */
148
+ const MARK_REACH = 16;
149
+
150
+ /** The text just before a value on its line. */
151
+ const beforeOnLine = (text: string, value: Span): string => text.slice(Math.max(lineBounds(text, value.start).start, value.start - MARK_REACH), value.start);
152
+
153
+ /** The text just after a value on its line. */
154
+ const afterOnLine = (text: string, value: Span): string => text.slice(value.end, Math.min(lineBounds(text, value.start).end, value.end + MARK_REACH));
155
+
156
+ /** Whether a rough mark stands right before or after the value (約 32,800円, 60回程度, about $540). */
157
+ const isMarked = (text: string, value: Span, markers: readonly PositionedWord[]): boolean => {
158
+ const before = beforeOnLine(text, value).trimEnd().toLowerCase();
159
+ const after = afterOnLine(text, value).trimStart().toLowerCase();
160
+ return markers.some((marker) => (marker.position === "before" ? before.endsWith(marker.word.toLowerCase()) : after.startsWith(marker.word.toLowerCase())));
161
+ };
162
+
163
+ /** Whether a range connector follows the value with another number (32,800円〜33,000円, $540 to $560). */
164
+ const opensRange = (text: string, value: Span, connectors: readonly string[]): boolean => {
165
+ const after = afterOnLine(text, value).trimStart().toLowerCase();
166
+ return connectors.some((connector) => after.startsWith(connector.toLowerCase()) && /^\s*[$€£¥¥0-90-9]/u.test(after.slice(connector.length)));
167
+ };
168
+
169
+ export const isRough = (text: string, value: Span, words: InstallmentWords): boolean =>
170
+ isMarked(text, value, words.markers) || opensRange(text, value, words.connectors);
171
+
172
+ type Label = Span & { readonly kind: LabelKind };
173
+
174
+ /** Every label of the plan in document order, with its kind; the longest label wins (初回お支払額 over 初回). */
175
+ export const labelsIn = (text: string, words: InstallmentWords): Label[] => {
176
+ const entries: [string, LabelKind][] = LABEL_KINDS.flatMap((kind) => words.labels[kind].map((word): [string, LabelKind] => [word.toLowerCase(), kind]));
177
+ const kindOf = new Map(entries);
178
+ return occurrences(text, [...kindOf.keys()]).flatMap((span) => {
179
+ const kind = kindOf.get(text.slice(span.start, span.end).toLowerCase());
180
+ return kind === undefined ? [] : [{ ...span, kind }];
181
+ });
182
+ };
183
+
184
+ /** Where a label's own value must be: before the next label, the end of the sentence, or the end of the line. */
185
+ const stretchOf = (text: string, label: Label, next: Label | undefined): Span => {
186
+ const sentence = sentenceAround(text, label);
187
+ return { start: label.end, end: Math.min(sentence.end, next?.start ?? sentence.end) };
188
+ };
189
+
190
+ const amountsWithin = (amounts: readonly InstallmentAmount[], span: Span): InstallmentAmount[] =>
191
+ amounts.filter((amount) => amount.offset >= span.start && amount.end <= span.end);
192
+
193
+ /** A count label's number (お支払回数:60回, Number of payments: 48); not clear when rough or followed by money. */
194
+ const countField = (text: string, label: Label, stretch: Span, amounts: readonly InstallmentAmount[], words: InstallmentWords): Field[] => {
195
+ const match = new RegExp(`(?<![0-90-9.,])(${countPattern(words)})(?![0-90-9]|[.,.,][0-90-9])`, "iu").exec(text.slice(stretch.start, stretch.end));
196
+ if (match === null || !isPlainGap(text.slice(stretch.start, stretch.start + match.index), words.links)) return [];
197
+ const span = { start: stretch.start + match.index, end: stretch.start + match.index + match[0].length };
198
+ const clear = !isRough(text, span, words) && amountsWithin(amounts, stretch).length === 0;
199
+ return [{ kind: label.kind, label, amount: undefined, count: countOf(match[1] ?? "", words), clear }];
200
+ };
201
+
202
+ /** A money label's amount (毎月のお支払額:32,826円); not clear when rough or when the statement holds a second amount. */
203
+ const amountField = (text: string, label: Label, stretch: Span, amounts: readonly InstallmentAmount[], words: InstallmentWords): Field[] => {
204
+ const [first, ...rest] = amountsWithin(amounts, stretch);
205
+ if (first === undefined || !isPlainGap(text.slice(stretch.start, first.offset), words.links)) return [];
206
+ const clear = rest.length === 0 && !isRough(text, { start: first.offset, end: first.end }, words);
207
+ return [{ kind: label.kind, label, amount: first, count: undefined, clear }];
208
+ };
209
+
210
+ /** Every label followed by its own value, in document order. */
211
+ export const fieldsIn = (text: string, amounts: readonly InstallmentAmount[], words: InstallmentWords): Field[] => {
212
+ const labels = labelsIn(text, words);
213
+ return labels.flatMap((label, index) => {
214
+ const stretch = stretchOf(text, label, labels[index + 1]);
215
+ return label.kind === "count" ? countField(text, label, stretch, amounts, words) : amountField(text, label, stretch, amounts, words);
216
+ });
217
+ };
218
+
219
+ const sameValue = (left: Field, right: Field): boolean =>
220
+ left.count === right.count && left.amount?.value === right.amount?.value && left.amount?.currency === right.amount?.currency;
221
+
222
+ /** The one value a kind has in the document: undefined when it is missing, unclear, or stated twice with different values. */
223
+ const soleField = (fields: readonly Field[], kind: LabelKind): Field | undefined => {
224
+ const ofKind = fields.filter((field) => field.kind === kind);
225
+ const [first] = ofKind;
226
+ return first !== undefined && ofKind.every((field) => field.clear && sameValue(field, first)) ? first : undefined;
227
+ };
228
+
229
+ const isStated = (fields: readonly Field[], kind: LabelKind): boolean => fields.some((field) => field.kind === kind);
230
+
231
+ const partOf = (text: string, count: number, amount: InstallmentAmount): Part => ({ count, amount, written: text.slice(amount.offset, amount.end) });
232
+
233
+ /** The parts a labelled plan states: the first and the final payment apart, each regular payment for the rest. */
234
+ const labelledParts = (text: string, fields: readonly Field[]): Part[] | undefined => {
235
+ const count = soleField(fields, "count")?.count;
236
+ const each = soleField(fields, "each")?.amount;
237
+ const [first, last] = [soleField(fields, "first")?.amount, soleField(fields, "last")?.amount];
238
+ if (count === undefined || each === undefined) return undefined;
239
+ if ((isStated(fields, "first") && first === undefined) || (isStated(fields, "last") && last === undefined)) return undefined;
240
+ const ends = [first, last].filter((amount) => amount !== undefined);
241
+ const regular = count - ends.length;
242
+ if (regular < 1) return undefined;
243
+ const firstPart = first === undefined ? [] : [partOf(text, 1, first)];
244
+ return [...firstPart, partOf(text, regular, each), ...(last === undefined ? [] : [partOf(text, 1, last)])];
245
+ };
246
+
247
+ /** A count of payments with its unit (48 monthly payments, 59回), and its value. */
248
+ const paymentCountsIn = (text: string, words: InstallmentWords): (Span & { readonly count: number })[] => {
249
+ const unit = alternation(words.units);
250
+ if (unit === undefined) return [];
251
+ const qualifier = alternation(words.qualifiers);
252
+ const between = qualifier === undefined ? "\\s?" : `\\s?(?:(?:${qualifier})\\s+)*`;
253
+ const pattern = new RegExp(`(?<![0-90-9.,,.])(${countPattern(words)})${between}(?:${unit})`, "giu");
254
+ return [...text.matchAll(pattern)].map((match) => ({ start: match.index, end: match.index + match[0].length, count: countOf(match[1] ?? "", words) }));
255
+ };
256
+
257
+ /** Whether a gap joins a count of payments to its amount: a word of "each" (of, ×) and nothing but separators and links. */
258
+ const joinsPayment = (gap: string, words: InstallmentWords): boolean => hasWord(gap, words.per) && isPlainGap(gap, [...words.per, ...words.links]);
259
+
260
+ /** The amount a count of payments is of: right after it (48 payments of $537.50) or right before it (32,800円×59回). */
261
+ const amountOfCount = (text: string, count: Span, amounts: readonly InstallmentAmount[], words: InstallmentWords): InstallmentAmount | undefined => {
262
+ const after = amounts.find((amount) => amount.offset >= count.end);
263
+ if (after !== undefined && joinsPayment(text.slice(count.end, after.offset), words)) return after;
264
+ const before = amounts.findLast((amount) => amount.end <= count.start);
265
+ return before !== undefined && joinsPayment(text.slice(before.end, count.start), words) ? before : undefined;
266
+ };
267
+
268
+ /** Every count of payments joined to an amount, as a part of a plan. */
269
+ export const paymentPhrasesIn = (text: string, amounts: readonly InstallmentAmount[], words: InstallmentWords): Part[] =>
270
+ paymentCountsIn(text, words).flatMap((count) => {
271
+ const amount = amountOfCount(text, count, amounts, words);
272
+ return amount === undefined || isRough(text, { start: amount.offset, end: amount.end }, words) ? [] : [partOf(text, count.count, amount)];
273
+ });
274
+
275
+ /** Whether parts can be one plan: one repeated payment, the others single (a first or final payment); two repeated ones are choices. */
276
+ export const isOnePlan = (parts: readonly Part[]): boolean => parts.filter((part) => part.count > 1).length === 1;
277
+
278
+ /** The parts of the one sentence that states payments; undefined when none does, or two sentences state different plans. */
279
+ const phraseParts = (text: string, amounts: readonly InstallmentAmount[], words: InstallmentWords): Part[] | undefined => {
280
+ const phrases = paymentPhrasesIn(text, amounts, words);
281
+ const sentenceOf = (part: Part): number => sentenceAround(text, { start: part.amount.offset, end: part.amount.end }).start;
282
+ const starts = [...new Set(phrases.map(sentenceOf))];
283
+ const plans = starts.map((start) => phrases.filter((part) => sentenceOf(part) === start));
284
+ const [plan] = plans;
285
+ const key = (parts: readonly Part[]): string => parts.map((part) => `${String(part.count)}×${String(part.amount.value)}`).join("+");
286
+ return plan !== undefined && isOnePlan(plan) && plans.every((other) => key(other) === key(plan)) ? plan : undefined;
287
+ };
288
+
289
+ /** The plan's parts: from its labels when it labels a count and a regular payment, else from one sentence of payments. */
290
+ export const planParts = (text: string, fields: readonly Field[], amounts: readonly InstallmentAmount[], words: InstallmentWords): Part[] | undefined => {
291
+ if (isStated(fields, "count") && isStated(fields, "each")) return labelledParts(text, fields);
292
+ const parts = phraseParts(text, amounts, words);
293
+ const count = soleField(fields, "count")?.count;
294
+ if (parts === undefined || (isStated(fields, "count") && count !== parts.reduce((sum, part) => sum + part.count, 0))) return undefined;
295
+ return parts;
296
+ };
297
+
298
+ /** The interval the payments add up to. */
299
+ export const sumOf = (parts: readonly Part[]): Interval =>
300
+ parts.reduce(
301
+ (sum, part) => {
302
+ const interval = intervalOf(part.amount, part.written);
303
+ return { low: sum.low + part.count * interval.low, high: sum.high + part.count * interval.high };
304
+ },
305
+ { low: 0, high: 0 },
306
+ );
307
+
308
+ /** Whether the stated total can be the sum of the payments, within their written precision. */
309
+ export const isTotalOf = (total: Interval, sum: Interval): boolean => total.high >= sum.low - EPSILON && total.low <= sum.high + EPSILON;
310
+
311
+ /** The sum written as the regular payment is written ($26,649.44, 1,971,720円); the bare number when it has a word of scale. */
312
+ export const writtenLike = (value: number, part: Part): string => {
313
+ const decimals = part.amount.scale === undefined ? decimalsOf(part.written) : 0;
314
+ const digits = value.toLocaleString("en-US", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
315
+ return part.amount.scale === undefined ? part.written.replace(/[0-90-9][0-90-9,,..]*/u, digits) : digits;
316
+ };
317
+
318
+ export const describe = (parts: readonly Part[]): string =>
319
+ parts.map((part) => (part.count === 1 ? part.written : `${part.written} × ${String(part.count)}`)).join(" + ");
320
+
321
+ const regularOf = (parts: readonly Part[]): Part | undefined => parts.toSorted((left, right) => right.count - left.count)[0];
322
+
323
+ /** Whether something in the document stops the comparison: a payment of another kind, or a stated rounding with no payment apart. */
324
+ const isOutOfReach = (text: string, fields: readonly Field[], parts: readonly Part[], words: InstallmentWords): boolean =>
325
+ hasWord(text, words.skips) || (hasWord(text, words.rounding) && parts.length === 1 && !isStated(fields, "first") && !isStated(fields, "last"));
326
+
327
+ /** The stated total of payments, when the document states one total once (or always the same). */
328
+ const statedTotal = (fields: readonly Field[]): InstallmentAmount | undefined => soleField(fields, "total")?.amount;
329
+
330
+ /** Every plan whose payments do not add up to its stated total of payments; reported at the regular payment. */
331
+ export const installmentTotalMismatches = (text: string, amounts: readonly InstallmentAmount[], words: InstallmentWords): StructureIssue[] => {
332
+ const fields = fieldsIn(text, amounts, words);
333
+ const total = statedTotal(fields);
334
+ const parts = total === undefined ? undefined : planParts(text, fields, amounts, words);
335
+ const regular = parts === undefined ? undefined : regularOf(parts);
336
+ if (total === undefined || parts === undefined || regular === undefined || isOutOfReach(text, fields, parts, words)) return [];
337
+ if (parts.some((part) => part.amount.currency !== total.currency)) return [];
338
+ const written = text.slice(total.offset, total.end);
339
+ const sum = sumOf(parts);
340
+ if (isTotalOf(totalInterval(total, written), sum)) return [];
341
+ const values = { payments: describe(parts), sum: writtenLike((sum.low + sum.high) / 2, regular), total: written };
342
+ return [{ offset: regular.amount.offset, values }];
343
+ };
@@ -0,0 +1,133 @@
1
+ // interest-mismatch: an interest calculation written on one line (「お利息の計算:対象残高400,000円 × 利率0.10% = 400円」,
2
+ // "Interest for the month: average balance $3,600.00 × rate 0.05% = $1.80") whose amount is not the balance times the
3
+ // rate. The rate is read as written: one marked for a period (年利, APR) is used only when the line names the same period
4
+ // for the interest, and is never converted by a day count. A line marked after tax is not read. Pure.
5
+ import type { Line } from "./lines.ts";
6
+ import type { StructureIssue } from "./issues.ts";
7
+ import { plain, valueIn } from "./change-rate-table.ts";
8
+ import { shownLike, type Money } from "./share-amount.ts";
9
+ import { roundedMatches } from "./tax.ts";
10
+ import { escapeRegExp } from "../orthography.ts";
11
+
12
+ /** interest: the interest itself. base: the balance it is on. rate: the rate. net: interest after tax, not compared. */
13
+ export type InterestRole = "interest" | "base" | "rate" | "net";
14
+ export type InterestPeriod = "year" | "month";
15
+ export type InterestWord = { readonly pattern: string; readonly role: InterestRole };
16
+ /** A word that says what period a rate is for (年利, APR), or what period the interest is for (年間, for the month). */
17
+ export type PeriodWord = { readonly pattern: string; readonly period: InterestPeriod; readonly of: "rate" | "interest" };
18
+ export type InterestWords = { readonly labels: readonly InterestWord[]; readonly periods: readonly PeriodWord[] };
19
+
20
+ const TIMES = /[×✕]/gu;
21
+ const EQUALS = /[==]/gu;
22
+ const PERCENT = /(?<![\d.])(\d+(?:\.\d+)?)[ \t]?%/gu;
23
+ const TRAILING_STOP = /[.。]\s*$/u;
24
+ const NUMBER = /\d[\d,]*(?:\.(\d+))?/u;
25
+ const FIRST_FIGURE = /[\d$€£¥¥]/u;
26
+ /** A bracketed note as written, in either width: blanked to spaces so the figure after it keeps its place. */
27
+ const WRITTEN_BRACKETED = /[((][^()()]*[))]/gu;
28
+ const LATIN = /[a-z]/u;
29
+ const MAX_RATE = 100;
30
+ const CENTS = 100;
31
+
32
+ type Rate = { readonly value: number; readonly written: string };
33
+ type Calculation = { readonly before: string; readonly rate: string; readonly amount: string; readonly amountAt: number };
34
+
35
+ const keyOf = (text: string): string => plain(text).toLowerCase();
36
+
37
+ /** Where each whole occurrence of a word ends in a key: a Latin word stands as a whole word, anything else as written. */
38
+ const endsOf = (key: string, pattern: string): number[] => {
39
+ const word = keyOf(pattern);
40
+ if (word === "") return [];
41
+ const source = LATIN.test(word) ? `(?<![a-z0-9])${escapeRegExp(word)}(?![a-z0-9])` : escapeRegExp(word);
42
+ return [...key.matchAll(new RegExp(source, "gu"))].map((match) => match.index + word.length);
43
+ };
44
+
45
+ const patternsOf = (words: InterestWords, role: InterestRole): string[] => words.labels.flatMap((word) => (word.role === role ? [word.pattern] : []));
46
+
47
+ const holdsAny = (key: string, patterns: readonly string[]): boolean => patterns.some((pattern) => endsOf(key, pattern).length > 0);
48
+
49
+ /** Where the last of the words ends in the key, -1 when none is there. */
50
+ const lastEnd = (key: string, patterns: readonly string[]): number => Math.max(-1, ...patterns.flatMap((pattern) => endsOf(key, pattern)));
51
+
52
+ // The text that may name the interest and its period: before × and after =, not the rate between.
53
+ const interestKeyOf = (calculation: Calculation): string => `${keyOf(calculation.before)} ${keyOf(calculation.amount)}`;
54
+
55
+ /** The line cut at its one × and its one =: what is before ×, between them (empty when = comes first), and after =. */
56
+ const calculationOf = (text: string): Calculation | undefined => {
57
+ const times = [...text.matchAll(TIMES)];
58
+ const equals = [...text.matchAll(EQUALS)];
59
+ const [timesMatch, equalsMatch] = [times[0], equals[0]];
60
+ if (times.length !== 1 || equals.length !== 1 || timesMatch === undefined || equalsMatch === undefined) return undefined;
61
+ const amount = text.slice(equalsMatch.index + 1);
62
+ const figure = amount.replace(WRITTEN_BRACKETED, (note) => " ".repeat(note.length)).search(FIRST_FIGURE);
63
+ return {
64
+ before: text.slice(0, timesMatch.index),
65
+ rate: text.slice(timesMatch.index + 1, equalsMatch.index),
66
+ amount,
67
+ amountAt: equalsMatch.index + 1 + Math.max(figure, 0),
68
+ };
69
+ };
70
+
71
+ /** The one percentage written between × and =, with a rate word: 利率0.10%, rate 0.05%. */
72
+ const rateIn = (segment: string, words: InterestWords): Rate | undefined => {
73
+ const key = keyOf(segment);
74
+ const rates = [...key.matchAll(PERCENT)];
75
+ const [only] = rates;
76
+ if (rates.length !== 1 || only === undefined || !holdsAny(key, patternsOf(words, "rate"))) return undefined;
77
+ const value = Number(only[1]);
78
+ return value > 0 && value < MAX_RATE ? { value, written: only[0] } : undefined;
79
+ };
80
+
81
+ const moneyIn = (text: string): Money | undefined => {
82
+ const value = valueIn(text);
83
+ if (value === undefined) return undefined;
84
+ const decimals = NUMBER.exec(text)?.[1]?.length ?? 0;
85
+ return { value: value.value, decimals, marks: value.marks, offset: 0, text: plain(text) };
86
+ };
87
+
88
+ /** The balance: what follows the last balance word before ×: 「対象残高1,200,000円」, "average balance $12,400.00". */
89
+ const baseIn = (segment: string, words: InterestWords): Money | undefined => {
90
+ const text = plain(segment);
91
+ const end = lastEnd(text.toLowerCase(), patternsOf(words, "base"));
92
+ return end < 0 ? undefined : moneyIn(text.slice(end));
93
+ };
94
+
95
+ /** The amount after =, less a bracketed note, a closing stop and an interest word before it (= お利息400円). */
96
+ const amountIn = (segment: string, words: InterestWords): Money | undefined => {
97
+ const text = plain(segment).replace(WRITTEN_BRACKETED, "").replace(TRAILING_STOP, "");
98
+ return moneyIn(text.slice(Math.max(0, lastEnd(text.toLowerCase(), patternsOf(words, "interest")))));
99
+ };
100
+
101
+ /** The one period the words of this kind name in the key; undefined when none or two. */
102
+ const periodIn = (key: string, words: InterestWords, of: PeriodWord["of"]): InterestPeriod | undefined => {
103
+ const periods = new Set(words.periods.filter((word) => word.of === of && endsOf(key, word.pattern).length > 0).map((word) => word.period));
104
+ return periods.size === 1 ? [...periods][0] : undefined;
105
+ };
106
+
107
+ /** A rate marked for a period (年利, APR) is the interest's only when the line names that period for the interest. */
108
+ const ratePeriodFits = (calculation: Calculation, words: InterestWords): boolean => {
109
+ const rateKey = keyOf(calculation.rate);
110
+ const ratePeriods = words.periods.filter((word) => word.of === "rate" && endsOf(rateKey, word.pattern).length > 0);
111
+ if (ratePeriods.length === 0) return true;
112
+ const ratePeriod = periodIn(rateKey, words, "rate");
113
+ return ratePeriod !== undefined && ratePeriod === periodIn(interestKeyOf(calculation), words, "interest");
114
+ };
115
+
116
+ /** The line is an interest calculation: an interest word before × or after =, and no word of interest after tax. */
117
+ const isGrossInterest = (line: Line, calculation: Calculation, words: InterestWords): boolean => {
118
+ return holdsAny(interestKeyOf(calculation), patternsOf(words, "interest")) && !holdsAny(keyOf(line.text), patternsOf(words, "net"));
119
+ };
120
+
121
+ const lineIssues = (line: Line, words: InterestWords): StructureIssue[] => {
122
+ const calculation = calculationOf(line.text);
123
+ if (calculation === undefined || !isGrossInterest(line, calculation, words) || !ratePeriodFits(calculation, words)) return [];
124
+ const [base, rate, amount] = [baseIn(calculation.before, words), rateIn(calculation.rate, words), amountIn(calculation.amount, words)];
125
+ if (base === undefined || rate === undefined || amount === undefined || base.marks !== amount.marks) return [];
126
+ if (roundedMatches(Math.round(amount.value * CENTS), base.value * rate.value, amount.decimals === 0)) return [];
127
+ const expected = shownLike(amount, (base.value * rate.value) / MAX_RATE, undefined);
128
+ return [{ offset: line.start + calculation.amountAt, values: { written: amount.text, expected, rate: rate.written, base: base.text } }];
129
+ };
130
+
131
+ /** Each interest calculation line whose amount is not the balance times the rate, rounded down, to nearest or up. */
132
+ export const interestMismatches = (lines: readonly Line[], words: InterestWords): StructureIssue[] =>
133
+ words.labels.length === 0 ? [] : lines.flatMap((line) => lineIssues(line, words));
@@ -0,0 +1,45 @@
1
+ import { cellsOf } from "../facts/table-facts.ts";
2
+ import { withoutEdgeMarks } from "../facts/trim-marks.ts";
3
+ import { TABLE_ROW } from "./runs.ts";
4
+
5
+ /**
6
+ * 項目と内容の二列の表で、項目の升に期間の語だけを書いた一行(| 対象期間 | 2026年4月1日〜9月30日 |)。その表で期間の語を項目に書いた行が
7
+ * それ一つのときだけ、内容の升を期間として読む。期間の語の項目が何行も並ぶ表(回ごとの | 期間 | … |)は期間の一覧で、文書の期間ではない。
8
+ * 項目の升が語を含むだけのもの(| Conference room | … |、| 第1期 | … |)は読まない。Pure.
9
+ */
10
+ export type ValueCell = { readonly from: number; readonly to: number };
11
+
12
+ const KEY_VALUE_CELLS = 2;
13
+ const TRAILING_COLON = /[::]$/u;
14
+
15
+ const cellsOfRow = (row: string): { readonly start: number; readonly end: number; readonly text: string }[] => cellsOf({ text: row, start: 0, number: 0 });
16
+
17
+ const isLabelCell = (text: string, labels: readonly string[]): boolean => {
18
+ const name = withoutEdgeMarks(withoutEdgeMarks(text).replace(TRAILING_COLON, "")).toLowerCase();
19
+ return labels.some((label) => label.toLowerCase() === name);
20
+ };
21
+
22
+ const isLabelRow = (row: string, labels: readonly string[]): boolean => {
23
+ const first = cellsOfRow(row)[0];
24
+ return TABLE_ROW.test(row) && first !== undefined && isLabelCell(first.text, labels);
25
+ };
26
+
27
+ /** 表の一行の、期間を書いた内容の升(行の中の位置)。tableOf はその行を含む表の全部の行を返す(項目が期間の語の行でだけ呼ぶ)。読まない行は undefined。 */
28
+ export const keyValueCell = (row: string, tableOf: () => readonly string[], labels: readonly string[]): ValueCell | undefined => {
29
+ if (!TABLE_ROW.test(row)) return undefined;
30
+ const cells = cellsOfRow(row);
31
+ const [label, value] = cells;
32
+ if (cells.length !== KEY_VALUE_CELLS || label === undefined || value === undefined || !isLabelCell(label.text, labels)) return undefined;
33
+ return tableOf().filter((other) => isLabelRow(other, labels)).length === 1 ? { from: value.start, to: value.end } : undefined;
34
+ };
35
+
36
+ /** index の行を含む、続いた表の行(| で始まる行)。表の行でなければ空。 */
37
+ export const tableAround = (rows: readonly string[], index: number): string[] => {
38
+ const isRow = (at: number): boolean => TABLE_ROW.test(rows[at] ?? "");
39
+ if (!isRow(index)) return [];
40
+ let first = index;
41
+ while (isRow(first - 1)) first -= 1;
42
+ let last = index;
43
+ while (isRow(last + 1)) last += 1;
44
+ return rows.slice(first, last + 1);
45
+ };
@@ -0,0 +1,21 @@
1
+ // The columns of a lab or checkup results table, named by their headings: the result, the reference range, the flag and
2
+ // the unit. reference-flag-mismatch and reference-unit-mismatch both read a table through this; each brings its own way of
3
+ // reducing a heading (which brackets it leaves out) and its own choice of which columns it needs. Pure.
4
+
5
+ export type LabColumn = "result" | "range" | "flag" | "unit";
6
+
7
+ export type LabColumnWord = { readonly pattern: string; readonly column: LabColumn };
8
+
9
+ /** A heading reduced to what is compared with the words: case, width and a note in brackets left out. */
10
+ type HeadingKey = (heading: string) => string;
11
+
12
+ const LAB_COLUMNS: ReadonlySet<string> = new Set<LabColumn>(["result", "range", "flag", "unit"]);
13
+
14
+ export const isLabColumn = (group: string | undefined): group is LabColumn => group !== undefined && LAB_COLUMNS.has(group);
15
+
16
+ /** The column each heading names, by the first word whose key is the heading's key; undefined for a heading no word names. */
17
+ export const labColumnsOf = (headings: readonly string[], words: readonly LabColumnWord[], keyOf: HeadingKey): (LabColumn | undefined)[] =>
18
+ headings.map((heading) => {
19
+ const key = keyOf(heading);
20
+ return words.find((word) => keyOf(word.pattern) === key)?.column;
21
+ });