chaffjs 0.33.0 → 0.35.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 (802) hide show
  1. package/dist/api.d.ts +7 -1
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js.map +1 -1
  4. package/dist/capitals-passage.d.ts +3 -0
  5. package/dist/capitals-passage.d.ts.map +1 -0
  6. package/dist/capitals-passage.js +26 -0
  7. package/dist/capitals-passage.js.map +1 -0
  8. package/dist/cli-text.d.ts.map +1 -1
  9. package/dist/cli-text.js +4 -2
  10. package/dist/cli-text.js.map +1 -1
  11. package/dist/coined-hyphen-name.d.ts +13 -0
  12. package/dist/coined-hyphen-name.d.ts.map +1 -0
  13. package/dist/coined-hyphen-name.js +21 -0
  14. package/dist/coined-hyphen-name.js.map +1 -0
  15. package/dist/commands/grade.d.ts.map +1 -1
  16. package/dist/commands/grade.js +66 -21
  17. package/dist/commands/grade.js.map +1 -1
  18. package/dist/company-kana-spelling.d.ts +6 -1
  19. package/dist/company-kana-spelling.d.ts.map +1 -1
  20. package/dist/company-kana-spelling.js +19 -2
  21. package/dist/company-kana-spelling.js.map +1 -1
  22. package/dist/company-name-ending.d.ts +7 -0
  23. package/dist/company-name-ending.d.ts.map +1 -0
  24. package/dist/company-name-ending.js +44 -0
  25. package/dist/company-name-ending.js.map +1 -0
  26. package/dist/company-names.d.ts +17 -4
  27. package/dist/company-names.d.ts.map +1 -1
  28. package/dist/company-names.js +49 -17
  29. package/dist/company-names.js.map +1 -1
  30. package/dist/custom/no-rewrite.d.ts +3 -0
  31. package/dist/custom/no-rewrite.d.ts.map +1 -0
  32. package/dist/custom/no-rewrite.js +3 -0
  33. package/dist/custom/no-rewrite.js.map +1 -0
  34. package/dist/custom/parse.d.ts.map +1 -1
  35. package/dist/custom/parse.js +14 -2
  36. package/dist/custom/parse.js.map +1 -1
  37. package/dist/detectors/acronym-context.d.ts +1 -1
  38. package/dist/detectors/acronym-context.d.ts.map +1 -1
  39. package/dist/detectors/acronym-context.js +4 -4
  40. package/dist/detectors/acronym-context.js.map +1 -1
  41. package/dist/detectors/acronym-definition.d.ts +13 -0
  42. package/dist/detectors/acronym-definition.d.ts.map +1 -0
  43. package/dist/detectors/acronym-definition.js +90 -0
  44. package/dist/detectors/acronym-definition.js.map +1 -0
  45. package/dist/detectors/acronym-lone.d.ts +13 -0
  46. package/dist/detectors/acronym-lone.d.ts.map +1 -0
  47. package/dist/detectors/acronym-lone.js +22 -0
  48. package/dist/detectors/acronym-lone.js.map +1 -0
  49. package/dist/detectors/acronym-name.d.ts +55 -0
  50. package/dist/detectors/acronym-name.d.ts.map +1 -0
  51. package/dist/detectors/acronym-name.js +75 -0
  52. package/dist/detectors/acronym-name.js.map +1 -0
  53. package/dist/detectors/age-words.d.ts +5 -0
  54. package/dist/detectors/age-words.d.ts.map +1 -0
  55. package/dist/detectors/age-words.js +8 -0
  56. package/dist/detectors/age-words.js.map +1 -0
  57. package/dist/detectors/annual-pay-mismatch.d.ts.map +1 -1
  58. package/dist/detectors/annual-pay-mismatch.js +2 -12
  59. package/dist/detectors/annual-pay-mismatch.js.map +1 -1
  60. package/dist/detectors/blank-structure.d.ts.map +1 -1
  61. package/dist/detectors/blank-structure.js +4 -3
  62. package/dist/detectors/blank-structure.js.map +1 -1
  63. package/dist/detectors/capitalised-term.d.ts +14 -2
  64. package/dist/detectors/capitalised-term.d.ts.map +1 -1
  65. package/dist/detectors/capitalised-term.js +115 -4
  66. package/dist/detectors/capitalised-term.js.map +1 -1
  67. package/dist/detectors/caps-caption.d.ts +11 -0
  68. package/dist/detectors/caps-caption.d.ts.map +1 -0
  69. package/dist/detectors/caps-caption.js +51 -0
  70. package/dist/detectors/caps-caption.js.map +1 -0
  71. package/dist/detectors/char-shape.d.ts.map +1 -1
  72. package/dist/detectors/char-shape.js +47 -18
  73. package/dist/detectors/char-shape.js.map +1 -1
  74. package/dist/detectors/clause-shape.d.ts +1 -1
  75. package/dist/detectors/clause-shape.d.ts.map +1 -1
  76. package/dist/detectors/clause-shape.js +9 -4
  77. package/dist/detectors/clause-shape.js.map +1 -1
  78. package/dist/detectors/closing-balance-mismatch.d.ts.map +1 -1
  79. package/dist/detectors/closing-balance-mismatch.js +1 -0
  80. package/dist/detectors/closing-balance-mismatch.js.map +1 -1
  81. package/dist/detectors/code-fences.d.ts +5 -0
  82. package/dist/detectors/code-fences.d.ts.map +1 -1
  83. package/dist/detectors/code-fences.js +9 -0
  84. package/dist/detectors/code-fences.js.map +1 -1
  85. package/dist/detectors/concrete-evidence.d.ts +13 -1
  86. package/dist/detectors/concrete-evidence.d.ts.map +1 -1
  87. package/dist/detectors/concrete-evidence.js +59 -0
  88. package/dist/detectors/concrete-evidence.js.map +1 -1
  89. package/dist/detectors/condition-toki.d.ts +16 -0
  90. package/dist/detectors/condition-toki.d.ts.map +1 -0
  91. package/dist/detectors/condition-toki.js +42 -0
  92. package/dist/detectors/condition-toki.js.map +1 -0
  93. package/dist/detectors/conjugated-entry.d.ts +17 -0
  94. package/dist/detectors/conjugated-entry.d.ts.map +1 -0
  95. package/dist/detectors/conjugated-entry.js +50 -0
  96. package/dist/detectors/conjugated-entry.js.map +1 -0
  97. package/dist/detectors/content-morphemes.d.ts +2 -0
  98. package/dist/detectors/content-morphemes.d.ts.map +1 -1
  99. package/dist/detectors/content-morphemes.js +1 -1
  100. package/dist/detectors/content-morphemes.js.map +1 -1
  101. package/dist/detectors/contraction-minority.d.ts +11 -0
  102. package/dist/detectors/contraction-minority.d.ts.map +1 -0
  103. package/dist/detectors/contraction-minority.js +10 -0
  104. package/dist/detectors/contraction-minority.js.map +1 -0
  105. package/dist/detectors/counter-edge.d.ts +5 -0
  106. package/dist/detectors/counter-edge.d.ts.map +1 -1
  107. package/dist/detectors/counter-edge.js +23 -0
  108. package/dist/detectors/counter-edge.js.map +1 -1
  109. package/dist/detectors/cross-facts.d.ts.map +1 -1
  110. package/dist/detectors/cross-facts.js +2 -1
  111. package/dist/detectors/cross-facts.js.map +1 -1
  112. package/dist/detectors/custom.d.ts.map +1 -1
  113. package/dist/detectors/custom.js +8 -2
  114. package/dist/detectors/custom.js.map +1 -1
  115. package/dist/detectors/date-any-year.d.ts +6 -3
  116. package/dist/detectors/date-any-year.d.ts.map +1 -1
  117. package/dist/detectors/date-any-year.js +47 -10
  118. package/dist/detectors/date-any-year.js.map +1 -1
  119. package/dist/detectors/date-heading-year.d.ts +18 -0
  120. package/dist/detectors/date-heading-year.d.ts.map +1 -0
  121. package/dist/detectors/date-heading-year.js +38 -0
  122. package/dist/detectors/date-heading-year.js.map +1 -0
  123. package/dist/detectors/date-year.d.ts +12 -2
  124. package/dist/detectors/date-year.d.ts.map +1 -1
  125. package/dist/detectors/date-year.js +31 -6
  126. package/dist/detectors/date-year.js.map +1 -1
  127. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  128. package/dist/detectors/defined-term-form.js +26 -5
  129. package/dist/detectors/defined-term-form.js.map +1 -1
  130. package/dist/detectors/document-shape.d.ts.map +1 -1
  131. package/dist/detectors/document-shape.js +6 -0
  132. package/dist/detectors/document-shape.js.map +1 -1
  133. package/dist/detectors/due-date.d.ts.map +1 -1
  134. package/dist/detectors/due-date.js +18 -2
  135. package/dist/detectors/due-date.js.map +1 -1
  136. package/dist/detectors/en-shape.d.ts.map +1 -1
  137. package/dist/detectors/en-shape.js +5 -1
  138. package/dist/detectors/en-shape.js.map +1 -1
  139. package/dist/detectors/fact-consistency.d.ts.map +1 -1
  140. package/dist/detectors/fact-consistency.js +15 -15
  141. package/dist/detectors/fact-consistency.js.map +1 -1
  142. package/dist/detectors/form-line.d.ts +9 -0
  143. package/dist/detectors/form-line.d.ts.map +1 -0
  144. package/dist/detectors/form-line.js +36 -0
  145. package/dist/detectors/form-line.js.map +1 -0
  146. package/dist/detectors/formula-amount.d.ts.map +1 -1
  147. package/dist/detectors/formula-amount.js +2 -12
  148. package/dist/detectors/formula-amount.js.map +1 -1
  149. package/dist/detectors/gram-passages.d.ts +11 -0
  150. package/dist/detectors/gram-passages.d.ts.map +1 -0
  151. package/dist/detectors/gram-passages.js +26 -0
  152. package/dist/detectors/gram-passages.js.map +1 -0
  153. package/dist/detectors/heading-claim.d.ts +14 -0
  154. package/dist/detectors/heading-claim.d.ts.map +1 -0
  155. package/dist/detectors/heading-claim.js +49 -0
  156. package/dist/detectors/heading-claim.js.map +1 -0
  157. package/dist/detectors/heading-echo.d.ts.map +1 -1
  158. package/dist/detectors/heading-echo.js +29 -1
  159. package/dist/detectors/heading-echo.js.map +1 -1
  160. package/dist/detectors/heading-end-mark.d.ts +8 -3
  161. package/dist/detectors/heading-end-mark.d.ts.map +1 -1
  162. package/dist/detectors/heading-end-mark.js +18 -8
  163. package/dist/detectors/heading-end-mark.js.map +1 -1
  164. package/dist/detectors/heading-names.d.ts +7 -0
  165. package/dist/detectors/heading-names.d.ts.map +1 -0
  166. package/dist/detectors/heading-names.js +24 -0
  167. package/dist/detectors/heading-names.js.map +1 -0
  168. package/dist/detectors/heading-numbering.d.ts.map +1 -1
  169. package/dist/detectors/heading-numbering.js +7 -2
  170. package/dist/detectors/heading-numbering.js.map +1 -1
  171. package/dist/detectors/inch-mark.d.ts +10 -0
  172. package/dist/detectors/inch-mark.d.ts.map +1 -0
  173. package/dist/detectors/inch-mark.js +48 -0
  174. package/dist/detectors/inch-mark.js.map +1 -0
  175. package/dist/detectors/installment-total-mismatch.d.ts.map +1 -1
  176. package/dist/detectors/installment-total-mismatch.js +2 -12
  177. package/dist/detectors/installment-total-mismatch.js.map +1 -1
  178. package/dist/detectors/lexicon.d.ts +0 -1
  179. package/dist/detectors/lexicon.d.ts.map +1 -1
  180. package/dist/detectors/lexicon.js +29 -23
  181. package/dist/detectors/lexicon.js.map +1 -1
  182. package/dist/detectors/list-parallel.d.ts +5 -2
  183. package/dist/detectors/list-parallel.d.ts.map +1 -1
  184. package/dist/detectors/list-parallel.js +45 -7
  185. package/dist/detectors/list-parallel.js.map +1 -1
  186. package/dist/detectors/mark-shape.d.ts +6 -3
  187. package/dist/detectors/mark-shape.d.ts.map +1 -1
  188. package/dist/detectors/mark-shape.js +12 -6
  189. package/dist/detectors/mark-shape.js.map +1 -1
  190. package/dist/detectors/name-variant-apart.d.ts +27 -0
  191. package/dist/detectors/name-variant-apart.d.ts.map +1 -0
  192. package/dist/detectors/name-variant-apart.js +51 -0
  193. package/dist/detectors/name-variant-apart.js.map +1 -0
  194. package/dist/detectors/name-variant.d.ts.map +1 -1
  195. package/dist/detectors/name-variant.js +51 -17
  196. package/dist/detectors/name-variant.js.map +1 -1
  197. package/dist/detectors/number-unit.d.ts +10 -0
  198. package/dist/detectors/number-unit.d.ts.map +1 -1
  199. package/dist/detectors/number-unit.js +28 -8
  200. package/dist/detectors/number-unit.js.map +1 -1
  201. package/dist/detectors/numeral-word.d.ts +15 -0
  202. package/dist/detectors/numeral-word.d.ts.map +1 -0
  203. package/dist/detectors/numeral-word.js +26 -0
  204. package/dist/detectors/numeral-word.js.map +1 -0
  205. package/dist/detectors/organisation-run.d.ts +14 -0
  206. package/dist/detectors/organisation-run.d.ts.map +1 -0
  207. package/dist/detectors/organisation-run.js +73 -0
  208. package/dist/detectors/organisation-run.js.map +1 -0
  209. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  210. package/dist/detectors/orthographic-variant.js +13 -5
  211. package/dist/detectors/orthographic-variant.js.map +1 -1
  212. package/dist/detectors/orthography.d.ts.map +1 -1
  213. package/dist/detectors/orthography.js +16 -7
  214. package/dist/detectors/orthography.js.map +1 -1
  215. package/dist/detectors/outline-label.d.ts +14 -0
  216. package/dist/detectors/outline-label.d.ts.map +1 -0
  217. package/dist/detectors/outline-label.js +32 -0
  218. package/dist/detectors/outline-label.js.map +1 -0
  219. package/dist/detectors/page-marker.d.ts +6 -0
  220. package/dist/detectors/page-marker.d.ts.map +1 -0
  221. package/dist/detectors/page-marker.js +19 -0
  222. package/dist/detectors/page-marker.js.map +1 -0
  223. package/dist/detectors/parallel-definition.d.ts +16 -0
  224. package/dist/detectors/parallel-definition.d.ts.map +1 -0
  225. package/dist/detectors/parallel-definition.js +51 -0
  226. package/dist/detectors/parallel-definition.js.map +1 -0
  227. package/dist/detectors/per-unit-words.d.ts +7 -0
  228. package/dist/detectors/per-unit-words.d.ts.map +1 -0
  229. package/dist/detectors/per-unit-words.js +17 -0
  230. package/dist/detectors/per-unit-words.js.map +1 -0
  231. package/dist/detectors/period-multiple-mismatch.d.ts.map +1 -1
  232. package/dist/detectors/period-multiple-mismatch.js +2 -12
  233. package/dist/detectors/period-multiple-mismatch.js.map +1 -1
  234. package/dist/detectors/reference-number-variant.d.ts.map +1 -1
  235. package/dist/detectors/reference-number-variant.js +21 -3
  236. package/dist/detectors/reference-number-variant.js.map +1 -1
  237. package/dist/detectors/reference-text.d.ts.map +1 -1
  238. package/dist/detectors/reference-text.js +1 -0
  239. package/dist/detectors/reference-text.js.map +1 -1
  240. package/dist/detectors/registry/condition-toki.d.ts +3 -0
  241. package/dist/detectors/registry/condition-toki.d.ts.map +1 -0
  242. package/dist/detectors/registry/condition-toki.js +3 -0
  243. package/dist/detectors/registry/condition-toki.js.map +1 -0
  244. package/dist/detectors/registry/unfilled-placeholder.d.ts.map +1 -1
  245. package/dist/detectors/registry/unfilled-placeholder.js +2 -2
  246. package/dist/detectors/registry/unfilled-placeholder.js.map +1 -1
  247. package/dist/detectors/registry/vague-density.js +1 -1
  248. package/dist/detectors/registry/vague-density.js.map +1 -1
  249. package/dist/detectors/rent-multiple-mismatch.d.ts.map +1 -1
  250. package/dist/detectors/rent-multiple-mismatch.js +2 -12
  251. package/dist/detectors/rent-multiple-mismatch.js.map +1 -1
  252. package/dist/detectors/request-owner.d.ts +6 -2
  253. package/dist/detectors/request-owner.d.ts.map +1 -1
  254. package/dist/detectors/request-owner.js +57 -7
  255. package/dist/detectors/request-owner.js.map +1 -1
  256. package/dist/detectors/requirement-smell.d.ts.map +1 -1
  257. package/dist/detectors/requirement-smell.js +10 -2
  258. package/dist/detectors/requirement-smell.js.map +1 -1
  259. package/dist/detectors/row-sentence-amounts.d.ts.map +1 -1
  260. package/dist/detectors/row-sentence-amounts.js +5 -10
  261. package/dist/detectors/row-sentence-amounts.js.map +1 -1
  262. package/dist/detectors/sentence-length.d.ts.map +1 -1
  263. package/dist/detectors/sentence-length.js +24 -16
  264. package/dist/detectors/sentence-length.js.map +1 -1
  265. package/dist/detectors/sentence-rhythm.d.ts.map +1 -1
  266. package/dist/detectors/sentence-rhythm.js +6 -3
  267. package/dist/detectors/sentence-rhythm.js.map +1 -1
  268. package/dist/detectors/series-label.d.ts +2 -1
  269. package/dist/detectors/series-label.d.ts.map +1 -1
  270. package/dist/detectors/series-label.js +10 -4
  271. package/dist/detectors/series-label.js.map +1 -1
  272. package/dist/detectors/signals.d.ts +4 -0
  273. package/dist/detectors/signals.d.ts.map +1 -1
  274. package/dist/detectors/signals.js +95 -36
  275. package/dist/detectors/signals.js.map +1 -1
  276. package/dist/detectors/stated-amounts.d.ts +4 -0
  277. package/dist/detectors/stated-amounts.d.ts.map +1 -0
  278. package/dist/detectors/stated-amounts.js +12 -0
  279. package/dist/detectors/stated-amounts.js.map +1 -0
  280. package/dist/detectors/step-time-sum.d.ts.map +1 -1
  281. package/dist/detectors/step-time-sum.js +2 -1
  282. package/dist/detectors/step-time-sum.js.map +1 -1
  283. package/dist/detectors/structure-tree.d.ts.map +1 -1
  284. package/dist/detectors/structure-tree.js +11 -7
  285. package/dist/detectors/structure-tree.js.map +1 -1
  286. package/dist/detectors/team.d.ts.map +1 -1
  287. package/dist/detectors/team.js +10 -6
  288. package/dist/detectors/team.js.map +1 -1
  289. package/dist/detectors/template-sections.d.ts +14 -0
  290. package/dist/detectors/template-sections.d.ts.map +1 -0
  291. package/dist/detectors/template-sections.js +25 -0
  292. package/dist/detectors/template-sections.js.map +1 -0
  293. package/dist/detectors/time-order.d.ts.map +1 -1
  294. package/dist/detectors/time-order.js +17 -13
  295. package/dist/detectors/time-order.js.map +1 -1
  296. package/dist/detectors/titled-run.d.ts +22 -0
  297. package/dist/detectors/titled-run.d.ts.map +1 -0
  298. package/dist/detectors/titled-run.js +34 -0
  299. package/dist/detectors/titled-run.js.map +1 -0
  300. package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
  301. package/dist/detectors/unbalanced-bracket.js +4 -0
  302. package/dist/detectors/unbalanced-bracket.js.map +1 -1
  303. package/dist/detectors/undefined-term.d.ts.map +1 -1
  304. package/dist/detectors/undefined-term.js +8 -0
  305. package/dist/detectors/undefined-term.js.map +1 -1
  306. package/dist/detectors/unfilled-placeholder.d.ts +4 -0
  307. package/dist/detectors/unfilled-placeholder.d.ts.map +1 -0
  308. package/dist/detectors/unfilled-placeholder.js +9 -0
  309. package/dist/detectors/unfilled-placeholder.js.map +1 -0
  310. package/dist/detectors/unknown-word.d.ts +4 -1
  311. package/dist/detectors/unknown-word.d.ts.map +1 -1
  312. package/dist/detectors/unknown-word.js +18 -2
  313. package/dist/detectors/unknown-word.js.map +1 -1
  314. package/dist/detectors/use-interval.d.ts +1 -0
  315. package/dist/detectors/use-interval.d.ts.map +1 -1
  316. package/dist/detectors/use-interval.js +15 -10
  317. package/dist/detectors/use-interval.js.map +1 -1
  318. package/dist/detectors/use-maximum.d.ts.map +1 -1
  319. package/dist/detectors/use-maximum.js +3 -1
  320. package/dist/detectors/use-maximum.js.map +1 -1
  321. package/dist/detectors/vague-density.d.ts +5 -0
  322. package/dist/detectors/vague-density.d.ts.map +1 -0
  323. package/dist/detectors/vague-density.js +52 -0
  324. package/dist/detectors/vague-density.js.map +1 -0
  325. package/dist/extension/document-view.d.ts +2 -2
  326. package/dist/extension/document-view.d.ts.map +1 -1
  327. package/dist/extension/document-view.js +17 -8
  328. package/dist/extension/document-view.js.map +1 -1
  329. package/dist/extension/entry-genres.d.ts +5 -0
  330. package/dist/extension/entry-genres.d.ts.map +1 -0
  331. package/dist/extension/entry-genres.js +13 -0
  332. package/dist/extension/entry-genres.js.map +1 -0
  333. package/dist/extension/module-detector.d.ts.map +1 -1
  334. package/dist/extension/module-detector.js +4 -4
  335. package/dist/extension/module-detector.js.map +1 -1
  336. package/dist/extension/plugin-parse.d.ts +1 -1
  337. package/dist/extension/plugin-parse.d.ts.map +1 -1
  338. package/dist/extension/plugin-parse.js +24 -7
  339. package/dist/extension/plugin-parse.js.map +1 -1
  340. package/dist/extension/problem-text.d.ts.map +1 -1
  341. package/dist/extension/problem-text.js +2 -0
  342. package/dist/extension/problem-text.js.map +1 -1
  343. package/dist/facts/age-values.d.ts.map +1 -1
  344. package/dist/facts/age-values.js +20 -2
  345. package/dist/facts/age-values.js.map +1 -1
  346. package/dist/facts/column-units.d.ts +31 -0
  347. package/dist/facts/column-units.d.ts.map +1 -0
  348. package/dist/facts/column-units.js +37 -0
  349. package/dist/facts/column-units.js.map +1 -0
  350. package/dist/facts/fact-scope.d.ts +10 -1
  351. package/dist/facts/fact-scope.d.ts.map +1 -1
  352. package/dist/facts/fact-scope.js +34 -3
  353. package/dist/facts/fact-scope.js.map +1 -1
  354. package/dist/facts/fact-values.d.ts +4 -0
  355. package/dist/facts/fact-values.d.ts.map +1 -1
  356. package/dist/facts/fact-values.js +3 -1
  357. package/dist/facts/fact-values.js.map +1 -1
  358. package/dist/facts/labelled-facts.d.ts +10 -0
  359. package/dist/facts/labelled-facts.d.ts.map +1 -1
  360. package/dist/facts/labelled-facts.js +6 -1
  361. package/dist/facts/labelled-facts.js.map +1 -1
  362. package/dist/facts/per-unit.d.ts +36 -0
  363. package/dist/facts/per-unit.d.ts.map +1 -0
  364. package/dist/facts/per-unit.js +56 -0
  365. package/dist/facts/per-unit.js.map +1 -0
  366. package/dist/facts/row-sentence-amounts.d.ts +3 -12
  367. package/dist/facts/row-sentence-amounts.d.ts.map +1 -1
  368. package/dist/facts/row-sentence-amounts.js +1 -15
  369. package/dist/facts/row-sentence-amounts.js.map +1 -1
  370. package/dist/facts/table-facts.d.ts +13 -3
  371. package/dist/facts/table-facts.d.ts.map +1 -1
  372. package/dist/facts/table-facts.js +35 -13
  373. package/dist/facts/table-facts.js.map +1 -1
  374. package/dist/facts/term-values.d.ts +13 -1
  375. package/dist/facts/term-values.d.ts.map +1 -1
  376. package/dist/facts/term-values.js +71 -12
  377. package/dist/facts/term-values.js.map +1 -1
  378. package/dist/grade/baseline.d.ts +4 -2
  379. package/dist/grade/baseline.d.ts.map +1 -1
  380. package/dist/grade/baseline.js +13 -11
  381. package/dist/grade/baseline.js.map +1 -1
  382. package/dist/grade/expect-read.d.ts +16 -0
  383. package/dist/grade/expect-read.d.ts.map +1 -0
  384. package/dist/grade/expect-read.js +52 -0
  385. package/dist/grade/expect-read.js.map +1 -0
  386. package/dist/grade/expect.d.ts +50 -0
  387. package/dist/grade/expect.d.ts.map +1 -0
  388. package/dist/grade/expect.js +53 -0
  389. package/dist/grade/expect.js.map +1 -0
  390. package/dist/grade/grade-item.d.ts +1 -1
  391. package/dist/grade/grade-item.d.ts.map +1 -1
  392. package/dist/grade/grade-item.js +13 -3
  393. package/dist/grade/grade-item.js.map +1 -1
  394. package/dist/grade/item.d.ts +9 -1
  395. package/dist/grade/item.d.ts.map +1 -1
  396. package/dist/grade/item.js +32 -7
  397. package/dist/grade/item.js.map +1 -1
  398. package/dist/grade/result.d.ts +5 -0
  399. package/dist/grade/result.d.ts.map +1 -1
  400. package/dist/grade/results-read.d.ts.map +1 -1
  401. package/dist/grade/results-read.js +4 -2
  402. package/dist/grade/results-read.js.map +1 -1
  403. package/dist/grade/rubric-file.d.ts +23 -0
  404. package/dist/grade/rubric-file.d.ts.map +1 -0
  405. package/dist/grade/rubric-file.js +35 -0
  406. package/dist/grade/rubric-file.js.map +1 -0
  407. package/dist/grade/rubric.d.ts +2 -0
  408. package/dist/grade/rubric.d.ts.map +1 -1
  409. package/dist/grade/rubric.js +75 -47
  410. package/dist/grade/rubric.js.map +1 -1
  411. package/dist/grade/setup.d.ts +2 -1
  412. package/dist/grade/setup.d.ts.map +1 -1
  413. package/dist/grade/setup.js +2 -2
  414. package/dist/grade/setup.js.map +1 -1
  415. package/dist/grade/stamp.d.ts +2 -0
  416. package/dist/grade/stamp.d.ts.map +1 -1
  417. package/dist/grade/stamp.js +8 -2
  418. package/dist/grade/stamp.js.map +1 -1
  419. package/dist/grade/task-rubric.d.ts +16 -0
  420. package/dist/grade/task-rubric.d.ts.map +1 -0
  421. package/dist/grade/task-rubric.js +34 -0
  422. package/dist/grade/task-rubric.js.map +1 -0
  423. package/dist/grade/text.d.ts +5 -1
  424. package/dist/grade/text.d.ts.map +1 -1
  425. package/dist/grade/text.js +16 -4
  426. package/dist/grade/text.js.map +1 -1
  427. package/dist/grade-api.d.ts +9 -2
  428. package/dist/grade-api.d.ts.map +1 -1
  429. package/dist/grade-api.js +31 -15
  430. package/dist/grade-api.js.map +1 -1
  431. package/dist/heading-numbering.d.ts +5 -2
  432. package/dist/heading-numbering.d.ts.map +1 -1
  433. package/dist/heading-numbering.js +27 -6
  434. package/dist/heading-numbering.js.map +1 -1
  435. package/dist/name-char-reading.d.ts +5 -0
  436. package/dist/name-char-reading.d.ts.map +1 -1
  437. package/dist/name-char-reading.js +15 -0
  438. package/dist/name-char-reading.js.map +1 -1
  439. package/dist/name-end-letter.d.ts +24 -0
  440. package/dist/name-end-letter.d.ts.map +1 -0
  441. package/dist/name-end-letter.js +45 -0
  442. package/dist/name-end-letter.js.map +1 -0
  443. package/dist/name-given-before.d.ts +15 -0
  444. package/dist/name-given-before.d.ts.map +1 -0
  445. package/dist/name-given-before.js +30 -0
  446. package/dist/name-given-before.js.map +1 -0
  447. package/dist/name-neighbours.d.ts.map +1 -1
  448. package/dist/name-neighbours.js +2 -1
  449. package/dist/name-neighbours.js.map +1 -1
  450. package/dist/name-separator.d.ts +6 -0
  451. package/dist/name-separator.d.ts.map +1 -1
  452. package/dist/name-separator.js +80 -0
  453. package/dist/name-separator.js.map +1 -1
  454. package/dist/name-variants.d.ts +8 -3
  455. package/dist/name-variants.d.ts.map +1 -1
  456. package/dist/name-variants.js +40 -12
  457. package/dist/name-variants.js.map +1 -1
  458. package/dist/name-word-order.d.ts +9 -5
  459. package/dist/name-word-order.d.ts.map +1 -1
  460. package/dist/name-word-order.js +47 -15
  461. package/dist/name-word-order.js.map +1 -1
  462. package/dist/nominal-stem.d.ts +13 -0
  463. package/dist/nominal-stem.d.ts.map +1 -0
  464. package/dist/nominal-stem.js +32 -0
  465. package/dist/nominal-stem.js.map +1 -0
  466. package/dist/number-name.d.ts.map +1 -1
  467. package/dist/number-name.js +11 -2
  468. package/dist/number-name.js.map +1 -1
  469. package/dist/profile/cue-lines.d.ts +6 -0
  470. package/dist/profile/cue-lines.d.ts.map +1 -0
  471. package/dist/profile/cue-lines.js +13 -0
  472. package/dist/profile/cue-lines.js.map +1 -0
  473. package/dist/profile/parse.d.ts +1 -1
  474. package/dist/profile/parse.d.ts.map +1 -1
  475. package/dist/profile/parse.js +3 -2
  476. package/dist/profile/parse.js.map +1 -1
  477. package/dist/reference-numbers.d.ts +2 -0
  478. package/dist/reference-numbers.d.ts.map +1 -1
  479. package/dist/reference-numbers.js +1 -1
  480. package/dist/reference-numbers.js.map +1 -1
  481. package/dist/sentence-load.d.ts +2 -1
  482. package/dist/sentence-load.d.ts.map +1 -1
  483. package/dist/sentence-load.js +6 -2
  484. package/dist/sentence-load.js.map +1 -1
  485. package/dist/spaced-person-name.d.ts.map +1 -1
  486. package/dist/spaced-person-name.js +26 -1
  487. package/dist/spaced-person-name.js.map +1 -1
  488. package/dist/spacing-code.d.ts.map +1 -1
  489. package/dist/spacing-code.js +10 -1
  490. package/dist/spacing-code.js.map +1 -1
  491. package/dist/spacing-minority.d.ts +7 -0
  492. package/dist/spacing-minority.d.ts.map +1 -1
  493. package/dist/spacing-minority.js +14 -0
  494. package/dist/spacing-minority.js.map +1 -1
  495. package/dist/structure/cited-document-section.d.ts +7 -0
  496. package/dist/structure/cited-document-section.d.ts.map +1 -0
  497. package/dist/structure/cited-document-section.js +33 -0
  498. package/dist/structure/cited-document-section.js.map +1 -0
  499. package/dist/structure/closing-balance.d.ts +9 -0
  500. package/dist/structure/closing-balance.d.ts.map +1 -1
  501. package/dist/structure/closing-balance.js +34 -7
  502. package/dist/structure/closing-balance.js.map +1 -1
  503. package/dist/structure/definition-use.d.ts.map +1 -1
  504. package/dist/structure/definition-use.js +20 -1
  505. package/dist/structure/definition-use.js.map +1 -1
  506. package/dist/structure/document-context.d.ts +2 -0
  507. package/dist/structure/document-context.d.ts.map +1 -0
  508. package/dist/structure/document-context.js +42 -0
  509. package/dist/structure/document-context.js.map +1 -0
  510. package/dist/structure/fenced-lines.d.ts +7 -0
  511. package/dist/structure/fenced-lines.d.ts.map +1 -0
  512. package/dist/structure/fenced-lines.js +27 -0
  513. package/dist/structure/fenced-lines.js.map +1 -0
  514. package/dist/structure/html-text-blocks.d.ts +8 -0
  515. package/dist/structure/html-text-blocks.d.ts.map +1 -0
  516. package/dist/structure/html-text-blocks.js +47 -0
  517. package/dist/structure/html-text-blocks.js.map +1 -0
  518. package/dist/structure/issues.d.ts +1 -1
  519. package/dist/structure/issues.d.ts.map +1 -1
  520. package/dist/structure/issues.js +19 -4
  521. package/dist/structure/issues.js.map +1 -1
  522. package/dist/structure/labelled-date-order.d.ts +34 -9
  523. package/dist/structure/labelled-date-order.d.ts.map +1 -1
  524. package/dist/structure/labelled-date-order.js +60 -15
  525. package/dist/structure/labelled-date-order.js.map +1 -1
  526. package/dist/structure/labelled-order.d.ts +10 -1
  527. package/dist/structure/labelled-order.d.ts.map +1 -1
  528. package/dist/structure/labelled-order.js +18 -6
  529. package/dist/structure/labelled-order.js.map +1 -1
  530. package/dist/structure/line-amount-label.d.ts.map +1 -1
  531. package/dist/structure/line-amount-label.js +2 -1
  532. package/dist/structure/line-amount-label.js.map +1 -1
  533. package/dist/structure/line-amount.d.ts +0 -5
  534. package/dist/structure/line-amount.d.ts.map +1 -1
  535. package/dist/structure/line-amount.js +1 -10
  536. package/dist/structure/line-amount.js.map +1 -1
  537. package/dist/structure/list-numbering.d.ts +20 -4
  538. package/dist/structure/list-numbering.d.ts.map +1 -1
  539. package/dist/structure/list-numbering.js +65 -9
  540. package/dist/structure/list-numbering.js.map +1 -1
  541. package/dist/structure/listed-paragraph.d.ts +16 -0
  542. package/dist/structure/listed-paragraph.d.ts.map +1 -0
  543. package/dist/structure/listed-paragraph.js +37 -0
  544. package/dist/structure/listed-paragraph.js.map +1 -0
  545. package/dist/structure/numbering.d.ts +3 -2
  546. package/dist/structure/numbering.d.ts.map +1 -1
  547. package/dist/structure/numbering.js +31 -6
  548. package/dist/structure/numbering.js.map +1 -1
  549. package/dist/structure/prose-total.d.ts +8 -0
  550. package/dist/structure/prose-total.d.ts.map +1 -1
  551. package/dist/structure/prose-total.js +70 -2
  552. package/dist/structure/prose-total.js.map +1 -1
  553. package/dist/structure/reference-text.d.ts +9 -1
  554. package/dist/structure/reference-text.d.ts.map +1 -1
  555. package/dist/structure/reference-text.js +21 -3
  556. package/dist/structure/reference-text.js.map +1 -1
  557. package/dist/structure/runs.d.ts.map +1 -1
  558. package/dist/structure/runs.js +9 -1
  559. package/dist/structure/runs.js.map +1 -1
  560. package/dist/structure/section-names.d.ts +12 -0
  561. package/dist/structure/section-names.d.ts.map +1 -0
  562. package/dist/structure/section-names.js +26 -0
  563. package/dist/structure/section-names.js.map +1 -0
  564. package/dist/structure/signed-date-line.d.ts +15 -0
  565. package/dist/structure/signed-date-line.d.ts.map +1 -0
  566. package/dist/structure/signed-date-line.js +68 -0
  567. package/dist/structure/signed-date-line.js.map +1 -0
  568. package/dist/structure/tax.d.ts.map +1 -1
  569. package/dist/structure/tax.js +5 -3
  570. package/dist/structure/tax.js.map +1 -1
  571. package/dist/structure/total-line.d.ts.map +1 -1
  572. package/dist/structure/total-line.js +10 -6
  573. package/dist/structure/total-line.js.map +1 -1
  574. package/dist/structure/total.d.ts +2 -0
  575. package/dist/structure/total.d.ts.map +1 -1
  576. package/dist/structure/total.js +34 -3
  577. package/dist/structure/total.js.map +1 -1
  578. package/dist/structure/versioned-label.d.ts +16 -0
  579. package/dist/structure/versioned-label.d.ts.map +1 -0
  580. package/dist/structure/versioned-label.js +48 -0
  581. package/dist/structure/versioned-label.js.map +1 -0
  582. package/dist/structure/written-headings.d.ts +31 -0
  583. package/dist/structure/written-headings.d.ts.map +1 -0
  584. package/dist/structure/written-headings.js +119 -0
  585. package/dist/structure/written-headings.js.map +1 -0
  586. package/dist/structure/written-resolve.d.ts +12 -0
  587. package/dist/structure/written-resolve.d.ts.map +1 -0
  588. package/dist/structure/written-resolve.js +49 -0
  589. package/dist/structure/written-resolve.js.map +1 -0
  590. package/dist/subject-codes.d.ts +21 -0
  591. package/dist/subject-codes.d.ts.map +1 -0
  592. package/dist/subject-codes.js +79 -0
  593. package/dist/subject-codes.js.map +1 -0
  594. package/dist/unlabelled-references.d.ts +6 -2
  595. package/dist/unlabelled-references.d.ts.map +1 -1
  596. package/dist/unlabelled-references.js +11 -10
  597. package/dist/unlabelled-references.js.map +1 -1
  598. package/genres.yaml +17 -0
  599. package/package.json +3 -3
  600. package/profiles/listing.yaml +1 -1
  601. package/rules/all-caps-shouting.yaml +2 -2
  602. package/rules/closing-balance-mismatch.yaml +3 -3
  603. package/rules/concrete-evidence-density.yaml +2 -2
  604. package/rules/contraction-consistency.yaml +13 -13
  605. package/rules/dangling-reference.yaml +2 -2
  606. package/rules/date-without-year.yaml +2 -2
  607. package/rules/defined-name-repeated.yaml +2 -2
  608. package/rules/due-before-issue.yaml +9 -5
  609. package/rules/fact-conflict.yaml +2 -2
  610. package/rules/heading-echo.yaml +2 -2
  611. package/rules/heading-end-punctuation-mix.yaml +2 -2
  612. package/rules/heading-numbering-mix.yaml +2 -2
  613. package/rules/internal-jargon.yaml +2 -2
  614. package/rules/latin-spacing.yaml +4 -4
  615. package/rules/list-item-form-mix.yaml +1 -1
  616. package/rules/max-kanji-continuous.yaml +5 -3
  617. package/rules/max-sentence-length.yaml +3 -2
  618. package/rules/name-variant.yaml +5 -2
  619. package/rules/ngram-repetition.yaml +2 -2
  620. package/rules/no-lead.yaml +2 -2
  621. package/rules/number-without-unit.yaml +2 -2
  622. package/rules/numbering-gap.yaml +2 -2
  623. package/rules/orthographic-variant.yaml +2 -2
  624. package/rules/reference-number-variant.yaml +3 -3
  625. package/rules/reference-title-mismatch.yaml +2 -2
  626. package/rules/repeated-sentence-ending.yaml +3 -2
  627. package/rules/request-without-deadline.yaml +2 -2
  628. package/rules/requirement-smell.yaml +2 -2
  629. package/rules/sentence-rhythm.yaml +2 -2
  630. package/rules/title-case-consistency.yaml +2 -2
  631. package/rules/toki-as-condition.yaml +71 -0
  632. package/rules/total-mismatch.yaml +4 -4
  633. package/rules/unbalanced-bracket.yaml +2 -2
  634. package/rules/undefined-acronym.yaml +11 -2
  635. package/rules/undefined-term.yaml +2 -2
  636. package/rules/unfilled-placeholder.yaml +2 -2
  637. package/rules/unknown-word.yaml +2 -2
  638. package/rules/use-before-definition.yaml +2 -2
  639. package/rules/vague-word-density.yaml +2 -2
  640. package/src/api.ts +11 -2
  641. package/src/capitals-passage.ts +31 -0
  642. package/src/cli-text.ts +4 -2
  643. package/src/coined-hyphen-name.ts +27 -0
  644. package/src/commands/grade.ts +75 -23
  645. package/src/company-kana-spelling.ts +22 -2
  646. package/src/company-name-ending.ts +50 -0
  647. package/src/company-names.ts +76 -20
  648. package/src/custom/no-rewrite.ts +2 -0
  649. package/src/custom/parse.ts +18 -2
  650. package/src/detectors/acronym-context.ts +5 -6
  651. package/src/detectors/acronym-definition.ts +123 -0
  652. package/src/detectors/acronym-lone.ts +26 -0
  653. package/src/detectors/acronym-name.ts +117 -0
  654. package/src/detectors/age-words.ts +12 -0
  655. package/src/detectors/annual-pay-mismatch.ts +3 -18
  656. package/src/detectors/blank-structure.ts +4 -3
  657. package/src/detectors/capitalised-term.ts +154 -4
  658. package/src/detectors/caps-caption.ts +61 -0
  659. package/src/detectors/char-shape.ts +74 -22
  660. package/src/detectors/clause-shape.ts +14 -4
  661. package/src/detectors/closing-balance-mismatch.ts +1 -0
  662. package/src/detectors/code-fences.ts +10 -0
  663. package/src/detectors/concrete-evidence.ts +77 -1
  664. package/src/detectors/condition-toki.ts +60 -0
  665. package/src/detectors/conjugated-entry.ts +53 -0
  666. package/src/detectors/content-morphemes.ts +2 -1
  667. package/src/detectors/contraction-minority.ts +11 -0
  668. package/src/detectors/counter-edge.ts +23 -0
  669. package/src/detectors/cross-facts.ts +2 -1
  670. package/src/detectors/custom.ts +9 -2
  671. package/src/detectors/date-any-year.ts +56 -10
  672. package/src/detectors/date-heading-year.ts +55 -0
  673. package/src/detectors/date-year.ts +54 -9
  674. package/src/detectors/defined-term-form.ts +26 -5
  675. package/src/detectors/document-shape.ts +8 -0
  676. package/src/detectors/due-date.ts +26 -7
  677. package/src/detectors/en-shape.ts +5 -1
  678. package/src/detectors/fact-consistency.ts +16 -19
  679. package/src/detectors/form-line.ts +47 -0
  680. package/src/detectors/formula-amount.ts +2 -18
  681. package/src/detectors/gram-passages.ts +36 -0
  682. package/src/detectors/heading-claim.ts +76 -0
  683. package/src/detectors/heading-echo.ts +32 -1
  684. package/src/detectors/heading-end-mark.ts +23 -10
  685. package/src/detectors/heading-names.ts +31 -0
  686. package/src/detectors/heading-numbering.ts +7 -2
  687. package/src/detectors/inch-mark.ts +49 -0
  688. package/src/detectors/installment-total-mismatch.ts +3 -18
  689. package/src/detectors/lexicon.ts +32 -21
  690. package/src/detectors/list-parallel.ts +46 -7
  691. package/src/detectors/mark-shape.ts +12 -6
  692. package/src/detectors/name-variant-apart.ts +63 -0
  693. package/src/detectors/name-variant.ts +73 -18
  694. package/src/detectors/number-unit.ts +35 -9
  695. package/src/detectors/numeral-word.ts +33 -0
  696. package/src/detectors/organisation-run.ts +86 -0
  697. package/src/detectors/orthographic-variant.ts +22 -6
  698. package/src/detectors/orthography.ts +17 -8
  699. package/src/detectors/outline-label.ts +48 -0
  700. package/src/detectors/page-marker.ts +26 -0
  701. package/src/detectors/parallel-definition.ts +64 -0
  702. package/src/detectors/per-unit-words.ts +24 -0
  703. package/src/detectors/period-multiple-mismatch.ts +2 -18
  704. package/src/detectors/reference-number-variant.ts +27 -5
  705. package/src/detectors/reference-text.ts +1 -0
  706. package/src/detectors/registry/condition-toki.ts +4 -0
  707. package/src/detectors/registry/unfilled-placeholder.ts +2 -2
  708. package/src/detectors/registry/vague-density.ts +1 -1
  709. package/src/detectors/rent-multiple-mismatch.ts +2 -18
  710. package/src/detectors/request-owner.ts +71 -8
  711. package/src/detectors/requirement-smell.ts +15 -2
  712. package/src/detectors/row-sentence-amounts.ts +5 -20
  713. package/src/detectors/sentence-length.ts +14 -6
  714. package/src/detectors/sentence-rhythm.ts +8 -4
  715. package/src/detectors/series-label.ts +13 -4
  716. package/src/detectors/signals.ts +94 -26
  717. package/src/detectors/stated-amounts.ts +20 -0
  718. package/src/detectors/step-time-sum.ts +2 -1
  719. package/src/detectors/structure-tree.ts +13 -8
  720. package/src/detectors/team.ts +13 -7
  721. package/src/detectors/template-sections.ts +37 -0
  722. package/src/detectors/time-order.ts +6 -3
  723. package/src/detectors/titled-run.ts +43 -0
  724. package/src/detectors/unbalanced-bracket.ts +3 -0
  725. package/src/detectors/undefined-term.ts +8 -0
  726. package/src/detectors/unfilled-placeholder.ts +10 -0
  727. package/src/detectors/unknown-word.ts +20 -2
  728. package/src/detectors/use-interval.ts +8 -4
  729. package/src/detectors/use-maximum.ts +3 -1
  730. package/src/detectors/vague-density.ts +68 -0
  731. package/src/extension/document-view.ts +18 -9
  732. package/src/extension/entry-genres.ts +15 -0
  733. package/src/extension/module-detector.ts +9 -4
  734. package/src/extension/plugin-parse.ts +29 -7
  735. package/src/extension/problem-text.ts +4 -0
  736. package/src/facts/age-values.ts +24 -2
  737. package/src/facts/column-units.ts +67 -0
  738. package/src/facts/fact-scope.ts +53 -4
  739. package/src/facts/fact-values.ts +11 -1
  740. package/src/facts/labelled-facts.ts +16 -2
  741. package/src/facts/per-unit.ts +105 -0
  742. package/src/facts/row-sentence-amounts.ts +4 -26
  743. package/src/facts/table-facts.ts +50 -10
  744. package/src/facts/term-values.ts +94 -13
  745. package/src/grade/baseline.ts +20 -12
  746. package/src/grade/expect-read.ts +65 -0
  747. package/src/grade/expect.ts +74 -0
  748. package/src/grade/grade-item.ts +14 -3
  749. package/src/grade/item.ts +48 -8
  750. package/src/grade/result.ts +5 -0
  751. package/src/grade/results-read.ts +7 -2
  752. package/src/grade/rubric-file.ts +46 -0
  753. package/src/grade/rubric.ts +77 -47
  754. package/src/grade/setup.ts +3 -3
  755. package/src/grade/stamp.ts +10 -2
  756. package/src/grade/task-rubric.ts +39 -0
  757. package/src/grade/text.ts +27 -5
  758. package/src/grade-api.ts +38 -16
  759. package/src/heading-numbering.ts +35 -8
  760. package/src/name-char-reading.ts +16 -0
  761. package/src/name-end-letter.ts +61 -0
  762. package/src/name-given-before.ts +40 -0
  763. package/src/name-neighbours.ts +2 -1
  764. package/src/name-separator.ts +93 -0
  765. package/src/name-variants.ts +69 -18
  766. package/src/name-word-order.ts +62 -17
  767. package/src/nominal-stem.ts +36 -0
  768. package/src/number-name.ts +12 -3
  769. package/src/profile/cue-lines.ts +14 -0
  770. package/src/profile/parse.ts +3 -2
  771. package/src/reference-numbers.ts +1 -1
  772. package/src/sentence-load.ts +7 -2
  773. package/src/spaced-person-name.ts +27 -2
  774. package/src/spacing-code.ts +13 -2
  775. package/src/spacing-minority.ts +17 -0
  776. package/src/structure/cited-document-section.ts +42 -0
  777. package/src/structure/closing-balance.ts +46 -8
  778. package/src/structure/definition-use.ts +24 -1
  779. package/src/structure/document-context.ts +46 -0
  780. package/src/structure/fenced-lines.ts +28 -0
  781. package/src/structure/html-text-blocks.ts +45 -0
  782. package/src/structure/issues.ts +19 -4
  783. package/src/structure/labelled-date-order.ts +108 -21
  784. package/src/structure/labelled-order.ts +33 -13
  785. package/src/structure/line-amount-label.ts +2 -1
  786. package/src/structure/line-amount.ts +1 -11
  787. package/src/structure/list-numbering.ts +100 -11
  788. package/src/structure/listed-paragraph.ts +45 -0
  789. package/src/structure/numbering.ts +48 -19
  790. package/src/structure/prose-total.ts +81 -2
  791. package/src/structure/reference-text.ts +25 -3
  792. package/src/structure/runs.ts +10 -1
  793. package/src/structure/section-names.ts +32 -0
  794. package/src/structure/signed-date-line.ts +78 -0
  795. package/src/structure/tax.ts +6 -3
  796. package/src/structure/total-line.ts +12 -6
  797. package/src/structure/total.ts +42 -3
  798. package/src/structure/versioned-label.ts +52 -0
  799. package/src/structure/written-headings.ts +137 -0
  800. package/src/structure/written-resolve.ts +57 -0
  801. package/src/subject-codes.ts +105 -0
  802. package/src/unlabelled-references.ts +24 -16
@@ -0,0 +1,49 @@
1
+ import { headingRegions, parentAndLabels, writtenHeadings, writtenSubdivisions } from "./written-headings.js";
2
+ const targetOf = (node) => String(node.attrs["target"] ?? "");
3
+ /**
4
+ * 括弧の小見出しを読む範囲。木の条は、項や号を一つも読まなかったときだけ、その条の始まりから次の平文の見出しまで。
5
+ * 項や号を読んでいれば、無い札は本当に無い。
6
+ */
7
+ const treeRegions = (nodes, headings) => {
8
+ const regions = new Map();
9
+ // 条も見出しも文書の順なので、次の見出しは前へ進めるだけで見つかる。
10
+ let next = 0;
11
+ nodes
12
+ .filter((node) => node.kind === "article" && !node.children.some((child) => child.kind === "item"))
13
+ .toSorted((left, right) => left.span.start - right.span.start)
14
+ .forEach((node) => {
15
+ while ((headings[next]?.start ?? Infinity) <= node.span.start)
16
+ next += 1;
17
+ const end = Math.min(headings[next]?.start ?? node.span.end, node.span.end);
18
+ const found = regions.get(node.address) ?? [];
19
+ found.push([node.span.start, end]);
20
+ regions.set(node.address, found);
21
+ });
22
+ return regions;
23
+ };
24
+ /**
25
+ * 平文の見出しの番地と、参照(Section 6.1(i))の親(6.1)が木の条か平文の見出しとしてあり、その範囲の本文に札「(i)」が
26
+ * 書かれているかを引く関数。範囲ごとの札は、要るときに一度だけ読む。Pure.
27
+ */
28
+ export const writtenReading = (nodes, source) => {
29
+ const references = nodes.filter((node) => node.kind === "reference").map((node) => ({ start: node.span.start, end: node.span.end, target: targetOf(node) }));
30
+ const headings = writtenHeadings(references, source);
31
+ const written = headingRegions(headings, source.length);
32
+ const tree = treeRegions(nodes, headings);
33
+ const labels = new Map();
34
+ const labelsIn = ([start, end]) => {
35
+ const key = `${String(start)}:${String(end)}`;
36
+ const found = labels.get(key) ?? writtenSubdivisions(source.slice(start, end));
37
+ labels.set(key, found);
38
+ return found;
39
+ };
40
+ const regionsOf = (address) => [...(tree.get(address) ?? []), ...(written.get(address) ?? [])];
41
+ const subdivision = (reference) => {
42
+ const wanted = parentAndLabels(targetOf(reference), String(reference.attrs["label"] ?? ""));
43
+ if (wanted === undefined)
44
+ return false;
45
+ return regionsOf(wanted.parent).some((region) => wanted.labels.every((label) => labelsIn(region).has(label)));
46
+ };
47
+ return { addresses: headings.map((heading) => heading.address), subdivision };
48
+ };
49
+ //# sourceMappingURL=written-resolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"written-resolve.js","sourceRoot":"","sources":["../../src/structure/written-resolve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAuB,MAAM,uBAAuB,CAAC;AASnI,MAAM,QAAQ,GAAG,CAAC,IAAmB,EAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,GAAG,CAAC,KAA+B,EAAE,QAAmC,EAAyB,EAAE;IAClH,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC5C,oCAAoC;IACpC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK;SACF,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC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E,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChH,CAAC,CAAC;IACF,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;AAChF,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { LexiconEntry } from "./plugin.ts";
2
+ import { type ReferenceNumber, type ReferenceVariant } from "./reference-numbers.ts";
3
+ /** Digits enough for a model's code (FT-38); the two letters a short code must hold keep out form names (A-12, B-21). */
4
+ export declare const MIN_SUBJECT_DIGITS = 2;
5
+ /** A short code: two letters or more before its hyphen, and two digits or more (FT-38, KR-M230; not A-12B). */
6
+ export declare const isSubjectCode: (written: string) => boolean;
7
+ /** What the document gives: its prose (tables masked), its title as written (the prose masks it), its labels, the groups that name an item, the codes its tables label, and every code in a table. */
8
+ export type SubjectCodeInput = {
9
+ readonly prose: string;
10
+ readonly title: {
11
+ readonly start: number;
12
+ readonly text: string;
13
+ } | undefined;
14
+ readonly labels: readonly LexiconEntry[];
15
+ readonly listed: ReadonlySet<string>;
16
+ readonly tabled: readonly ReferenceNumber[];
17
+ readonly known: ReadonlySet<string>;
18
+ };
19
+ /** The writings of the document's one code with two neighbours swapped, each written once, of a listed kind or unlabelled, on a line that does not name the code itself. */
20
+ export declare const subjectCodeVariants: (input: SubjectCodeInput) => ReferenceVariant[];
21
+ //# sourceMappingURL=subject-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subject-codes.d.ts","sourceRoot":"","sources":["../src/subject-codes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAQ,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAkD,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAGrI,yHAAyH;AACzH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAMpC,+GAA+G;AAC/G,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,OACkG,CAAC;AAEnJ,sMAAsM;AACtM,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAC9E,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACrC,CAAC;AAqDF,4KAA4K;AAC5K,eAAO,MAAM,mBAAmB,GAAI,OAAO,gBAAgB,KAAG,gBAAgB,EAuB7E,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { labelBefore, swapsNeighbours, withoutUrls } from "./phone-numbers.js";
2
+ import { charactersOf, LABEL_TO_NUMBER, REFERENCE_SHAPE } from "./reference-numbers.js";
3
+ import { isCodeWith } from "./unlabelled-references.js";
4
+ /** Digits enough for a model's code (FT-38); the two letters a short code must hold keep out form names (A-12, B-21). */
5
+ export const MIN_SUBJECT_DIGITS = 2;
6
+ const MIN_SUBJECT_LETTERS = 2;
7
+ const LETTER = /[A-Z]/gu;
8
+ const FIRST_PART = /^[^-‐−-]*/u;
9
+ const TITLE_GROUP = "title";
10
+ /** A short code: two letters or more before its hyphen, and two digits or more (FT-38, KR-M230; not A-12B). */
11
+ export const isSubjectCode = (written) => isCodeWith(MIN_SUBJECT_DIGITS)(written) && (charactersOf(FIRST_PART.exec(written)?.[0] ?? "").match(LETTER)?.length ?? 0) >= MIN_SUBJECT_LETTERS;
12
+ const lineAround = (text, offset) => {
13
+ const start = text.lastIndexOf("\n", offset - 1) + 1;
14
+ const end = text.indexOf("\n", offset);
15
+ return { start, end: end === -1 ? text.length : end };
16
+ };
17
+ /** Whether a code's line holds a label of the given labels, the separators and the code, and nothing else (型番:NH-805). */
18
+ const isFieldLine = (text, offset, written, between, labels) => {
19
+ const line = lineAround(text, offset);
20
+ const head = text
21
+ .slice(line.start, offset - between.length)
22
+ .trim()
23
+ .toLowerCase();
24
+ const rest = text.slice(offset + written.length, line.end).trim();
25
+ return rest === "" && labels.some((label) => label.pattern.toLowerCase() === head);
26
+ };
27
+ const shortCodes = (text) => [...text.matchAll(REFERENCE_SHAPE)].filter((match) => isSubjectCode(match[0]));
28
+ /** Every short code of the title, each an anchor. */
29
+ const titleWritings = (title) => title === undefined
30
+ ? []
31
+ : shortCodes(title.text).map((match) => ({
32
+ offset: title.start + match.index,
33
+ written: match[0],
34
+ characters: charactersOf(match[0]),
35
+ label: TITLE_GROUP,
36
+ anchor: true,
37
+ group: undefined,
38
+ }));
39
+ /** Every short code of the prose, as an anchor when a field line of a listed kind labels it. */
40
+ const proseWritings = (text, input) => shortCodes(text).map((match) => {
41
+ const written = match[0];
42
+ const offset = match.index;
43
+ const label = labelBefore(text, offset, input.labels);
44
+ const group = label !== undefined && LABEL_TO_NUMBER.test(label.between) ? label.group : undefined;
45
+ const onField = group !== undefined && input.listed.has(group) && isFieldLine(text, offset, written, label?.between ?? "", input.labels);
46
+ return { offset, written, characters: charactersOf(written), label: group ?? TITLE_GROUP, anchor: onField, group };
47
+ });
48
+ /** The title's codes and the prose's, one writing per place. */
49
+ const writingsOf = (text, input) => {
50
+ const inTitle = titleWritings(input.title);
51
+ return [...inTitle, ...proseWritings(text, input).filter((writing) => !inTitle.some((title) => title.offset === writing.offset))];
52
+ };
53
+ /** The writings of the document's one code with two neighbours swapped, each written once, of a listed kind or unlabelled, on a line that does not name the code itself. */
54
+ export const subjectCodeVariants = (input) => {
55
+ const text = withoutUrls(input.prose);
56
+ const writings = writingsOf(text, input);
57
+ const anchors = [
58
+ ...writings.filter((writing) => writing.anchor),
59
+ ...input.tabled.filter((code) => input.listed.has(code.label) && isSubjectCode(code.written)),
60
+ ];
61
+ const subject = anchors[0];
62
+ if (subject === undefined || anchors.some((anchor) => anchor.characters !== subject.characters))
63
+ return [];
64
+ const timesWritten = (characters) => writings.filter((writing) => writing.characters === characters).length;
65
+ return writings.flatMap((writing) => {
66
+ const line = lineAround(text, writing.offset);
67
+ const slip = !writing.anchor &&
68
+ (writing.group === undefined || input.listed.has(writing.group)) &&
69
+ !input.known.has(writing.characters) &&
70
+ timesWritten(writing.characters) === 1 &&
71
+ swapsNeighbours(subject.characters, writing.characters) &&
72
+ !writings.some((other) => other.characters === subject.characters && other.offset >= line.start && other.offset < line.end);
73
+ if (!slip)
74
+ return [];
75
+ const { offset, written, characters } = writing;
76
+ return [{ number: { offset, written, characters, label: subject.label }, other: subject }];
77
+ });
78
+ };
79
+ //# sourceMappingURL=subject-codes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subject-codes.js","sourceRoot":"","sources":["../src/subject-codes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAA+C,MAAM,wBAAwB,CAAC;AACrI,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,yHAAyH;AACzH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,+GAA+G;AAC/G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,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAC9H,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QACrB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAChD,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,16 +1,20 @@
1
1
  import type { LexiconEntry } from "./plugin.ts";
2
2
  import { type ReferenceNumber, type ReferenceVariant } from "./reference-numbers.ts";
3
+ type CodeShape = (written: string) => boolean;
4
+ /** A code: letters, a hyphen and the given digits or more (GP-0512). A plain number (48215, 2026-118) is never one. */
5
+ export declare const isCodeWith: (minDigits: number) => (written: string) => boolean;
3
6
  /**
4
7
  * The codes a table labels: in a row whose first cell is a label (| 品番 | GP-0512 |), and in a column whose heading is
5
8
  * one (| 品番 | 品名 | over | GP-0512 | …). Pass the text with its tables (proseAndTablesOf).
6
9
  */
7
- export declare const tableLabelledCodes: (text: string, labels: readonly LexiconEntry[]) => ReferenceNumber[];
10
+ export declare const tableLabelledCodes: (text: string, labels: readonly LexiconEntry[], isCodeShape?: CodeShape) => ReferenceNumber[];
8
11
  /** Every code written anywhere in a table, its heading row too, labelled or not: a code a table lists is an item of its own, never a slip. */
9
- export declare const tableCodes: (text: string) => Set<string>;
12
+ export declare const tableCodes: (text: string, isCodeShape?: CodeShape) => Set<string>;
10
13
  /**
11
14
  * Every code of the prose written with no label that is one labelled code with two neighbours swapped. Only when exactly
12
15
  * one labelled code swaps to it, and when the writing is not itself a code the document labels or lists in a table: a
13
16
  * catalog's AB-1234 and AB-1243 are two items.
14
17
  */
15
18
  export declare const unlabelledVariants: (prose: string, labelled: readonly ReferenceNumber[], known: ReadonlySet<string>) => ReferenceVariant[];
19
+ export {};
16
20
  //# sourceMappingURL=unlabelled-references.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unlabelled-references.d.ts","sourceRoot":"","sources":["../src/unlabelled-references.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,OAAO,EAA6D,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AA+BhJ;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,QAAQ,SAAS,YAAY,EAAE,KAAG,eAAe,EAa9F,CAAC;AAML,8IAA8I;AAC9I,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,GAAG,CAAC,MAAM,CACoF,CAAC;AAEzI;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,EAAE,UAAU,SAAS,eAAe,EAAE,EAAE,OAAO,WAAW,CAAC,MAAM,CAAC,KAAG,gBAAgB,EAYpI,CAAC"}
1
+ {"version":3,"file":"unlabelled-references.d.ts","sourceRoot":"","sources":["../src/unlabelled-references.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,OAAO,EAA6D,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAIhJ,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAI9C,uHAAuH;AACvH,eAAO,MAAM,UAAU,GACpB,WAAW,MAAM,MACjB,SAAS,MAAM,KAAG,OAKlB,CAAC;AAqBJ;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,QAAQ,SAAS,YAAY,EAAE,EAAE,cAAa,SAAkB,KAAG,eAAe,EAa/H,CAAC;AAML,8IAA8I;AAC9I,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,cAAa,SAAkB,KAAG,GAAG,CAAC,MAAM,CAGlF,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,EAAE,UAAU,SAAS,eAAe,EAAE,EAAE,OAAO,WAAW,CAAC,MAAM,CAAC,KAAG,gBAAgB,EAYpI,CAAC"}
@@ -6,11 +6,12 @@ import { charactersOf, MAX_CHARACTERS, MIN_DIGITS, REFERENCE_SHAPE } from "./ref
6
6
  const SEPARATOR = /[-‐−-]/u;
7
7
  const LATIN_LETTER = /[A-Z]/u;
8
8
  const DIGIT = /\d/gu;
9
- /** A code: letters, a hyphen and four digits or more (GP-0512). A plain number (48215, 2026-118) is never one. */
10
- const isCode = (written) => {
9
+ /** A code: letters, a hyphen and the given digits or more (GP-0512). A plain number (48215, 2026-118) is never one. */
10
+ export const isCodeWith = (minDigits) => (written) => {
11
11
  const characters = charactersOf(written);
12
- return (SEPARATOR.test(written) && LATIN_LETTER.test(characters) && (characters.match(DIGIT)?.length ?? 0) >= MIN_DIGITS && characters.length <= MAX_CHARACTERS);
12
+ return (SEPARATOR.test(written) && LATIN_LETTER.test(characters) && (characters.match(DIGIT)?.length ?? 0) >= minDigits && characters.length <= MAX_CHARACTERS);
13
13
  };
14
+ const isCode = isCodeWith(MIN_DIGITS);
14
15
  const keyOf = (text) => withoutEdgeMarks(text).normalize("NFKC").toLowerCase();
15
16
  /** The group of a cell that is a label and nothing else (| 品番 |, | Item code |). */
16
17
  const labelOfCell = (cell, labels) => {
@@ -20,11 +21,11 @@ const labelOfCell = (cell, labels) => {
20
21
  return entry === undefined ? undefined : (entry.group ?? entry.pattern);
21
22
  };
22
23
  /** A cell holding one code and nothing else, as a reference number of the group. */
23
- const codeOfCell = (cell, group) => {
24
+ const codeOfCell = (cell, group, isCodeShape) => {
24
25
  if (cell === undefined)
25
26
  return [];
26
27
  const written = withoutEdgeMarks(cell.text);
27
- if (!isCode(written) || [...written.matchAll(REFERENCE_SHAPE)].length !== 1)
28
+ if (!isCodeShape(written) || [...written.matchAll(REFERENCE_SHAPE)].length !== 1)
28
29
  return [];
29
30
  return [{ offset: cell.start + cell.text.indexOf(written), written, characters: charactersOf(written), label: group }];
30
31
  };
@@ -32,23 +33,23 @@ const codeOfCell = (cell, group) => {
32
33
  * The codes a table labels: in a row whose first cell is a label (| 品番 | GP-0512 |), and in a column whose heading is
33
34
  * one (| 品番 | 品名 | over | GP-0512 | …). Pass the text with its tables (proseAndTablesOf).
34
35
  */
35
- export const tableLabelledCodes = (text, labels) => tablesOf(linesOf(text)).flatMap((table) => {
36
+ export const tableLabelledCodes = (text, labels, isCodeShape = isCode) => tablesOf(linesOf(text)).flatMap((table) => {
36
37
  const headings = cellsOf(table.header).map((cell) => labelOfCell(cell, labels));
37
38
  return table.rows.flatMap((row) => {
38
39
  const cells = cellsOf(row);
39
40
  const rowGroup = labelOfCell(cells[0], labels);
40
- const byRow = rowGroup === undefined ? [] : codeOfCell(cells[1], rowGroup);
41
+ const byRow = rowGroup === undefined ? [] : codeOfCell(cells[1], rowGroup, isCodeShape);
41
42
  const byColumn = cells.flatMap((cell, index) => {
42
43
  const group = headings[index];
43
- return group === undefined ? [] : codeOfCell(cell, group);
44
+ return group === undefined ? [] : codeOfCell(cell, group, isCodeShape);
44
45
  });
45
46
  return [...byRow, ...byColumn];
46
47
  });
47
48
  });
48
49
  /** The letters and digits of every code a cell holds. */
49
- const codesInCell = (cell) => [...cell.text.matchAll(REFERENCE_SHAPE)].filter((match) => isCode(match[0])).map((match) => charactersOf(match[0]));
50
+ const codesInCell = (cell, isCodeShape) => [...cell.text.matchAll(REFERENCE_SHAPE)].filter((match) => isCodeShape(match[0])).map((match) => charactersOf(match[0]));
50
51
  /** Every code written anywhere in a table, its heading row too, labelled or not: a code a table lists is an item of its own, never a slip. */
51
- export const tableCodes = (text) => new Set(tablesOf(linesOf(text)).flatMap((table) => [table.header, ...table.rows].flatMap((row) => cellsOf(row).flatMap(codesInCell))));
52
+ export const tableCodes = (text, isCodeShape = isCode) => new Set(tablesOf(linesOf(text)).flatMap((table) => [table.header, ...table.rows].flatMap((row) => cellsOf(row).flatMap((cell) => codesInCell(cell, isCodeShape)))));
52
53
  /**
53
54
  * Every code of the prose written with no label that is one labelled code with two neighbours swapped. Only when exactly
54
55
  * one labelled code swaps to it, and when the writing is not itself a code the document labels or lists in a table: a
@@ -1 +1 @@
1
- {"version":3,"file":"unlabelled-references.js","sourceRoot":"","sources":["../src/unlabelled-references.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAa,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAA+C,MAAM,wBAAwB,CAAC;AAEhJ,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,MAAM,KAAK,GAAG,MAAM,CAAC;AAErB,kHAAkH;AAClH,MAAM,MAAM,GAAG,CAAC,OAAe,EAAW,EAAE;IAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACzC,OAAO,CACL,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,IAAI,cAAc,CACxJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,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,CAAC"}
package/genres.yaml CHANGED
@@ -212,6 +212,14 @@ genres:
212
212
  - Do the figures for the problem, the proposal and the benefit have a basis, and agree between the text and the tables?
213
213
  - Are the risks stated, each with what is done about it?
214
214
  - Does it say what decision is asked of the reader, and by when?
215
+ # A quote or a price list asks the reader to decide: its number, its date and how long the price holds, as labelled lines.
216
+ suggest:
217
+ ja:
218
+ line: "^(?:[-*]\\s+|\\|\\s*)?(?:\\*\\*)?(?:見積(?:書)?(?:番号|日|金額|有効期限)|お見積(?:り)?(?:番号|日|金額)|有効期限|有効期間|適用(?:開始|終了)日|価格表番号)(?:\\*\\*)?\\s*(?:[((][^))]*[))]\\s*)?[::|]|^#{1,6}\\s*(?:御?見積書|お見積(?:り)?書?|価格表)"
219
+ min_lines: 2
220
+ en:
221
+ line: "^(?:[-*]\\s+|\\|\\s*)?(?:\\*\\*)?(?:Quot(?:e|ation) (?:[Nn]umber|[Nn]o\\.|#|[Dd]ate)|Estimate (?:[Nn]umber|[Nn]o\\.|#|[Dd]ate)|Date of estimate|Quoted [Aa]mount|Valid (?:[Uu]ntil|[Ff]rom|[Tt]hrough)|Price [Ll]ist (?:[Nn]umber|[Nn]o\\.))(?:\\*\\*)?\\s*(?:\\([^)]*\\)\\s*)?[:|]|^#{1,6}\\s*(?:Quot(?:e|ation)|Estimate|Price list)\\b"
222
+ min_lines: 2
215
223
  - id: business/report
216
224
  name: { ja: 報告書, en: Report }
217
225
  summary:
@@ -228,6 +236,15 @@ genres:
228
236
  - Do the numbers have a source and a date, and do totals and percentages add up?
229
237
  - Are facts kept apart from opinions and guesses?
230
238
  - Are the next actions given with an owner and a deadline?
239
+ # Paperwork that reports figures (a payslip, a bill, a statement, a receipt): the labels of its amounts, balances, periods
240
+ # and reference numbers, as labelled lines or table rows. A word in a sentence is not a label.
241
+ suggest:
242
+ ja:
243
+ line: "^(?:[-*]\\s+|\\|\\s*)?(?:\\*\\*)?(?:総支給額|差引支給額|控除(?:額)?合計|支給日|支給対象期間|勤怠集計期間|(?:社員|従業員)番号|課税対象額|口座(?:名義|番号)|お取引期間|お預入れ合計|お引出し合計|(?:前月末|前回|今回|期首|期末|繰越)の?残高|お借入金額|毎月のお支払額|初回お支払日|分割手数料|お支払い?(?:期限|期日|金額|総額)|ご?請求(?:日|番号|金額|額)|検針期間|料金算定期間|お客さま番号|患者番号|入院日|退院日|診療日|発注(?:日|番号)|納品書番号|インボイス番号|到着予定日|契約番号|入居日|解約通知日|決済日|取引番号|学籍番号|納入額|提出日|出張期間|会員番号|予約番号|無料キャンセル期限|登録番号|注文番号|証券番号|会計年度|会計|前年度繰越金|売上高|営業利益|経常利益|(?:当期|四半期)純利益|保険期間|待機期間|契約年齢|整備日|記録番号|次回点検日|申請者|承認者|対象期間|精算(?:額|日)|退去日|月額賃料|差引合計|ご契約者名|ご利用(?:開始|終了)日|代表電話番号|売主|買主|売買(?:契約日|代金)|残代金|手付金|輸出者|荷受人|船積(?:港|日)|仕向港|受託者|作業期間|報告日|納品(?:日|場所)|納入期限|学生氏名|発行日|交付日)(?:\\*\\*)?\\s*(?:[((][^))]*[))]\\s*)?[::|]"
244
+ min_lines: 3
245
+ en:
246
+ line: "^(?:[-*]\\s+|\\|\\s*)?(?:\\*\\*)?(?:Gross [Pp]ay|Net [Pp]ay|Total [Dd]eductions|Pay [Pp]eriod|Pay [Dd]ate|Timesheet [Pp]eriod|Taxable [Ii]ncome|Employee(?: (?:ID|[Nn]umber))?|Account (?:[Hh]older|[Nn]umber)|Statement (?:[Pp]eriod|[Dd]ate)|(?:Opening|Closing) [Bb]alance|Balance (?:[Bb]rought|[Cc]arried) [Ff]orward|Balance [Dd]ue[^:|]{0,40}|Total (?:[Dd]eposits|[Ww]ithdrawals|[Cc]harges|[Ii]ncome|[Ee]xpenditure|[Dd]ue|[Oo]f [Pp]ayments|[Ff]or the year)|Amount (?:[Dd]ue|[Ff]inanced|[Pp]aid|[Bb]illed)(?: for [^:|]{1,30})?|Finance [Cc]harge|Monthly [Pp]ayment|Number of [Pp]ayments|First [Pp]ayment [Dd]ate|Payment [Dd]ue(?: by)?|Due [Dd]ate|Billing (?:[Pp]eriod|[Dd]ate)|Bill [Tt]o|Pay [Tt]o|Patient (?:[Nn]umber|[Ss]hare)|Invoice (?:[Nn]o\\.|#|[Nn]umber|[Dd]ate)|PO (?:[Nn]umber|#)|Order (?:[Nn]umber|#|[Dd]ate)|Delivery (?:[Dd]ate|[Nn]ote [Nn]umber)|Receipt (?:[Nn]umber|[Nn]o\\.|#)|(?:Reservation|Booking|Registration|Confirmation) (?:[Nn]umber|#)|Free [Cc]ancellation [Uu]ntil|Member [Nn]umber|Points (?:[Ee]arned|[Uu]sed)[^:|]{0,30}|Policy [Nn]umber|Date of (?:claim|incident|admission|discharge|visit)|Settlement [Dd]ate|(?:Purchase|Sale) [Pp]rice|Tenancy [Aa]greement [Nn]umber|Deposit [Hh]eld|Student ID|Record [Nn]umber|Service [Dd]ate|Next [Ii]nspection [Dd]ue|Reporting [Pp]eriod|Report [Dd]ate|Port of (?:[Ll]oading|[Dd]ischarge)|Exporter|Consignee|Financial [Yy]ear|Submitted|Approver|Per [Dd]iem|Contractor|Contract (?:[Nn]umber|[Dd]ate)|Buyer|Seller|Property [Aa]ddress|Loan [Pp]roceeds|Net [Ss]ales|Operating [Pp]rofit|Profit [Bb]efore [Tt]ax|Net [Pp]rofit|Period of [Cc]over|Waiting [Pp]eriod|Age at [Ee]ntry|Issued|Date [Ii]ssued|Issue [Dd]ate)(?:\\*\\*)?\\s*(?:\\([^)]*\\)\\s*)?[:|]"
247
+ min_lines: 3
231
248
  - id: business/email
232
249
  name: { ja: メール・手紙, en: Email and letter }
233
250
  summary:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaffjs",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "Prose validation harness. Finds what is hard to read, and never rewrites it for you.",
5
5
  "keywords": [
6
6
  "chaff",
@@ -88,8 +88,8 @@
88
88
  },
89
89
  "dependencies": {
90
90
  "@anthropic-ai/sdk": "^0.125.0",
91
- "@chaffjs/lang-en": "0.30.0",
92
- "@chaffjs/lang-ja": "0.32.0",
91
+ "@chaffjs/lang-en": "0.32.0",
92
+ "@chaffjs/lang-ja": "0.34.0",
93
93
  "character-entities": "^2.0.2",
94
94
  "mdast-util-from-markdown": "^2.0.3",
95
95
  "mdast-util-frontmatter": "^2.0.1",
@@ -9,7 +9,7 @@ why:
9
9
  en: Japanese property advertising computes walking times at 80 m of road per minute, a part minute rounded up (the real-estate fair-competition code). In a Japanese listing, walking times are compared with their distances at that rate even when it is not written. There is no such standard for English listings, so this profile has no English part.
10
10
 
11
11
  # 設定(chaff.yaml の profile / by_path)が無いときに、内容から選ぶ。物件概要の項目(交通、賃料、敷金、間取り…)の行が
12
- # min_lines 行以上あれば物件広告として読む。表の行(| 賃料 | …)も、「賃料:…」の行も数える。
12
+ # min_lines 行以上あれば物件広告として読む。表の行(| 賃料 | …)も、「賃料:…」の行も、箇条の行(- 賃料:…)も数える。
13
13
  detect:
14
14
  ja:
15
15
  line: "^[ \\t]*\\|?[ \\t]*(?:交通|賃料|家賃|管理費|共益費|敷金|礼金|保証金|間取り|専有面積|入居可能日|築年月)[ \\t]*[||::]"
@@ -41,8 +41,8 @@ example:
41
41
  Do not delete the log. Do not delete this file before the audit.
42
42
 
43
43
  not_flagged:
44
- ja: 三語以上の連なりだけを見ます。略語の並び(文書のほかの所で小文字で書かれない語)とコードは見ません。仕様書の MUST や SHALL は慣習の大文字として数えません。法令と文学の文書では既定で止めています(大文字で目立たせる決まりや、題を大文字で組む慣習があるため)。
45
- en: Only runs of three or more words. Runs of acronyms (words never written in lower case elsewhere) and code are not reported, and MUST or SHALL in a specification count as conventional capitals. The legal and literature presets turn it off, since contracts set disclaimers in capitals by rule and older texts set titles that way.
44
+ ja: 三語以上の連なりだけを見ます。略語の並び(文書のほかの所で小文字で書かれない語)とコードは見ません。仕様書の MUST や SHALL は慣習の大文字として数えません。段落の頭に置いた大文字の見出し語(「AGENCY:」「WORKING GROUP MEMBERS」のように、コロンで終わるか一行で段落になるもの)と、本文でその見出し語を挙げた所も見ません。法令と文学の文書では既定で止めています(大文字で目立たせる決まりや、題を大文字で組む慣習があるため)。
45
+ en: Only runs of three or more words. Runs of acronyms (words never written in lower case elsewhere) and code are not reported, and MUST or SHALL in a specification count as conventional capitals. A caption in capitals that opens a paragraph and ends in a colon or stands alone ("AGENCY:", "WORKING GROUP MEMBERS"), and prose naming such a caption, are not reported either. The legal and literature presets turn it off, since contracts set disclaimers in capitals by rule and older texts set titles that way.
46
46
  level_meaning:
47
47
  ja: "{limit} 箇所あれば指摘"
48
48
  en: reported once there are {limit}
@@ -12,9 +12,9 @@ name:
12
12
  en: A closing balance that is not the opening balance plus deposits less withdrawals
13
13
 
14
14
  why:
15
- ja: 預金の取引明細のまとめでは、当月末残高は、前月末残高にお預入れ合計を足し、お引出し合計を引いた額です。読む人は残高を見て、足し引きし直しません。取引を直したのに残高を直さなかったとき、前の月の明細から写したとき、数字を打ち間違えたときに食い違います。同じ表か同じ節に、初めの残高(前月末残高)、入金の合計(お預入れ合計)、出金の合計(お引出し合計)、終わりの残高(当月末残高)の名前が一つずつあり、それぞれに金額があれば、終わりの残高を足し引きと比べます。表では、見出しの行に四つの名前が並ぶ表は行ごとに、一列目に四つの名前が並ぶ表は列ごとに比べます。表の外では、節(見出しから次の見出しまで)の「前月末残高:412,350円」のような名前と金額だけの行を読みます。どの語が四つのどれかは、言語パッケージの語彙表 closing-balance-label にあります。通貨の印が付いた金額は一円(一セント)まで合わなければ言います。千円の単位の金額や印の無い数は丸めてあるかもしれないので、最後の桁の二つ分までのずれは言いません。
15
+ ja: 預金の取引明細のまとめでは、当月末残高は、前月末残高にお預入れ合計を足し、お引出し合計を引いた額です。読む人は残高を見て、足し引きし直しません。取引を直したのに残高を直さなかったとき、前の月の明細から写したとき、数字を打ち間違えたときに食い違います。同じ表か同じ節に、初めの残高(前月末残高)、入金の合計(お預入れ合計)、出金の合計(お引出し合計)、終わりの残高(当月末残高)の名前が一つずつあり、それぞれに金額があれば、終わりの残高を足し引きと比べます。表では、見出しの行に四つの名前が並ぶ表は行ごとに、一列目に四つの名前が並ぶ表は列ごとに比べます。表の外では、節(見出しから次の見出しまで)の「前月末残高:412,350円」のような名前と金額だけの行を読みます。どの語が四つのどれかは、言語パッケージの語彙表 closing-balance-label にあります。通貨の印が付いた金額は一円(一セント)まで合わなければ言います。千円の単位の金額や印の無い数は丸めてあるかもしれないので、最後の桁の二つ分までのずれは言いません。名前の後ろの日付の括弧(2026年6月30日時点)は単位として扱わず、単位の無い数は、列の見出しが単位の語(ポイント)ならその単位で読みます。
16
16
  en: >-
17
- On a statement summary the closing balance is the opening balance plus the total deposits less the total withdrawals. The reader takes the closing balance as given and does not add it up again. It goes wrong when a transaction is corrected and the balance is not, when the balance is copied from last month's statement, or when a digit is mistyped. When one table or one section names the balance at the start (Opening balance), the total paid in (Total deposits), the total paid out (Total withdrawals) and the balance at the end (Closing balance) once each, each with an amount, the closing balance is compared with the sum. A table whose header row has the four names is compared row by row, and one whose first column has them column by column. Outside tables, the lines of a section (from one heading to the next) that are only a name and an amount ("Opening balance: $2,418.36") are read. Which words name the four is in the language package's lexicon closing-balance-label. Amounts with a currency mark must agree to the cent. Amounts in thousands, and numbers without a mark, may be rounded, so a difference of up to two steps of their last digit is not reported.
17
+ On a statement summary the closing balance is the opening balance plus the total deposits less the total withdrawals. The reader takes the closing balance as given and does not add it up again. It goes wrong when a transaction is corrected and the balance is not, when the balance is copied from last month's statement, or when a digit is mistyped. When one table or one section names the balance at the start (Opening balance), the total paid in (Total deposits), the total paid out (Total withdrawals) and the balance at the end (Closing balance) once each, each with an amount, the closing balance is compared with the sum. A table whose header row has the four names is compared row by row, and one whose first column has them column by column. Outside tables, the lines of a section (from one heading to the next) that are only a name and an amount ("Opening balance: $2,418.36") are read. Which words name the four is in the language package's lexicon closing-balance-label. Amounts with a currency mark must agree to the cent. Amounts in thousands, and numbers without a mark, may be rounded, so a difference of up to two steps of their last digit is not reported. A dated note after a name (as of June 30, 2026) is not a unit, and a bare number under a column heading that is a unit word (Points) is read in that unit.
18
18
 
19
19
  message:
20
20
  ja: 「{written}」は、初めの残高に入金を足し出金を引くと {expected} です
@@ -60,4 +60,4 @@ example:
60
60
 
61
61
  not_flagged:
62
62
  ja: 四つの名前のどれかが無い表や節、同じ名前が二度ある表の列や節、名前が別々の表や節にあるもの、四つの単位が違うもの(円とドル、千円と円)、数でない金額(—、▲、マイナスや括弧の付いた値)は比べません。日付・お預入れ・お引出し・残高の列が並ぶ取引の表は、行ごとの残高を running-balance-mismatch が見るので、ここでは読みません。文の中の金額(「当月末残高は452,220円です」)や、語彙表に無い名前(前回ご請求額、ご利用残高)は読みません。足し引きがマイナスになるときも言いません。
63
- en: 'A table or section without one of the four names, a table column or section that names one of them twice, names spread over separate tables or sections, amounts in different units (yen and dollars, thousands and units), and a value that is not a plain number (—, a negative or bracketed value) are not compared. A transaction table with Date, Deposit, Withdrawal and Balance columns is left to running-balance-mismatch, which checks it row by row. An amount inside a sentence ("The closing balance is $2,156.56") is not read, nor is a name not in the lexicon (Previous balance, New balance, Credits and Debits, which on a card statement move the other way). A sum below zero is not reported either.'
63
+ en: 'A table or section without one of the four names, a table column or section that names one of them twice, names spread over separate tables or sections, amounts in different units (yen and dollars, thousands and units), and a value that is not a plain number (—, a negative or bracketed value) are not compared. A transaction table with Date, Deposit, Withdrawal and Balance columns is left to running-balance-mismatch, which checks it row by row. An amount inside a sentence ("The closing balance is $2,156.56") is not read, nor is a name not in the lexicon (Credits and Debits, which on a card statement move the other way). A sum below zero is not reported either.'
@@ -67,8 +67,8 @@ example:
67
67
  Replies to help desk tickets now take 1 day on average, down from 3. Customer satisfaction rose from 72% to 85%. Overtime fell by 10 hours a month.
68
68
 
69
69
  not_flagged:
70
- ja: 3 文より短い節、索引のように項目を並べた節は見ません。
71
- en: Sections shorter than three sentences, and index-like sections of entries, are not checked.
70
+ ja: 3 文より短い節、索引のように項目を並べた節、文の半分以上が問いか指示(〜してください)の節は見ません。
71
+ en: Sections shorter than three sentences, index-like sections of entries, and sections where at least half the sentences are questions or instructions are not checked.
72
72
  level_meaning:
73
73
  ja: 具体物のない節が {limit} 個あれば指摘
74
74
  en: reported once {limit} sections have nothing concrete
@@ -15,14 +15,14 @@ why:
15
15
  en: Whether to use contractions is a choice of register, and neither is wrong. Mixed within one document, the reader re-measures the distance sentence by sentence.
16
16
 
17
17
  message:
18
- ja: 「{matched}」だけ他と書きかたが違います(そういう書きかたが {count} 種)
19
- en: '"{matched}" is written differently from the rest of the document'
18
+ ja: 「{matched}」は、この文書のほかの所では「{majority}」と書かれています
19
+ en: '"{matched}" is written "{majority}" elsewhere in the document'
20
20
 
21
21
  how_to_fix:
22
- ja: 多いほうに揃えてください。
23
- en: Match the majority.
22
+ ja: 同じ語は、多いほうの書きかたに揃えてください。
23
+ en: Write the same word the way the document mostly writes it.
24
24
 
25
- # 少数派が何種までなら「混在」と見るか。これを超えたら混在ではなく、そういう文体。
25
+ # 1 つの対で、少ないほうの書きかたが何回までなら「混在」と見るか。これを超えたら混在ではなく、書き分け。
26
26
  levels: { strict: 4, normal: 2, relaxed: 1 }
27
27
 
28
28
  use_for: [blog, business, technical, legal, docs, academic, literature, speech]
@@ -32,18 +32,18 @@ off_for:
32
32
 
33
33
  group: consistency
34
34
  summary:
35
- ja: 英語で、「don't」と「do not」のように短縮形を使う書き方と使わない書き方が混ざっている所
36
- en: Contractions ("don't") and full forms ("do not") mixed in one document
35
+ ja: 英語で、同じ語を「don't」と「do not」のように両方の形で書いている所
36
+ en: The same word written both contracted ("don't") and in full ("do not")
37
37
  example:
38
38
  en:
39
39
  before: |
40
- We don't store your password. We can't read your messages. We won't share your data. We do not sell your address.
40
+ We don't store your password. We don't read your messages. We don't share your data. We do not sell your address.
41
41
  after: |
42
- We don't store your password. We can't read your messages. We won't share your data. We don't sell your address.
42
+ We don't store your password. We don't read your messages. We don't share your data. We don't sell your address.
43
43
 
44
44
  not_flagged:
45
- ja: 短縮形を使うかどうかは決めません。文書の中で少ないほうだけを指します。
46
- en: Whether to use contractions is not decided; only the minority form in the document is pointed at.
45
+ ja: 短縮形を使うかどうかは決めません。比べるのは同じ語の 2 つの形(「you're」と「you are」)だけで、別の語どうしは比べません。「you're」と書き、否定は「do not」と書く文書は揃っています。同じ語の 2 つの形が同じ回数なら、少ないほうが無いので指しません。
46
+ en: Whether to use contractions is not decided. Only the two forms of the same word are compared ("you're" with "you are"), never different words, so a document that writes "you're" but keeps "do not" in full is consistent. When both forms of a word appear as often, there is no minority and nothing is pointed at.
47
47
  level_meaning:
48
- ja: 少ないほうの書き方が {limit} 箇所以下のとき指摘
49
- en: reported when the minority form appears {limit} times or fewer
48
+ ja: 同じ語の少ないほうの書き方が {limit} 箇所以下のとき指摘
49
+ en: reported when the minority form of a word appears {limit} times or fewer
@@ -78,5 +78,5 @@ example:
78
78
  Holidays follow the rota that the company publishes each month.
79
79
 
80
80
  not_flagged:
81
- ja: 「法第2条」のように、ほかの文書の条を指す参照は探しません。条で番号を振っていない文書では、条で数える参照を見ません。
82
- en: References into another document ("Article 2 of the Act") are not looked up. A document that numbers none of its provisions as articles is not checked for article references.
81
+ ja: 「法第2条」「就業規則 第25条」のように、ほかの文書の条を指す参照は探しません。ほかの文書の名前を見出しにして引き写した条の中の参照も、その文書の条です。条の下に「1. 」「2.」の箇条書きで書いた項は、項として引きます。条で番号を振っていない文書では、条で数える参照を見ません。平文の契約が「9. Indemnification.」と本文の形で書いた見出しや、本文の中に書いた「(i)」も、参照の行き先として引きます。「section 21 notice」のように番号を手続きの名前にした書き方は、ほかの法律の番号として探しません。
82
+ en: References into another document ("Article 2 of the Act") are not looked up, nor are references inside a section whose heading is the name of a document cited elsewhere in the text, which quotes that document. A paragraph written as a list ("1. ", "2. ") under an article counts as that article's paragraph. A document that numbers none of its provisions as articles is not checked for article references. A plain-text contract's headings written as text ("9. Indemnification.", "Section 2.3 Appraisal Shares.") and the labels written inside a section's text ("(i)") count as addresses. A section number used as a name ("a section 21 notice") points into another Act and is not looked up.
@@ -64,8 +64,8 @@ example:
64
64
  - October 28, 2026: results sent
65
65
 
66
66
  not_flagged:
67
- ja: 年のある日付がみな同じ年の文書では、年の無い日付を指しません(どの年か読み手に分かるため)。年を一度だけ書いて、あとの日付は月と日だけで書く文書(年の無い日付のほうが多い文書)も、書き方の選び方として指しません。ただしどちらの場合も、年をまたぐ日付は指します。どの年のものでもない日付も指しません。毎年の日(毎年4月1日、年末年始閉庁日(12月29日~1月3日)、4月1日から翌年3月31日まで)と、例の日付(例えば…4月1日に届いた場合、例:のあとの日付)です。年のある日付が一つも無い文書、月だけ・年だけの日付は見ません。
68
- en: A document whose dated dates are all in one year is not reported, since the reader can tell the year. A document that writes the year once and the rest as month and day (more yearless dates than dated ones) is a style, and not reported either. In both, a date across the turn of a year is still reported. Nor is a date of no one year, such as a day that comes round every year ("every year on April 1", "each December 31", "April 1 to March 31 of the following year") and a date in a worked example ("for example, a request received on April 1", the dates after "e.g."). A document with no dated date, and month-only and year-only dates, are not checked.
67
+ ja: 年のある日付がみな同じ年の文書では、年の無い日付を指しません(どの年か読み手に分かるため)。年を一度だけ書いて、あとの日付は月と日だけで書く文書(年の無い日付のほうが多い文書)も、書き方の選び方として指しません。ただしどちらの場合も、年をまたぐ日付は指します。見出しが年を名指す節(「2026年度の予定」「令和8年の行事」「FY27」)の日付は、見出しから年が決まるので指しません。どの年のものでもない日付も指しません。毎年の日(毎年4月1日、決算日は12月31日、年末年始閉庁日(12月29日~1月3日)、4月1日から翌年3月31日まで、1月1日から12月31日までのような一年の期間)と、例の日付(例えば…4月1日に届いた場合、例:のあとの日付、例の項目に続く「もし…」の項目)です。年のある日付が一つも無い文書、月だけ・年だけの日付は見ません。
68
+ en: A document whose dated dates are all in one year is not reported, since the reader can tell the year. A document that writes the year once and the rest as month and day (more yearless dates than dated ones) is a style, and not reported either. In both, a date across the turn of a year is still reported. A date in a section whose heading names the year ("2026 events", "FY27-Q2") takes its year from the heading and is not reported. Nor is a date of no one year, such as a day that comes round every year ("every year on April 1", "each December 31", "the fiscal year end is March 31", "April 1 to March 31 of the following year", a whole year such as "January 1 to December 31") and a date in a worked example ("for example, a request received on April 1", the dates after "e.g.", a list item opening with "If" just after an example's item). A document with no dated date, and month-only and year-only dates, are not checked.
69
69
  rewrite:
70
70
  depth: light
71
71
  ja:
@@ -65,8 +65,8 @@ example:
65
65
  1. The Customer pays the Supplier within thirty days of each invoice.
66
66
 
67
67
  not_flagged:
68
- ja: 短い呼び名を定める前の使用、呼び名と同じ行にある使用、名前だけの行(署名欄)、四字に満たない名前(「法律」)、一語の英語の名前、呼び名が名前を含むもの(「本サービス」)、前の語が絞り込む名前(「妊娠中の女性従業員」「本利用規約」)、それ自体が定義した語である名前、長い語の一部(「株式会社みなと製作所大阪支店」)は見ません。法務のジャンルで見ます。
69
- en: 'Uses before the short name is defined, uses on a line that also gives the short name, lines holding little more than the name (a signature block), names shorter than four characters, one-word English names, short names that contain the long one, names narrowed by the word before them ("the Beta Preview"), names that are defined terms themselves, and a name inside a longer word are not reported. The legal genres run this rule.'
68
+ ja: 短い呼び名を定める前の使用、呼び名と同じ行にある使用、名前だけの行(署名欄)、四字に満たない名前(「法律」)、一語の英語の名前、小文字だけの英語の語や日付・金額(with respect thereto、January 26, 2015、$1.00)、呼び名が名前を含むもの(「本サービス」)、前の語が絞り込む名前(「妊娠中の女性従業員」「本利用規約」、Customer's Web site)、それ自体が定義した語である名前、長い語の一部(「株式会社みなと製作所大阪支店」)、それぞれや全体を呼ぶ括弧((each, a "Certificate")、(collectively, the "Plans"))は見ません。この括弧は前の節の頭の語を呼び、すぐ前の名前を呼ぶのではないからです。法務のジャンルで見ます。
69
+ en: 'Uses before the short name is defined, uses on a line that also gives the short name, lines holding little more than the name (a signature block), names shorter than four characters, one-word English names, lower-case words, dates and amounts (with respect thereto, January 26, 2015, $1.00), short names that contain the long one, names narrowed by the word before them ("the Beta Preview", "Customer''s Web site"), names that are defined terms themselves, a name inside a longer word, and a bracket that names each or all of several things ((each, a "Certificate"), (collectively, the "Plans")), which names the head of the clause before it rather than its last words, are not reported. The legal genres run this rule.'
70
70
  rewrite:
71
71
  depth: light
72
72
  ja: