chaffjs 0.27.1 → 0.29.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 (923) hide show
  1. package/README.md +2 -1
  2. package/dist/ai-score/of-document.d.ts.map +1 -1
  3. package/dist/ai-score/of-document.js +23 -14
  4. package/dist/ai-score/of-document.js.map +1 -1
  5. package/dist/ai-score/render.d.ts.map +1 -1
  6. package/dist/ai-score/render.js +13 -4
  7. package/dist/ai-score/render.js.map +1 -1
  8. package/dist/ai-score/score.d.ts +16 -1
  9. package/dist/ai-score/score.d.ts.map +1 -1
  10. package/dist/ai-score/score.js +15 -3
  11. package/dist/ai-score/score.js.map +1 -1
  12. package/dist/ai-score/signals.d.ts +2 -4
  13. package/dist/ai-score/signals.d.ts.map +1 -1
  14. package/dist/ai-score/signals.js +11 -2
  15. package/dist/ai-score/signals.js.map +1 -1
  16. package/dist/ai-score/text.d.ts +2 -0
  17. package/dist/ai-score/text.d.ts.map +1 -1
  18. package/dist/ai-score/text.js +4 -2
  19. package/dist/ai-score/text.js.map +1 -1
  20. package/dist/announced-count.d.ts +2 -0
  21. package/dist/announced-count.d.ts.map +1 -1
  22. package/dist/announced-count.js +14 -7
  23. package/dist/announced-count.js.map +1 -1
  24. package/dist/check-source.d.ts +3 -1
  25. package/dist/check-source.d.ts.map +1 -1
  26. package/dist/check-source.js +3 -1
  27. package/dist/check-source.js.map +1 -1
  28. package/dist/cli-text.d.ts.map +1 -1
  29. package/dist/cli-text.js +42 -18
  30. package/dist/cli-text.js.map +1 -1
  31. package/dist/cli.d.ts.map +1 -1
  32. package/dist/cli.js +2 -1
  33. package/dist/cli.js.map +1 -1
  34. package/dist/commands/cite-claims.d.ts +36 -0
  35. package/dist/commands/cite-claims.d.ts.map +1 -0
  36. package/dist/commands/cite-claims.js +81 -0
  37. package/dist/commands/cite-claims.js.map +1 -0
  38. package/dist/commands/cite-page.d.ts +14 -0
  39. package/dist/commands/cite-page.d.ts.map +1 -0
  40. package/dist/commands/cite-page.js +47 -0
  41. package/dist/commands/cite-page.js.map +1 -0
  42. package/dist/commands/cite-scaffold.d.ts +16 -0
  43. package/dist/commands/cite-scaffold.d.ts.map +1 -0
  44. package/dist/commands/cite-scaffold.js +21 -0
  45. package/dist/commands/cite-scaffold.js.map +1 -0
  46. package/dist/commands/cite.d.ts +3 -12
  47. package/dist/commands/cite.d.ts.map +1 -1
  48. package/dist/commands/cite.js +110 -51
  49. package/dist/commands/cite.js.map +1 -1
  50. package/dist/company-names.d.ts +34 -0
  51. package/dist/company-names.d.ts.map +1 -0
  52. package/dist/company-names.js +158 -0
  53. package/dist/company-names.js.map +1 -0
  54. package/dist/default-values.d.ts +17 -0
  55. package/dist/default-values.d.ts.map +1 -0
  56. package/dist/default-values.js +134 -0
  57. package/dist/default-values.js.map +1 -0
  58. package/dist/deprecated-use.d.ts +17 -0
  59. package/dist/deprecated-use.d.ts.map +1 -0
  60. package/dist/deprecated-use.js +95 -0
  61. package/dist/deprecated-use.js.map +1 -0
  62. package/dist/derived/number-word-counts.d.ts +10 -0
  63. package/dist/derived/number-word-counts.d.ts.map +1 -0
  64. package/dist/derived/number-word-counts.js +21 -0
  65. package/dist/derived/number-word-counts.js.map +1 -0
  66. package/dist/derived/stays.d.ts +43 -0
  67. package/dist/derived/stays.d.ts.map +1 -0
  68. package/dist/derived/stays.js +105 -0
  69. package/dist/derived/stays.js.map +1 -0
  70. package/dist/detectors/acronym-context.d.ts +2 -2
  71. package/dist/detectors/acronym-context.d.ts.map +1 -1
  72. package/dist/detectors/acronym-context.js +6 -0
  73. package/dist/detectors/acronym-context.js.map +1 -1
  74. package/dist/detectors/address-word.d.ts +3 -0
  75. package/dist/detectors/address-word.d.ts.map +1 -0
  76. package/dist/detectors/address-word.js +7 -0
  77. package/dist/detectors/address-word.js.map +1 -0
  78. package/dist/detectors/agreement-slip.d.ts.map +1 -1
  79. package/dist/detectors/agreement-slip.js +4 -1
  80. package/dist/detectors/agreement-slip.js.map +1 -1
  81. package/dist/detectors/ai-phrasing.d.ts +0 -4
  82. package/dist/detectors/ai-phrasing.d.ts.map +1 -1
  83. package/dist/detectors/ai-phrasing.js +5 -1
  84. package/dist/detectors/ai-phrasing.js.map +1 -1
  85. package/dist/detectors/amount-range.d.ts +3 -0
  86. package/dist/detectors/amount-range.d.ts.map +1 -0
  87. package/dist/detectors/amount-range.js +38 -0
  88. package/dist/detectors/amount-range.js.map +1 -0
  89. package/dist/detectors/amount-scale.d.ts +8 -0
  90. package/dist/detectors/amount-scale.d.ts.map +1 -0
  91. package/dist/detectors/amount-scale.js +74 -0
  92. package/dist/detectors/amount-scale.js.map +1 -0
  93. package/dist/detectors/announced-count.d.ts +1 -1
  94. package/dist/detectors/announced-count.d.ts.map +1 -1
  95. package/dist/detectors/announced-count.js +18 -3
  96. package/dist/detectors/announced-count.js.map +1 -1
  97. package/dist/detectors/bare-comparative.d.ts.map +1 -1
  98. package/dist/detectors/bare-comparative.js +4 -1
  99. package/dist/detectors/bare-comparative.js.map +1 -1
  100. package/dist/detectors/block-quotation.d.ts +13 -0
  101. package/dist/detectors/block-quotation.d.ts.map +1 -0
  102. package/dist/detectors/block-quotation.js +86 -0
  103. package/dist/detectors/block-quotation.js.map +1 -0
  104. package/dist/detectors/bracket-label.d.ts +10 -0
  105. package/dist/detectors/bracket-label.d.ts.map +1 -0
  106. package/dist/detectors/bracket-label.js +51 -0
  107. package/dist/detectors/bracket-label.js.map +1 -0
  108. package/dist/detectors/change-rate.d.ts.map +1 -1
  109. package/dist/detectors/change-rate.js +12 -1
  110. package/dist/detectors/change-rate.js.map +1 -1
  111. package/dist/detectors/citation-entry.d.ts +5 -0
  112. package/dist/detectors/citation-entry.d.ts.map +1 -1
  113. package/dist/detectors/citation-entry.js +19 -5
  114. package/dist/detectors/citation-entry.js.map +1 -1
  115. package/dist/detectors/code-before.d.ts +6 -0
  116. package/dist/detectors/code-before.d.ts.map +1 -0
  117. package/dist/detectors/code-before.js +15 -0
  118. package/dist/detectors/code-before.js.map +1 -0
  119. package/dist/detectors/connective-hierarchy.d.ts +11 -1
  120. package/dist/detectors/connective-hierarchy.d.ts.map +1 -1
  121. package/dist/detectors/connective-hierarchy.js +26 -6
  122. package/dist/detectors/connective-hierarchy.js.map +1 -1
  123. package/dist/detectors/currency-notation.d.ts +3 -1
  124. package/dist/detectors/currency-notation.d.ts.map +1 -1
  125. package/dist/detectors/currency-notation.js +4 -3
  126. package/dist/detectors/currency-notation.js.map +1 -1
  127. package/dist/detectors/date-outside-period.d.ts +4 -0
  128. package/dist/detectors/date-outside-period.d.ts.map +1 -0
  129. package/dist/detectors/date-outside-period.js +34 -0
  130. package/dist/detectors/date-outside-period.js.map +1 -0
  131. package/dist/detectors/default-values.d.ts +3 -0
  132. package/dist/detectors/default-values.d.ts.map +1 -0
  133. package/dist/detectors/default-values.js +14 -0
  134. package/dist/detectors/default-values.js.map +1 -0
  135. package/dist/detectors/defined-term-form.d.ts +6 -2
  136. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  137. package/dist/detectors/defined-term-form.js +72 -12
  138. package/dist/detectors/defined-term-form.js.map +1 -1
  139. package/dist/detectors/definition-use.d.ts.map +1 -1
  140. package/dist/detectors/definition-use.js +8 -1
  141. package/dist/detectors/definition-use.js.map +1 -1
  142. package/dist/detectors/deprecated-use.d.ts +3 -0
  143. package/dist/detectors/deprecated-use.d.ts.map +1 -0
  144. package/dist/detectors/deprecated-use.js +14 -0
  145. package/dist/detectors/deprecated-use.js.map +1 -0
  146. package/dist/detectors/derived-numbers.d.ts +1 -1
  147. package/dist/detectors/derived-numbers.d.ts.map +1 -1
  148. package/dist/detectors/derived-numbers.js +79 -16
  149. package/dist/detectors/derived-numbers.js.map +1 -1
  150. package/dist/detectors/document-shape.d.ts +1 -0
  151. package/dist/detectors/document-shape.d.ts.map +1 -1
  152. package/dist/detectors/document-shape.js +4 -1
  153. package/dist/detectors/document-shape.js.map +1 -1
  154. package/dist/detectors/due-date.d.ts +3 -0
  155. package/dist/detectors/due-date.d.ts.map +1 -0
  156. package/dist/detectors/due-date.js +38 -0
  157. package/dist/detectors/due-date.js.map +1 -0
  158. package/dist/detectors/en-shape.d.ts.map +1 -1
  159. package/dist/detectors/en-shape.js +17 -9
  160. package/dist/detectors/en-shape.js.map +1 -1
  161. package/dist/detectors/fact-consistency.d.ts.map +1 -1
  162. package/dist/detectors/fact-consistency.js +89 -2
  163. package/dist/detectors/fact-consistency.js.map +1 -1
  164. package/dist/detectors/heading-echo.d.ts.map +1 -1
  165. package/dist/detectors/heading-echo.js +10 -1
  166. package/dist/detectors/heading-echo.js.map +1 -1
  167. package/dist/detectors/kana-function-word.d.ts +12 -0
  168. package/dist/detectors/kana-function-word.d.ts.map +1 -0
  169. package/dist/detectors/kana-function-word.js +59 -0
  170. package/dist/detectors/kana-function-word.js.map +1 -0
  171. package/dist/detectors/line-amount.d.ts +3 -0
  172. package/dist/detectors/line-amount.d.ts.map +1 -0
  173. package/dist/detectors/line-amount.js +22 -0
  174. package/dist/detectors/line-amount.js.map +1 -0
  175. package/dist/detectors/location-pointer.d.ts +6 -0
  176. package/dist/detectors/location-pointer.d.ts.map +1 -0
  177. package/dist/detectors/location-pointer.js +22 -0
  178. package/dist/detectors/location-pointer.js.map +1 -0
  179. package/dist/detectors/mark-shape.d.ts.map +1 -1
  180. package/dist/detectors/mark-shape.js +13 -1
  181. package/dist/detectors/mark-shape.js.map +1 -1
  182. package/dist/detectors/nado-closed-list.d.ts +3 -0
  183. package/dist/detectors/nado-closed-list.d.ts.map +1 -0
  184. package/dist/detectors/nado-closed-list.js +21 -0
  185. package/dist/detectors/nado-closed-list.js.map +1 -0
  186. package/dist/detectors/name-variant.d.ts.map +1 -1
  187. package/dist/detectors/name-variant.js +92 -10
  188. package/dist/detectors/name-variant.js.map +1 -1
  189. package/dist/detectors/next-word.d.ts.map +1 -1
  190. package/dist/detectors/next-word.js +41 -8
  191. package/dist/detectors/next-word.js.map +1 -1
  192. package/dist/detectors/number-word-figure.d.ts +5 -0
  193. package/dist/detectors/number-word-figure.d.ts.map +1 -0
  194. package/dist/detectors/number-word-figure.js +32 -0
  195. package/dist/detectors/number-word-figure.js.map +1 -0
  196. package/dist/detectors/obligation-without-deadline.d.ts +39 -0
  197. package/dist/detectors/obligation-without-deadline.d.ts.map +1 -0
  198. package/dist/detectors/obligation-without-deadline.js +148 -0
  199. package/dist/detectors/obligation-without-deadline.js.map +1 -0
  200. package/dist/detectors/open-end-names.d.ts +23 -0
  201. package/dist/detectors/open-end-names.d.ts.map +1 -0
  202. package/dist/detectors/open-end-names.js +95 -0
  203. package/dist/detectors/open-end-names.js.map +1 -0
  204. package/dist/detectors/ordinal-run-gaps.d.ts +8 -0
  205. package/dist/detectors/ordinal-run-gaps.d.ts.map +1 -0
  206. package/dist/detectors/ordinal-run-gaps.js +80 -0
  207. package/dist/detectors/ordinal-run-gaps.js.map +1 -0
  208. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  209. package/dist/detectors/orthographic-variant.js +26 -9
  210. package/dist/detectors/orthographic-variant.js.map +1 -1
  211. package/dist/detectors/orthography.d.ts.map +1 -1
  212. package/dist/detectors/orthography.js +5 -0
  213. package/dist/detectors/orthography.js.map +1 -1
  214. package/dist/detectors/parameter-table.d.ts +3 -0
  215. package/dist/detectors/parameter-table.d.ts.map +1 -0
  216. package/dist/detectors/parameter-table.js +16 -0
  217. package/dist/detectors/parameter-table.js.map +1 -0
  218. package/dist/detectors/phone-number-variant.d.ts +3 -0
  219. package/dist/detectors/phone-number-variant.d.ts.map +1 -0
  220. package/dist/detectors/phone-number-variant.js +18 -0
  221. package/dist/detectors/phone-number-variant.js.map +1 -0
  222. package/dist/detectors/prerequisite-order.d.ts +3 -0
  223. package/dist/detectors/prerequisite-order.d.ts.map +1 -0
  224. package/dist/detectors/prerequisite-order.js +30 -0
  225. package/dist/detectors/prerequisite-order.js.map +1 -0
  226. package/dist/detectors/quote-unnamed-speaker.d.ts +3 -0
  227. package/dist/detectors/quote-unnamed-speaker.d.ts.map +1 -0
  228. package/dist/detectors/quote-unnamed-speaker.js +18 -0
  229. package/dist/detectors/quote-unnamed-speaker.js.map +1 -0
  230. package/dist/detectors/quote-without-source.d.ts +12 -2
  231. package/dist/detectors/quote-without-source.d.ts.map +1 -1
  232. package/dist/detectors/quote-without-source.js +45 -11
  233. package/dist/detectors/quote-without-source.js.map +1 -1
  234. package/dist/detectors/registry/amount-range.d.ts +3 -0
  235. package/dist/detectors/registry/amount-range.d.ts.map +1 -0
  236. package/dist/detectors/registry/amount-range.js +3 -0
  237. package/dist/detectors/registry/amount-range.js.map +1 -0
  238. package/dist/detectors/registry/amount-scale.d.ts +3 -0
  239. package/dist/detectors/registry/amount-scale.d.ts.map +1 -0
  240. package/dist/detectors/registry/amount-scale.js +3 -0
  241. package/dist/detectors/registry/amount-scale.js.map +1 -0
  242. package/dist/detectors/registry/arrival-before-departure.d.ts +3 -0
  243. package/dist/detectors/registry/arrival-before-departure.d.ts.map +1 -0
  244. package/dist/detectors/registry/arrival-before-departure.js +3 -0
  245. package/dist/detectors/registry/arrival-before-departure.js.map +1 -0
  246. package/dist/detectors/registry/date-outside-period.d.ts +3 -0
  247. package/dist/detectors/registry/date-outside-period.d.ts.map +1 -0
  248. package/dist/detectors/registry/date-outside-period.js +3 -0
  249. package/dist/detectors/registry/date-outside-period.js.map +1 -0
  250. package/dist/detectors/registry/default-values.d.ts +3 -0
  251. package/dist/detectors/registry/default-values.d.ts.map +1 -0
  252. package/dist/detectors/registry/default-values.js +3 -0
  253. package/dist/detectors/registry/default-values.js.map +1 -0
  254. package/dist/detectors/registry/deprecated-use.d.ts +3 -0
  255. package/dist/detectors/registry/deprecated-use.d.ts.map +1 -0
  256. package/dist/detectors/registry/deprecated-use.js +3 -0
  257. package/dist/detectors/registry/deprecated-use.js.map +1 -0
  258. package/dist/detectors/registry/due-date.d.ts +3 -0
  259. package/dist/detectors/registry/due-date.d.ts.map +1 -0
  260. package/dist/detectors/registry/due-date.js +3 -0
  261. package/dist/detectors/registry/due-date.js.map +1 -0
  262. package/dist/detectors/registry/kana-function-word.d.ts +3 -0
  263. package/dist/detectors/registry/kana-function-word.d.ts.map +1 -0
  264. package/dist/detectors/registry/kana-function-word.js +3 -0
  265. package/dist/detectors/registry/kana-function-word.js.map +1 -0
  266. package/dist/detectors/registry/line-amount.d.ts +3 -0
  267. package/dist/detectors/registry/line-amount.d.ts.map +1 -0
  268. package/dist/detectors/registry/line-amount.js +3 -0
  269. package/dist/detectors/registry/line-amount.js.map +1 -0
  270. package/dist/detectors/registry/nado-closed-list.d.ts +3 -0
  271. package/dist/detectors/registry/nado-closed-list.d.ts.map +1 -0
  272. package/dist/detectors/registry/nado-closed-list.js +3 -0
  273. package/dist/detectors/registry/nado-closed-list.js.map +1 -0
  274. package/dist/detectors/registry/number-word-figure.d.ts +3 -0
  275. package/dist/detectors/registry/number-word-figure.d.ts.map +1 -0
  276. package/dist/detectors/registry/number-word-figure.js +3 -0
  277. package/dist/detectors/registry/number-word-figure.js.map +1 -0
  278. package/dist/detectors/registry/obligation-without-deadline.d.ts +3 -0
  279. package/dist/detectors/registry/obligation-without-deadline.d.ts.map +1 -0
  280. package/dist/detectors/registry/obligation-without-deadline.js +3 -0
  281. package/dist/detectors/registry/obligation-without-deadline.js.map +1 -0
  282. package/dist/detectors/registry/parameter-table.d.ts +3 -0
  283. package/dist/detectors/registry/parameter-table.d.ts.map +1 -0
  284. package/dist/detectors/registry/parameter-table.js +3 -0
  285. package/dist/detectors/registry/parameter-table.js.map +1 -0
  286. package/dist/detectors/registry/phone-number-variant.d.ts +3 -0
  287. package/dist/detectors/registry/phone-number-variant.d.ts.map +1 -0
  288. package/dist/detectors/registry/phone-number-variant.js +3 -0
  289. package/dist/detectors/registry/phone-number-variant.js.map +1 -0
  290. package/dist/detectors/registry/prerequisite-order.d.ts +3 -0
  291. package/dist/detectors/registry/prerequisite-order.d.ts.map +1 -0
  292. package/dist/detectors/registry/prerequisite-order.js +3 -0
  293. package/dist/detectors/registry/prerequisite-order.js.map +1 -0
  294. package/dist/detectors/registry/quote-unnamed-speaker.d.ts +3 -0
  295. package/dist/detectors/registry/quote-unnamed-speaker.d.ts.map +1 -0
  296. package/dist/detectors/registry/quote-unnamed-speaker.js +3 -0
  297. package/dist/detectors/registry/quote-unnamed-speaker.js.map +1 -0
  298. package/dist/detectors/registry/tax-amount.d.ts +3 -0
  299. package/dist/detectors/registry/tax-amount.d.ts.map +1 -0
  300. package/dist/detectors/registry/tax-amount.js +3 -0
  301. package/dist/detectors/registry/tax-amount.js.map +1 -0
  302. package/dist/detectors/registry/time-order.d.ts +3 -0
  303. package/dist/detectors/registry/time-order.d.ts.map +1 -0
  304. package/dist/detectors/registry/time-order.js +3 -0
  305. package/dist/detectors/registry/time-order.js.map +1 -0
  306. package/dist/detectors/registry/ui-label.d.ts +3 -0
  307. package/dist/detectors/registry/ui-label.d.ts.map +1 -0
  308. package/dist/detectors/registry/ui-label.js +3 -0
  309. package/dist/detectors/registry/ui-label.js.map +1 -0
  310. package/dist/detectors/registry/undefined-call.d.ts +3 -0
  311. package/dist/detectors/registry/undefined-call.d.ts.map +1 -0
  312. package/dist/detectors/registry/undefined-call.js +3 -0
  313. package/dist/detectors/registry/undefined-call.js.map +1 -0
  314. package/dist/detectors/registry/undefined-term.d.ts +3 -0
  315. package/dist/detectors/registry/undefined-term.d.ts.map +1 -0
  316. package/dist/detectors/registry/undefined-term.js +3 -0
  317. package/dist/detectors/registry/undefined-term.js.map +1 -0
  318. package/dist/detectors/registry/version-order.d.ts +3 -0
  319. package/dist/detectors/registry/version-order.d.ts.map +1 -0
  320. package/dist/detectors/registry/version-order.js +3 -0
  321. package/dist/detectors/registry/version-order.js.map +1 -0
  322. package/dist/detectors/registry/warning-action.d.ts +3 -0
  323. package/dist/detectors/registry/warning-action.d.ts.map +1 -0
  324. package/dist/detectors/registry/warning-action.js +3 -0
  325. package/dist/detectors/registry/warning-action.js.map +1 -0
  326. package/dist/detectors/requirement-smell.d.ts.map +1 -1
  327. package/dist/detectors/requirement-smell.js +25 -8
  328. package/dist/detectors/requirement-smell.js.map +1 -1
  329. package/dist/detectors/structure-tree.d.ts +12 -4
  330. package/dist/detectors/structure-tree.d.ts.map +1 -1
  331. package/dist/detectors/structure-tree.js +31 -14
  332. package/dist/detectors/structure-tree.js.map +1 -1
  333. package/dist/detectors/superlative-scope.d.ts.map +1 -1
  334. package/dist/detectors/superlative-scope.js +11 -1
  335. package/dist/detectors/superlative-scope.js.map +1 -1
  336. package/dist/detectors/tax-amount.d.ts +3 -0
  337. package/dist/detectors/tax-amount.d.ts.map +1 -0
  338. package/dist/detectors/tax-amount.js +19 -0
  339. package/dist/detectors/tax-amount.js.map +1 -0
  340. package/dist/detectors/technical-docs.d.ts.map +1 -1
  341. package/dist/detectors/technical-docs.js +5 -1
  342. package/dist/detectors/technical-docs.js.map +1 -1
  343. package/dist/detectors/term-extension.d.ts +14 -0
  344. package/dist/detectors/term-extension.d.ts.map +1 -0
  345. package/dist/detectors/term-extension.js +67 -0
  346. package/dist/detectors/term-extension.js.map +1 -0
  347. package/dist/detectors/time-order.d.ts +4 -0
  348. package/dist/detectors/time-order.d.ts.map +1 -0
  349. package/dist/detectors/time-order.js +32 -0
  350. package/dist/detectors/time-order.js.map +1 -0
  351. package/dist/detectors/ui-label.d.ts +3 -0
  352. package/dist/detectors/ui-label.d.ts.map +1 -0
  353. package/dist/detectors/ui-label.js +16 -0
  354. package/dist/detectors/ui-label.js.map +1 -0
  355. package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
  356. package/dist/detectors/unbalanced-bracket.js +8 -13
  357. package/dist/detectors/unbalanced-bracket.js.map +1 -1
  358. package/dist/detectors/undefined-call.d.ts +3 -0
  359. package/dist/detectors/undefined-call.d.ts.map +1 -0
  360. package/dist/detectors/undefined-call.js +18 -0
  361. package/dist/detectors/undefined-call.js.map +1 -0
  362. package/dist/detectors/undefined-term.d.ts +22 -0
  363. package/dist/detectors/undefined-term.d.ts.map +1 -0
  364. package/dist/detectors/undefined-term.js +85 -0
  365. package/dist/detectors/undefined-term.js.map +1 -0
  366. package/dist/detectors/unknown-word.d.ts +1 -1
  367. package/dist/detectors/unknown-word.js +3 -3
  368. package/dist/detectors/unknown-word.js.map +1 -1
  369. package/dist/detectors/vague-deadline.d.ts +4 -0
  370. package/dist/detectors/vague-deadline.d.ts.map +1 -1
  371. package/dist/detectors/vague-deadline.js +3 -3
  372. package/dist/detectors/vague-deadline.js.map +1 -1
  373. package/dist/detectors/version-mismatch.d.ts.map +1 -1
  374. package/dist/detectors/version-mismatch.js +18 -1
  375. package/dist/detectors/version-mismatch.js.map +1 -1
  376. package/dist/detectors/version-order.d.ts +3 -0
  377. package/dist/detectors/version-order.d.ts.map +1 -0
  378. package/dist/detectors/version-order.js +43 -0
  379. package/dist/detectors/version-order.js.map +1 -0
  380. package/dist/detectors/warning-action.d.ts +3 -0
  381. package/dist/detectors/warning-action.d.ts.map +1 -0
  382. package/dist/detectors/warning-action.js +48 -0
  383. package/dist/detectors/warning-action.js.map +1 -0
  384. package/dist/facts/condition-pairs.d.ts +51 -0
  385. package/dist/facts/condition-pairs.d.ts.map +1 -0
  386. package/dist/facts/condition-pairs.js +203 -0
  387. package/dist/facts/condition-pairs.js.map +1 -0
  388. package/dist/facts/counted-facts.d.ts +16 -0
  389. package/dist/facts/counted-facts.d.ts.map +1 -0
  390. package/dist/facts/counted-facts.js +45 -0
  391. package/dist/facts/counted-facts.js.map +1 -0
  392. package/dist/facts/event-dates.d.ts +26 -0
  393. package/dist/facts/event-dates.d.ts.map +1 -0
  394. package/dist/facts/event-dates.js +38 -0
  395. package/dist/facts/event-dates.js.map +1 -0
  396. package/dist/facts/fact-scope.d.ts +2 -0
  397. package/dist/facts/fact-scope.d.ts.map +1 -1
  398. package/dist/facts/fact-scope.js +5 -0
  399. package/dist/facts/fact-scope.js.map +1 -1
  400. package/dist/facts/labelled-facts.d.ts +2 -0
  401. package/dist/facts/labelled-facts.d.ts.map +1 -1
  402. package/dist/facts/labelled-facts.js +9 -1
  403. package/dist/facts/labelled-facts.js.map +1 -1
  404. package/dist/facts/table-facts.d.ts +16 -0
  405. package/dist/facts/table-facts.d.ts.map +1 -1
  406. package/dist/facts/table-facts.js +2 -2
  407. package/dist/facts/table-facts.js.map +1 -1
  408. package/dist/grade/ai-score.d.ts +1 -1
  409. package/dist/grade/ai-score.d.ts.map +1 -1
  410. package/dist/grade/text.js +2 -2
  411. package/dist/grade/text.js.map +1 -1
  412. package/dist/heading-numbering.js +2 -2
  413. package/dist/heading-numbering.js.map +1 -1
  414. package/dist/html/fetch-page.d.ts +20 -0
  415. package/dist/html/fetch-page.d.ts.map +1 -0
  416. package/dist/html/fetch-page.js +51 -0
  417. package/dist/html/fetch-page.js.map +1 -0
  418. package/dist/html/fetched-text.d.ts +5 -0
  419. package/dist/html/fetched-text.d.ts.map +1 -0
  420. package/dist/html/fetched-text.js +25 -0
  421. package/dist/html/fetched-text.js.map +1 -0
  422. package/dist/html/html-content-block.d.ts +6 -0
  423. package/dist/html/html-content-block.d.ts.map +1 -0
  424. package/dist/html/html-content-block.js +86 -0
  425. package/dist/html/html-content-block.js.map +1 -0
  426. package/dist/html/html-elements.d.ts +41 -0
  427. package/dist/html/html-elements.d.ts.map +1 -0
  428. package/dist/html/html-elements.js +91 -0
  429. package/dist/html/html-elements.js.map +1 -0
  430. package/dist/html/html-footnote-marks.d.ts +2 -0
  431. package/dist/html/html-footnote-marks.d.ts.map +1 -0
  432. package/dist/html/html-footnote-marks.js +15 -0
  433. package/dist/html/html-footnote-marks.js.map +1 -0
  434. package/dist/html/html-heading-links.d.ts +6 -0
  435. package/dist/html/html-heading-links.d.ts.map +1 -0
  436. package/dist/html/html-heading-links.js +71 -0
  437. package/dist/html/html-heading-links.js.map +1 -0
  438. package/dist/html/html-lost-tags.d.ts +3 -0
  439. package/dist/html/html-lost-tags.d.ts.map +1 -0
  440. package/dist/html/html-lost-tags.js +11 -0
  441. package/dist/html/html-lost-tags.js.map +1 -0
  442. package/dist/html/html-markdown.d.ts +2 -0
  443. package/dist/html/html-markdown.d.ts.map +1 -0
  444. package/dist/html/html-markdown.js +347 -0
  445. package/dist/html/html-markdown.js.map +1 -0
  446. package/dist/html/html-preformatted.d.ts +17 -0
  447. package/dist/html/html-preformatted.d.ts.map +1 -0
  448. package/dist/html/html-preformatted.js +82 -0
  449. package/dist/html/html-preformatted.js.map +1 -0
  450. package/dist/html/html-reader-only.d.ts +6 -0
  451. package/dist/html/html-reader-only.d.ts.map +1 -0
  452. package/dist/html/html-reader-only.js +63 -0
  453. package/dist/html/html-reader-only.js.map +1 -0
  454. package/dist/html/html-run-in-headings.d.ts +2 -0
  455. package/dist/html/html-run-in-headings.d.ts.map +1 -0
  456. package/dist/html/html-run-in-headings.js +36 -0
  457. package/dist/html/html-run-in-headings.js.map +1 -0
  458. package/dist/html/html-tables.d.ts +3 -0
  459. package/dist/html/html-tables.d.ts.map +1 -0
  460. package/dist/html/html-tables.js +58 -0
  461. package/dist/html/html-tables.js.map +1 -0
  462. package/dist/html/html-widgets.d.ts +3 -0
  463. package/dist/html/html-widgets.d.ts.map +1 -0
  464. package/dist/html/html-widgets.js +71 -0
  465. package/dist/html/html-widgets.js.map +1 -0
  466. package/dist/html/markup-text.d.ts +5 -0
  467. package/dist/html/markup-text.d.ts.map +1 -0
  468. package/dist/html/markup-text.js +32 -0
  469. package/dist/html/markup-text.js.map +1 -0
  470. package/dist/html/page-document.d.ts +9 -0
  471. package/dist/html/page-document.d.ts.map +1 -0
  472. package/dist/html/page-document.js +19 -0
  473. package/dist/html/page-document.js.map +1 -0
  474. package/dist/inline-count.d.ts +19 -0
  475. package/dist/inline-count.d.ts.map +1 -0
  476. package/dist/inline-count.js +109 -0
  477. package/dist/inline-count.js.map +1 -0
  478. package/dist/kana-spelling.d.ts +5 -0
  479. package/dist/kana-spelling.d.ts.map +1 -1
  480. package/dist/kana-spelling.js +5 -0
  481. package/dist/kana-spelling.js.map +1 -1
  482. package/dist/location-part.d.ts +13 -0
  483. package/dist/location-part.d.ts.map +1 -0
  484. package/dist/location-part.js +24 -0
  485. package/dist/location-part.js.map +1 -0
  486. package/dist/nado-closed-list.d.ts +20 -0
  487. package/dist/nado-closed-list.d.ts.map +1 -0
  488. package/dist/nado-closed-list.js +72 -0
  489. package/dist/nado-closed-list.js.map +1 -0
  490. package/dist/name-cue.d.ts +17 -0
  491. package/dist/name-cue.d.ts.map +1 -0
  492. package/dist/name-cue.js +29 -0
  493. package/dist/name-cue.js.map +1 -0
  494. package/dist/name-variants.d.ts +41 -5
  495. package/dist/name-variants.d.ts.map +1 -1
  496. package/dist/name-variants.js +93 -8
  497. package/dist/name-variants.js.map +1 -1
  498. package/dist/paragraph-runs.d.ts +6 -1
  499. package/dist/paragraph-runs.d.ts.map +1 -1
  500. package/dist/paragraph-runs.js +9 -2
  501. package/dist/paragraph-runs.js.map +1 -1
  502. package/dist/parameter-table.d.ts +19 -0
  503. package/dist/parameter-table.d.ts.map +1 -0
  504. package/dist/parameter-table.js +191 -0
  505. package/dist/parameter-table.js.map +1 -0
  506. package/dist/phone-numbers.d.ts +23 -0
  507. package/dist/phone-numbers.d.ts.map +1 -0
  508. package/dist/phone-numbers.js +83 -0
  509. package/dist/phone-numbers.js.map +1 -0
  510. package/dist/place-names.d.ts +55 -0
  511. package/dist/place-names.d.ts.map +1 -0
  512. package/dist/place-names.js +196 -0
  513. package/dist/place-names.js.map +1 -0
  514. package/dist/plugin.d.ts +4 -0
  515. package/dist/plugin.d.ts.map +1 -1
  516. package/dist/prerequisite-order.d.ts +16 -0
  517. package/dist/prerequisite-order.d.ts.map +1 -0
  518. package/dist/prerequisite-order.js +29 -0
  519. package/dist/prerequisite-order.js.map +1 -0
  520. package/dist/profile/parse.d.ts.map +1 -1
  521. package/dist/profile/parse.js +10 -1
  522. package/dist/profile/parse.js.map +1 -1
  523. package/dist/reasons.d.ts +2 -0
  524. package/dist/reasons.d.ts.map +1 -1
  525. package/dist/reasons.js +2 -0
  526. package/dist/reasons.js.map +1 -1
  527. package/dist/render/rules-json.d.ts.map +1 -1
  528. package/dist/render/rules-json.js +4 -0
  529. package/dist/render/rules-json.js.map +1 -1
  530. package/dist/render/rules-table.d.ts.map +1 -1
  531. package/dist/render/rules-table.js +6 -2
  532. package/dist/render/rules-table.js.map +1 -1
  533. package/dist/rule-genres.d.ts +5 -2
  534. package/dist/rule-genres.d.ts.map +1 -1
  535. package/dist/rule-genres.js +2 -0
  536. package/dist/rule-genres.js.map +1 -1
  537. package/dist/rule-load.d.ts.map +1 -1
  538. package/dist/rule-load.js +2 -1
  539. package/dist/rule-load.js.map +1 -1
  540. package/dist/run.d.ts.map +1 -1
  541. package/dist/run.js +5 -1
  542. package/dist/run.js.map +1 -1
  543. package/dist/spelling.d.ts +2 -0
  544. package/dist/spelling.d.ts.map +1 -1
  545. package/dist/spelling.js +6 -0
  546. package/dist/spelling.js.map +1 -1
  547. package/dist/structure/action-due.d.ts +21 -0
  548. package/dist/structure/action-due.d.ts.map +1 -0
  549. package/dist/structure/action-due.js +126 -0
  550. package/dist/structure/action-due.js.map +1 -0
  551. package/dist/structure/amount-range.d.ts +30 -0
  552. package/dist/structure/amount-range.d.ts.map +1 -0
  553. package/dist/structure/amount-range.js +153 -0
  554. package/dist/structure/amount-range.js.map +1 -0
  555. package/dist/structure/amount-scale.d.ts +35 -0
  556. package/dist/structure/amount-scale.d.ts.map +1 -0
  557. package/dist/structure/amount-scale.js +83 -0
  558. package/dist/structure/amount-scale.js.map +1 -0
  559. package/dist/structure/cite.d.ts +5 -2
  560. package/dist/structure/cite.d.ts.map +1 -1
  561. package/dist/structure/cite.js +20 -1
  562. package/dist/structure/cite.js.map +1 -1
  563. package/dist/structure/counted-amounts.d.ts +12 -0
  564. package/dist/structure/counted-amounts.d.ts.map +1 -0
  565. package/dist/structure/counted-amounts.js +30 -0
  566. package/dist/structure/counted-amounts.js.map +1 -0
  567. package/dist/structure/date-order.d.ts +24 -3
  568. package/dist/structure/date-order.d.ts.map +1 -1
  569. package/dist/structure/date-order.js +49 -17
  570. package/dist/structure/date-order.js.map +1 -1
  571. package/dist/structure/date-outside-period.d.ts +27 -0
  572. package/dist/structure/date-outside-period.d.ts.map +1 -0
  573. package/dist/structure/date-outside-period.js +86 -0
  574. package/dist/structure/date-outside-period.js.map +1 -0
  575. package/dist/structure/definition-use.d.ts +5 -2
  576. package/dist/structure/definition-use.d.ts.map +1 -1
  577. package/dist/structure/definition-use.js +11 -3
  578. package/dist/structure/definition-use.js.map +1 -1
  579. package/dist/structure/due-date.d.ts +19 -0
  580. package/dist/structure/due-date.d.ts.map +1 -0
  581. package/dist/structure/due-date.js +30 -0
  582. package/dist/structure/due-date.js.map +1 -0
  583. package/dist/structure/heading-runs.d.ts +9 -0
  584. package/dist/structure/heading-runs.d.ts.map +1 -0
  585. package/dist/structure/heading-runs.js +23 -0
  586. package/dist/structure/heading-runs.js.map +1 -0
  587. package/dist/structure/install-pin.d.ts +46 -0
  588. package/dist/structure/install-pin.d.ts.map +1 -0
  589. package/dist/structure/install-pin.js +85 -0
  590. package/dist/structure/install-pin.js.map +1 -0
  591. package/dist/structure/leg-times.d.ts +34 -0
  592. package/dist/structure/leg-times.d.ts.map +1 -0
  593. package/dist/structure/leg-times.js +135 -0
  594. package/dist/structure/leg-times.js.map +1 -0
  595. package/dist/structure/line-amount-unit.d.ts +24 -0
  596. package/dist/structure/line-amount-unit.d.ts.map +1 -0
  597. package/dist/structure/line-amount-unit.js +24 -0
  598. package/dist/structure/line-amount-unit.js.map +1 -0
  599. package/dist/structure/line-amount.d.ts +40 -0
  600. package/dist/structure/line-amount.d.ts.map +1 -0
  601. package/dist/structure/line-amount.js +118 -0
  602. package/dist/structure/line-amount.js.map +1 -0
  603. package/dist/structure/number-word-figure.d.ts +37 -0
  604. package/dist/structure/number-word-figure.d.ts.map +1 -0
  605. package/dist/structure/number-word-figure.js +151 -0
  606. package/dist/structure/number-word-figure.js.map +1 -0
  607. package/dist/structure/numbering.d.ts +1 -0
  608. package/dist/structure/numbering.d.ts.map +1 -1
  609. package/dist/structure/numbering.js +3 -0
  610. package/dist/structure/numbering.js.map +1 -1
  611. package/dist/structure/ordinal-runs.d.ts +45 -0
  612. package/dist/structure/ordinal-runs.d.ts.map +1 -0
  613. package/dist/structure/ordinal-runs.js +78 -0
  614. package/dist/structure/ordinal-runs.js.map +1 -0
  615. package/dist/structure/percent-sum-prose.d.ts +1 -1
  616. package/dist/structure/percent-sum-prose.d.ts.map +1 -1
  617. package/dist/structure/percent-sum-prose.js +45 -3
  618. package/dist/structure/percent-sum-prose.js.map +1 -1
  619. package/dist/structure/percent-sum.d.ts +8 -0
  620. package/dist/structure/percent-sum.d.ts.map +1 -1
  621. package/dist/structure/percent-sum.js +8 -1
  622. package/dist/structure/percent-sum.js.map +1 -1
  623. package/dist/structure/release-list.d.ts +9 -0
  624. package/dist/structure/release-list.d.ts.map +1 -0
  625. package/dist/structure/release-list.js +46 -0
  626. package/dist/structure/release-list.js.map +1 -0
  627. package/dist/structure/share-column.d.ts +7 -0
  628. package/dist/structure/share-column.d.ts.map +1 -0
  629. package/dist/structure/share-column.js +22 -0
  630. package/dist/structure/share-column.js.map +1 -0
  631. package/dist/structure/stated-period.d.ts +31 -0
  632. package/dist/structure/stated-period.d.ts.map +1 -0
  633. package/dist/structure/stated-period.js +127 -0
  634. package/dist/structure/stated-period.js.map +1 -0
  635. package/dist/structure/subject-change.d.ts +8 -0
  636. package/dist/structure/subject-change.d.ts.map +1 -0
  637. package/dist/structure/subject-change.js +31 -0
  638. package/dist/structure/subject-change.js.map +1 -0
  639. package/dist/structure/tax.d.ts +25 -0
  640. package/dist/structure/tax.d.ts.map +1 -0
  641. package/dist/structure/tax.js +86 -0
  642. package/dist/structure/tax.js.map +1 -0
  643. package/dist/structure/time-marks.d.ts +58 -0
  644. package/dist/structure/time-marks.d.ts.map +1 -0
  645. package/dist/structure/time-marks.js +74 -0
  646. package/dist/structure/time-marks.js.map +1 -0
  647. package/dist/structure/time-order.d.ts +21 -0
  648. package/dist/structure/time-order.d.ts.map +1 -0
  649. package/dist/structure/time-order.js +108 -0
  650. package/dist/structure/time-order.js.map +1 -0
  651. package/dist/structure/title-lines.d.ts +8 -0
  652. package/dist/structure/title-lines.d.ts.map +1 -0
  653. package/dist/structure/title-lines.js +27 -0
  654. package/dist/structure/title-lines.js.map +1 -0
  655. package/dist/structure/total.d.ts.map +1 -1
  656. package/dist/structure/total.js +3 -1
  657. package/dist/structure/total.js.map +1 -1
  658. package/dist/structure/version-mismatch.d.ts +1 -5
  659. package/dist/structure/version-mismatch.d.ts.map +1 -1
  660. package/dist/structure/version-mismatch.js +65 -12
  661. package/dist/structure/version-mismatch.js.map +1 -1
  662. package/dist/structure/version-order.d.ts +23 -0
  663. package/dist/structure/version-order.d.ts.map +1 -0
  664. package/dist/structure/version-order.js +67 -0
  665. package/dist/structure/version-order.js.map +1 -0
  666. package/dist/table-text.d.ts +9 -0
  667. package/dist/table-text.d.ts.map +1 -0
  668. package/dist/table-text.js +36 -0
  669. package/dist/table-text.js.map +1 -0
  670. package/dist/ui-labels.d.ts +16 -0
  671. package/dist/ui-labels.d.ts.map +1 -0
  672. package/dist/ui-labels.js +42 -0
  673. package/dist/ui-labels.js.map +1 -0
  674. package/dist/undefined-call.d.ts +13 -0
  675. package/dist/undefined-call.d.ts.map +1 -0
  676. package/dist/undefined-call.js +55 -0
  677. package/dist/undefined-call.js.map +1 -0
  678. package/dist/unnamed-speaker.d.ts +23 -0
  679. package/dist/unnamed-speaker.d.ts.map +1 -0
  680. package/dist/unnamed-speaker.js +176 -0
  681. package/dist/unnamed-speaker.js.map +1 -0
  682. package/dist/warning-action.d.ts +22 -0
  683. package/dist/warning-action.d.ts.map +1 -0
  684. package/dist/warning-action.js +58 -0
  685. package/dist/warning-action.js.map +1 -0
  686. package/genres.yaml +2 -0
  687. package/package.json +4 -3
  688. package/profiles/statute.yaml +8 -0
  689. package/rules/agreement-slip.yaml +2 -2
  690. package/rules/amount-range-reversed.yaml +52 -0
  691. package/rules/amount-scale-consistency.yaml +74 -0
  692. package/rules/announced-count-mismatch.yaml +9 -4
  693. package/rules/arrival-before-departure.yaml +48 -0
  694. package/rules/change-rate-mismatch.yaml +5 -4
  695. package/rules/connective-hierarchy.yaml +3 -3
  696. package/rules/currency-notation-consistency.yaml +2 -2
  697. package/rules/date-order.yaml +9 -4
  698. package/rules/date-outside-period.yaml +64 -0
  699. package/rules/default-value-mismatch.yaml +79 -0
  700. package/rules/defined-term-form.yaml +9 -7
  701. package/rules/deprecated-option-used.yaml +78 -0
  702. package/rules/doubled-nado.yaml +28 -12
  703. package/rules/due-before-issue.yaml +68 -0
  704. package/rules/duplicate-definition.yaml +2 -2
  705. package/rules/duration-mismatch.yaml +12 -4
  706. package/rules/elapsed-years-mismatch.yaml +2 -2
  707. package/rules/heading-echo.yaml +2 -2
  708. package/rules/hyphen-as-dash.yaml +2 -2
  709. package/rules/kana-function-word.yaml +58 -0
  710. package/rules/latin-spacing.yaml +6 -5
  711. package/rules/line-amount-mismatch.yaml +58 -0
  712. package/rules/nado-closed-list.yaml +77 -0
  713. package/rules/name-variant.yaml +17 -2
  714. package/rules/number-word-figure-mismatch.yaml +76 -0
  715. package/rules/numbering-gap.yaml +2 -2
  716. package/rules/obligation-without-deadline.yaml +95 -0
  717. package/rules/one-sentence-paragraph-run.yaml +2 -3
  718. package/rules/parameter-table-mismatch.yaml +90 -0
  719. package/rules/percent-sum-mismatch.yaml +2 -2
  720. package/rules/phone-number-variant.yaml +68 -0
  721. package/rules/prerequisite-after-step.yaml +78 -0
  722. package/rules/quote-unnamed-speaker.yaml +67 -0
  723. package/rules/quote-without-source.yaml +6 -6
  724. package/rules/requirement-smell.yaml +3 -3
  725. package/rules/sentence-initial-conjunction-run.yaml +13 -7
  726. package/rules/summary-fact-mismatch.yaml +4 -4
  727. package/rules/tax-mismatch.yaml +71 -0
  728. package/rules/time-order.yaml +65 -0
  729. package/rules/title-length.yaml +2 -2
  730. package/rules/ui-label-variant.yaml +70 -0
  731. package/rules/unbalanced-bracket.yaml +4 -4
  732. package/rules/uncomparable-graded.yaml +29 -10
  733. package/rules/undefined-function-call.yaml +77 -0
  734. package/rules/undefined-term.yaml +72 -0
  735. package/rules/unknown-word.yaml +2 -2
  736. package/rules/unqualified-superlative.yaml +2 -2
  737. package/rules/use-before-definition.yaml +2 -2
  738. package/rules/version-mismatch.yaml +12 -4
  739. package/rules/version-order.yaml +85 -0
  740. package/rules/very-adjective.yaml +31 -13
  741. package/rules/warning-without-action.yaml +64 -0
  742. package/rules/wordy-phrase.yaml +27 -9
  743. package/src/ai-score/of-document.ts +19 -9
  744. package/src/ai-score/render.ts +24 -4
  745. package/src/ai-score/score.ts +24 -3
  746. package/src/ai-score/signals.ts +12 -2
  747. package/src/ai-score/text.ts +7 -2
  748. package/src/announced-count.ts +19 -12
  749. package/src/check-source.ts +11 -2
  750. package/src/cli-text.ts +42 -18
  751. package/src/cli.ts +2 -1
  752. package/src/commands/cite-claims.ts +103 -0
  753. package/src/commands/cite-page.ts +61 -0
  754. package/src/commands/cite-scaffold.ts +27 -0
  755. package/src/commands/cite.ts +127 -58
  756. package/src/company-names.ts +202 -0
  757. package/src/default-values.ts +158 -0
  758. package/src/deprecated-use.ts +122 -0
  759. package/src/derived/number-word-counts.ts +28 -0
  760. package/src/derived/stays.ts +145 -0
  761. package/src/detectors/acronym-context.ts +10 -2
  762. package/src/detectors/address-word.ts +9 -0
  763. package/src/detectors/agreement-slip.ts +7 -1
  764. package/src/detectors/ai-phrasing.ts +6 -1
  765. package/src/detectors/amount-range.ts +54 -0
  766. package/src/detectors/amount-scale.ts +96 -0
  767. package/src/detectors/announced-count.ts +29 -11
  768. package/src/detectors/bare-comparative.ts +7 -2
  769. package/src/detectors/block-quotation.ts +95 -0
  770. package/src/detectors/bracket-label.ts +58 -0
  771. package/src/detectors/change-rate.ts +15 -2
  772. package/src/detectors/citation-entry.ts +20 -5
  773. package/src/detectors/code-before.ts +14 -0
  774. package/src/detectors/connective-hierarchy.ts +39 -11
  775. package/src/detectors/currency-notation.ts +4 -3
  776. package/src/detectors/date-outside-period.ts +38 -0
  777. package/src/detectors/default-values.ts +17 -0
  778. package/src/detectors/defined-term-form.ts +84 -15
  779. package/src/detectors/definition-use.ts +10 -2
  780. package/src/detectors/deprecated-use.ts +17 -0
  781. package/src/detectors/derived-numbers.ts +115 -17
  782. package/src/detectors/document-shape.ts +6 -1
  783. package/src/detectors/due-date.ts +47 -0
  784. package/src/detectors/en-shape.ts +27 -11
  785. package/src/detectors/fact-consistency.ts +110 -2
  786. package/src/detectors/heading-echo.ts +11 -1
  787. package/src/detectors/kana-function-word.ts +71 -0
  788. package/src/detectors/line-amount.ts +33 -0
  789. package/src/detectors/location-pointer.ts +30 -0
  790. package/src/detectors/mark-shape.ts +18 -1
  791. package/src/detectors/nado-closed-list.ts +25 -0
  792. package/src/detectors/name-variant.ts +114 -11
  793. package/src/detectors/next-word.ts +56 -9
  794. package/src/detectors/number-word-figure.ts +43 -0
  795. package/src/detectors/obligation-without-deadline.ts +192 -0
  796. package/src/detectors/open-end-names.ts +140 -0
  797. package/src/detectors/ordinal-run-gaps.ts +101 -0
  798. package/src/detectors/orthographic-variant.ts +39 -14
  799. package/src/detectors/orthography.ts +6 -1
  800. package/src/detectors/parameter-table.ts +17 -0
  801. package/src/detectors/phone-number-variant.ts +18 -0
  802. package/src/detectors/prerequisite-order.ts +35 -0
  803. package/src/detectors/quote-unnamed-speaker.ts +19 -0
  804. package/src/detectors/quote-without-source.ts +57 -10
  805. package/src/detectors/registry/amount-range.ts +4 -0
  806. package/src/detectors/registry/amount-scale.ts +4 -0
  807. package/src/detectors/registry/arrival-before-departure.ts +4 -0
  808. package/src/detectors/registry/date-outside-period.ts +4 -0
  809. package/src/detectors/registry/default-values.ts +4 -0
  810. package/src/detectors/registry/deprecated-use.ts +4 -0
  811. package/src/detectors/registry/due-date.ts +4 -0
  812. package/src/detectors/registry/kana-function-word.ts +4 -0
  813. package/src/detectors/registry/line-amount.ts +4 -0
  814. package/src/detectors/registry/nado-closed-list.ts +4 -0
  815. package/src/detectors/registry/number-word-figure.ts +4 -0
  816. package/src/detectors/registry/obligation-without-deadline.ts +4 -0
  817. package/src/detectors/registry/parameter-table.ts +4 -0
  818. package/src/detectors/registry/phone-number-variant.ts +4 -0
  819. package/src/detectors/registry/prerequisite-order.ts +4 -0
  820. package/src/detectors/registry/quote-unnamed-speaker.ts +4 -0
  821. package/src/detectors/registry/tax-amount.ts +4 -0
  822. package/src/detectors/registry/time-order.ts +4 -0
  823. package/src/detectors/registry/ui-label.ts +4 -0
  824. package/src/detectors/registry/undefined-call.ts +4 -0
  825. package/src/detectors/registry/undefined-term.ts +4 -0
  826. package/src/detectors/registry/version-order.ts +4 -0
  827. package/src/detectors/registry/warning-action.ts +4 -0
  828. package/src/detectors/requirement-smell.ts +29 -9
  829. package/src/detectors/structure-tree.ts +43 -21
  830. package/src/detectors/superlative-scope.ts +13 -1
  831. package/src/detectors/tax-amount.ts +25 -0
  832. package/src/detectors/technical-docs.ts +7 -1
  833. package/src/detectors/term-extension.ts +67 -0
  834. package/src/detectors/time-order.ts +49 -0
  835. package/src/detectors/ui-label.ts +17 -0
  836. package/src/detectors/unbalanced-bracket.ts +7 -14
  837. package/src/detectors/undefined-call.ts +19 -0
  838. package/src/detectors/undefined-term.ts +103 -0
  839. package/src/detectors/unknown-word.ts +3 -3
  840. package/src/detectors/vague-deadline.ts +3 -3
  841. package/src/detectors/version-mismatch.ts +26 -5
  842. package/src/detectors/version-order.ts +50 -0
  843. package/src/detectors/warning-action.ts +49 -0
  844. package/src/facts/condition-pairs.ts +289 -0
  845. package/src/facts/counted-facts.ts +59 -0
  846. package/src/facts/event-dates.ts +63 -0
  847. package/src/facts/fact-scope.ts +6 -0
  848. package/src/facts/labelled-facts.ts +13 -1
  849. package/src/facts/table-facts.ts +3 -3
  850. package/src/grade/ai-score.ts +1 -1
  851. package/src/grade/text.ts +2 -2
  852. package/src/heading-numbering.ts +2 -2
  853. package/src/html/fetch-page.ts +64 -0
  854. package/src/html/fetched-text.ts +32 -0
  855. package/src/html/html-content-block.ts +107 -0
  856. package/src/html/html-elements.ts +127 -0
  857. package/src/html/html-footnote-marks.ts +20 -0
  858. package/src/html/html-heading-links.ts +93 -0
  859. package/src/html/html-lost-tags.ts +14 -0
  860. package/src/html/html-markdown.ts +481 -0
  861. package/src/html/html-preformatted.ts +110 -0
  862. package/src/html/html-reader-only.ts +82 -0
  863. package/src/html/html-run-in-headings.ts +43 -0
  864. package/src/html/html-tables.ts +76 -0
  865. package/src/html/html-widgets.ts +114 -0
  866. package/src/html/markup-text.ts +35 -0
  867. package/src/html/page-document.ts +22 -0
  868. package/src/inline-count.ts +146 -0
  869. package/src/kana-spelling.ts +7 -0
  870. package/src/location-part.ts +30 -0
  871. package/src/nado-closed-list.ts +106 -0
  872. package/src/name-cue.ts +35 -0
  873. package/src/name-variants.ts +152 -11
  874. package/src/paragraph-runs.ts +12 -2
  875. package/src/parameter-table.ts +208 -0
  876. package/src/phone-numbers.ts +98 -0
  877. package/src/place-names.ts +248 -0
  878. package/src/plugin.ts +4 -0
  879. package/src/prerequisite-order.ts +39 -0
  880. package/src/profile/parse.ts +10 -1
  881. package/src/reasons.ts +4 -0
  882. package/src/render/rules-json.ts +4 -0
  883. package/src/render/rules-table.ts +6 -3
  884. package/src/rule-genres.ts +5 -2
  885. package/src/rule-load.ts +3 -2
  886. package/src/run.ts +3 -1
  887. package/src/spelling.ts +8 -0
  888. package/src/structure/action-due.ts +179 -0
  889. package/src/structure/amount-range.ts +219 -0
  890. package/src/structure/amount-scale.ts +115 -0
  891. package/src/structure/cite.ts +21 -2
  892. package/src/structure/counted-amounts.ts +42 -0
  893. package/src/structure/date-order.ts +72 -22
  894. package/src/structure/date-outside-period.ts +127 -0
  895. package/src/structure/definition-use.ts +24 -3
  896. package/src/structure/due-date.ts +46 -0
  897. package/src/structure/heading-runs.ts +24 -0
  898. package/src/structure/install-pin.ts +115 -0
  899. package/src/structure/leg-times.ts +198 -0
  900. package/src/structure/line-amount-unit.ts +35 -0
  901. package/src/structure/line-amount.ts +162 -0
  902. package/src/structure/number-word-figure.ts +199 -0
  903. package/src/structure/numbering.ts +3 -0
  904. package/src/structure/ordinal-runs.ts +107 -0
  905. package/src/structure/percent-sum-prose.ts +46 -3
  906. package/src/structure/percent-sum.ts +16 -2
  907. package/src/structure/release-list.ts +69 -0
  908. package/src/structure/share-column.ts +25 -0
  909. package/src/structure/stated-period.ts +161 -0
  910. package/src/structure/subject-change.ts +35 -0
  911. package/src/structure/tax.ts +114 -0
  912. package/src/structure/time-marks.ts +127 -0
  913. package/src/structure/time-order.ts +140 -0
  914. package/src/structure/title-lines.ts +33 -0
  915. package/src/structure/total.ts +5 -1
  916. package/src/structure/version-mismatch.ts +67 -13
  917. package/src/structure/version-order.ts +84 -0
  918. package/src/table-text.ts +39 -0
  919. package/src/ui-labels.ts +55 -0
  920. package/src/undefined-call.ts +65 -0
  921. package/src/unnamed-speaker.ts +224 -0
  922. package/src/warning-action.ts +73 -0
  923. package/styles/koyobun.yaml +7 -4
@@ -0,0 +1,85 @@
1
+ id: version-order
2
+ layer: L1
3
+ status: stable
4
+ how_to_find: version-order
5
+ requires: [markdown]
6
+ severity: warning
7
+
8
+ name:
9
+ ja: 版の並びが前後している
10
+ en: A version out of order in a changelog
11
+
12
+ why:
13
+ ja: 変更履歴は新しい版から順に(または古い版から順に)並べるのが決まりです。一つだけ並びから外れた版があると、読み手はどれが最新か、どの変更がどの版に入ったかを取り違えます。版を書き間違えたときや、項目を違う場所に足したときに起きます。見出しや箇条書き、表の行の先頭に書いた版(3.2.0、v3.2.0、[3.2.0])を並びとして読み、並びの向きは多いほうで決めて、その向きの最も長い並びに入らない版を指します。
14
+ en: A changelog lists its versions newest first (or oldest first). One version out of that order makes the reader mistake which release is the latest, or which change went into which release. It happens when a version is mistyped or an entry is added in the wrong place. The versions at the start of headings, list items or table rows (3.2.0, v3.2.0, [3.2.0]) are read as a sequence; its direction is taken from most of its steps, and a version that fits in no longest run along that direction is pointed out.
15
+
16
+ message:
17
+ ja: 「{version}」が、前後の版の並びから外れています(前は「{previous}」)
18
+ en: "{version} breaks the order of the versions around it (after {previous})"
19
+
20
+ how_to_fix:
21
+ ja: 版の番号を確かめて、書き間違いなら直し、置き場所が違うなら正しい位置へ移してください。
22
+ en: Check the version number. Correct it if it is a typo, or move the entry to where it belongs.
23
+
24
+ levels: { strict: error, normal: warning, relaxed: info }
25
+
26
+ use_for: [technical, docs, blog, legal, academic, literature, speech]
27
+ off_for:
28
+ legal: "Changelogs and release lists belong to technical writing."
29
+ academic: "Changelogs and release lists belong to technical writing."
30
+ literature: "Changelogs and release lists belong to technical writing."
31
+ speech: "Changelogs and release lists belong to technical writing."
32
+
33
+ group: facts
34
+ summary:
35
+ ja: 変更履歴の見出しや版の一覧で、一つだけ順番から外れた版
36
+ en: One version out of order in a changelog or a list of releases
37
+ example:
38
+ ja:
39
+ config: { genre: technical/readme }
40
+ before: |
41
+ # 変更履歴
42
+
43
+ ## 3.2.0 - 2026-09-14
44
+
45
+ ## 3.1.1 - 2026-07-08
46
+
47
+ ## 3.3.0 - 2026-06-02
48
+
49
+ ## 3.0.0 - 2026-03-20
50
+ after: |
51
+ # 変更履歴
52
+
53
+ ## 3.2.0 - 2026-09-14
54
+
55
+ ## 3.1.1 - 2026-07-08
56
+
57
+ ## 3.1.0 - 2026-06-02
58
+
59
+ ## 3.0.0 - 2026-03-20
60
+ en:
61
+ config: { genre: technical/readme }
62
+ before: |
63
+ # Changelog
64
+
65
+ ## 3.2.0 - 2026-09-14
66
+
67
+ ## 3.1.1 - 2026-07-08
68
+
69
+ ## 3.3.0 - 2026-06-02
70
+
71
+ ## 3.0.0 - 2026-03-20
72
+ after: |
73
+ # Changelog
74
+
75
+ ## 3.2.0 - 2026-09-14
76
+
77
+ ## 3.1.1 - 2026-07-08
78
+
79
+ ## 3.1.0 - 2026-06-02
80
+
81
+ ## 3.0.0 - 2026-03-20
82
+
83
+ not_flagged:
84
+ ja: 並べた版が三つ未満のもの、上がりと下がりが同じ数で向きが決まらないもの、向きに沿う版が半分以下の一覧(名前順の一覧)、同じ版の繰り返し、文の中の版、コードブロックの中の例、点で三つに区切っていない番号(3.1、22.04)は見ません。末尾が 0 の版(3.1.0)が無く上がっていく並び(1.2.1、1.2.2)は節の番号として numbering-gap が見ます。見出しは同じ深さどうし、箇条書きと表は続いた行どうしを比べます。
85
+ en: "Fewer than three versions, a sequence with as many steps up as down, a list where no more than half of the versions follow one direction (sorted by name), a repeated version, versions in running text, examples in a code block, and numbers not in three dotted parts (3.1, 22.04) are not checked. A sequence that goes up with no version ending in zero (1.2.1, 1.2.2) is read as section numbers, which numbering-gap checks. Headings are compared with headings of the same depth, and list items and table rows with the lines they run on from."
@@ -3,26 +3,26 @@ layer: L2
3
3
  status: stable
4
4
  how_to_find: intensified-adjective
5
5
  word_list: very-intensifier
6
- extra_word_lists: [very-exception]
6
+ extra_word_lists: [very-exception, very-copula]
7
7
  requires: [pos]
8
- languages: [en]
8
+ languages: [ja, en]
9
9
  severity: info
10
10
 
11
11
  name:
12
- ja: 「very + 形容詞」の多用
12
+ ja: 「とても + 形容詞」(very + 形容詞)の多用
13
13
  en: Too many "very" + adjective
14
14
 
15
15
  why:
16
- ja: 英語の「very important」「very good」は、強い一語(critical、excellent)か、何がどうなのかを言えば要らない語です。一つ二つなら普通ですが、文書の長さのわりに多いと、どの「very」も効かなくなります。「the very first」「very few」のように意味の決まった言い方は語彙表で除いています。
17
- en: '"Very important" and "very good" lean on "very" where a stronger word (critical, excellent), or saying what and how much, would do. One or two are ordinary; many for the length make every "very" weightless. Set phrases such as "the very first" and "very few" are excepted in the lexicon.'
16
+ ja: 「とても便利」「非常に危険」(英語の very important、very good)の強めは、何がどう便利なのか、どの程度危険なのかを書けば要らない語です。一つ二つなら普通ですが、文書の長さのわりに多いと、どの強めも効かなくなります。強めの語と、数えない言い方(the very first、very few)は言語ごとの語彙表にあります。
17
+ en: '"Very important" and "very good" (とても便利, 非常に危険) lean on "very" where a stronger word (critical, excellent), or saying what and how much, would do. One or two are ordinary; many for the length make every "very" weightless. The intensifiers, and set phrases not counted such as "the very first" and "very few", are listed in the lexicon.'
18
18
 
19
19
  message:
20
- ja: 「{matched}」など、very + 形容詞が 1000 語あたり {density} 個あります({limit} 個まで)
20
+ ja: 「{matched}」など、強め + 形容詞が 1000 字あたり {density} 個あります({limit} 個まで)
21
21
  en: '"{matched}" and other "very" + adjective: {density} per 1000 words (limit {limit})'
22
22
 
23
23
  how_to_fix:
24
- ja: 強い一語に替えるか、何がどの程度なのかを書いてください(very important → critical、very fast → under a second)。
25
- en: Use a stronger word, or say what and how much ("very important" → "critical", "very fast" → "under a second").
24
+ ja: 強めを外して、何がどの程度なのかを書いてください(とても速い → 1 秒以内に開く、very important → critical)。
25
+ en: Use a stronger word, or say what and how much ("very important" → "critical", "very fast" → "under a second"; とても速い → 1 秒以内に開く).
26
26
 
27
27
  levels: { strict: 1, normal: 2, relaxed: 4 }
28
28
 
@@ -33,9 +33,15 @@ off_for:
33
33
 
34
34
  group: wording
35
35
  summary:
36
- ja: 英語で、「very important」「very good」のような very + 形容詞が、文書の長さのわりに多い所
37
- en: '"Very" + adjective, such as "very important", dense for the document''s length'
36
+ ja: 「とても便利」「非常に危険」(very important)のような強め + 形容詞が、文書の長さのわりに多い所
37
+ en: '"Very" + adjective, such as "very important" (とても便利), dense for the document''s length'
38
38
  example:
39
+ ja:
40
+ pad: true
41
+ before: |
42
+ 新しい画面はとても便利です。読み込みもすごく速いです。ただ、設定は非常に複雑です。
43
+ after: |
44
+ 新しい画面では、よく使う三つの操作が一か所にまとまりました。読み込みは 1 秒以内です。ただ、設定の項目は 40 あります。
39
45
  en:
40
46
  pad: true
41
47
  before: |
@@ -44,13 +50,25 @@ example:
44
50
  The launch was critical. The team was stretched, and the plan held.
45
51
 
46
52
  not_flagged:
47
- ja: 「very」の後ろが形容詞のときだけ数えます(very well は数えない)。「the very first」「very few」「very much」は数えません。短い文書は密度を測りません。小説と話し言葉では既定で止めています(会話の言葉のため)。
48
- en: Only "very" before an adjective ("very well" is not counted), and not "the very first", "very few" or "very much". Short documents are not measured. The fiction and speech presets turn it off, since dialogue speaks that way.
53
+ ja: 強めの後ろが形容詞のときだけ数えます(very well、とても助かる は数えない)。日本語の「便利」「静か」のような語は、後ろに「な」「で」「だ」「です」が続くときだけ形容詞と見ます。「the very first」「very few」「very much」と、empty-intensifier が見る「とても重要」は数えません。「大変」は決まった挨拶(大変お世話になりました)に使うので数えません。短い文書は密度を測りません。小説と話し言葉では既定で止めています(会話の言葉のため)。
54
+ en: Only "very" before an adjective ("very well" is not counted), and not "the very first", "very few" or "very much". In Japanese, a word such as 便利 counts as an adjective only before な, で, だ or です; とても重要 is left to empty-intensifier, and 大変, used in set courtesies (大変お世話になりました), is not counted. Short documents are not measured. The fiction and speech presets turn it off, since dialogue speaks that way.
49
55
  level_meaning:
50
- ja: very + 形容詞が 1000 語あたり {limit} 個まで
56
+ ja: 強め + 形容詞が 1000 字あたり {limit} 個まで
51
57
  en: up to {limit} "very" + adjective per 1000 words
52
58
  rewrite:
53
59
  depth: light
60
+ ja:
61
+ direction: 強め(とても、すごく、非常に)を外し、本文や出典が言う具体(数、何がどうなのか)に置き換えてください。本文が何も言っていなければ、強めを外した形容詞だけにします。
62
+ pairs:
63
+ - before: 新しい画面はとても便利です。
64
+ after: 新しい画面では、よく使う三つの操作が一か所にまとまりました。
65
+ - before: 読み込みがすごく速いです。
66
+ after: 読み込みは 1 秒以内です。
67
+ keep:
68
+ - 各文の主張
69
+ avoid:
70
+ - 強めを別の強め(本当に、極めて)に替えるだけ
71
+ - 本文に無い数を作る
54
72
  en:
55
73
  direction: Replace "very" + adjective with a stronger single word, or with what the text says about how much. If the text says nothing more, a plain adjective without "very" will do.
56
74
  pairs:
@@ -0,0 +1,64 @@
1
+ id: warning-without-action
2
+ layer: L3
3
+ status: stable
4
+ how_to_find: warning-action
5
+ # The labels and the words of an action come from the language's warning-label and warning-action lexicons; an English
6
+ # sentence that opens with its verb is read from the parts of speech when they are available.
7
+ uses: [pos]
8
+ languages: [ja, en]
9
+ severity: info
10
+
11
+ name:
12
+ ja: することの書かれていない注意書き
13
+ en: Warning that gives no action
14
+
15
+ why:
16
+ ja: 「注意:復元すると、今のデータベースは置き換わります。」のように危険だけを書いた注意書きは、読み手を不安にするだけで、何をすれば防げるのかを教えません。手順書の注意書きは、何が起きるかと、それを防ぐために読み手がすること(先に書き出す、電源を切らない)を一緒に書くものです。「注意」「警告」「危険」で始まる段落の、どの文にも「〜してください」「〜しないこと」のような読み手のすることが無いとき指します。
17
+ en: 'A warning that only names a risk ("Warning: the restore replaces the current database.") alarms the reader without saying how to avoid it. A warning in a manual says what happens and what the reader does to prevent it (export first, do not unplug the drive). A paragraph that opens with Warning, Caution or Danger is reported when none of its sentences tells the reader what to do: no "do not", "make sure", "must" and no sentence that opens with its verb ("Export today''s orders first").'
18
+
19
+ message:
20
+ ja: この注意書きは危険を述べるだけで、読み手がすることを書いていません
21
+ en: This warning names a risk but not what the reader should do
22
+
23
+ how_to_fix:
24
+ ja: 危険を避けるために読み手がすることを、同じ段落に書き足してください(「先に〜を書き出してください」「〜の間は電源を切らないでください」)。
25
+ en: Add what the reader does to avoid the risk to the same paragraph ("Export today's orders first", "Do not unplug the drive while it runs").
26
+
27
+ levels: { strict: warning, normal: info, relaxed: info }
28
+
29
+ use_for: [technical, docs, blog, legal, academic, literature, speech]
30
+ off_for:
31
+ legal: "Warnings with an action to take are a convention of manuals and technical writing."
32
+ academic: "Warnings with an action to take are a convention of manuals and technical writing."
33
+ literature: "Warnings with an action to take are a convention of manuals and technical writing."
34
+ speech: "Warnings with an action to take are a convention of manuals and technical writing."
35
+
36
+ group: wording
37
+ summary:
38
+ ja: 「注意」「警告」で始まる段落で、危険だけを書き、読み手のすること(〜してください、〜しないこと)が無いもの
39
+ en: A paragraph opening with Warning or Caution that names a risk and no action for the reader
40
+ example:
41
+ ja:
42
+ config: { genre: docs/manual }
43
+ before: |
44
+ # バックアップを復元する
45
+
46
+ 注意:復元すると、今のデータベースは置き換わります。
47
+ after: |
48
+ # バックアップを復元する
49
+
50
+ 注意:復元すると、今のデータベースは置き換わります。先に、今日の注文を書き出してください。
51
+ en:
52
+ config: { genre: docs/manual }
53
+ before: |
54
+ # Restoring a backup
55
+
56
+ Warning: the restore replaces the current database.
57
+ after: |
58
+ # Restoring a backup
59
+
60
+ Warning: the restore replaces the current database. Export today's orders first.
61
+
62
+ not_flagged:
63
+ ja: 「注意」「警告」「危険」をそれだけで頭に置いた段落(「注意:」「**警告**」「> [!WARNING]」)だけを読みます。GitHub の注意(> [!WARNING])は引用の終わりまでを一つの注意書きとして読みます。箇条書きの項目の中の注意書き、「メモ」「ヒント」「重要」の段落、「注意深く」のように語の一部になったもの、どれかの文が読み手のすること(〜してください、〜しないこと、〜する必要があります)で終わる注意書きは指しません。技術文書・手順書・ブログでだけ動きます。
64
+ en: 'Only paragraphs opening with Warning, Caution or Danger standing alone ("Warning:", "**Caution**", "> [!WARNING]") are read. A GitHub alert (> [!WARNING]) is read to the end of its block quote. Warnings inside list items, notes, tips and "Important" paragraphs, words that merely start with the label ("Warnings are logged"), and warnings with any sentence that gives an action (do not, make sure, must, or a sentence opening with its verb) are not reported. Technical documents, manuals and blogs only.'
@@ -4,7 +4,7 @@ status: stable
4
4
  how_to_find: phrase-match
5
5
  word_list: wordy-phrase
6
6
  requires: [pos]
7
- languages: [en]
7
+ languages: [ja, en]
8
8
  severity: info
9
9
 
10
10
  name:
@@ -12,16 +12,16 @@ name:
12
12
  en: Wordy phrase
13
13
 
14
14
  why:
15
- ja: 英語の「in order to」「due to the fact that」「at this point in time」は、「to」「because」「now」と同じことを何語もかけて言います。読み手は語を多く読むだけで、得るものは増えません。言い回しと短い形の組は言語ごとの語彙表にあります。契約や法令がわざと使う言い方(with regard to、prior to)は入れていません。
16
- en: '"In order to", "due to the fact that" and "at this point in time" say in several words what "to", "because" and "now" say in one. The reader reads more and learns nothing more. The phrases and their short forms are listed in the lexicon. Phrases that contracts and statutes use on purpose ("with regard to", "prior to") are left out.'
15
+ ja: 「することが可能」「現時点において」(英語の in order to、at this point in time)は、「できる」「現在」と同じことを何語もかけて言います。読み手は語を多く読むだけで、得るものは増えません。言い回しと短い形の組は言語ごとの語彙表にあります。契約や法令がわざと使う言い方(with regard to、prior to)は入れていません。
16
+ en: '"In order to", "due to the fact that" and "at this point in time" (することが可能, 現時点において) say in several words what "to", "because" and "now" say in one. The reader reads more and learns nothing more. The phrases and their short forms are listed in the lexicon. Phrases that contracts and statutes use on purpose ("with regard to", "prior to") are left out.'
17
17
 
18
18
  message:
19
19
  ja: 「{matched}」は、もっと短く言えます
20
20
  en: '"{matched}" can be said in fewer words'
21
21
 
22
22
  how_to_fix:
23
- ja: 短い形に置き換えてください(in order to → to、due to the fact that → because、in the event that → if)。
24
- en: Use the short form ("in order to" → "to", "due to the fact that" → "because", "in the event that" → "if").
23
+ ja: 短い形に置き換えてください(することが可能です → できます、現時点において → 現在、in order to → to、due to the fact that → because)。
24
+ en: Use the short form ("in order to" → "to", "due to the fact that" → "because", "in the event that" → "if"; することが可能です → できます).
25
25
 
26
26
  # 指摘に要る文の数。1 つなら書き手の癖とは言えないので、2 つから。
27
27
  levels: { strict: 1, normal: 2, relaxed: 4 }
@@ -34,9 +34,14 @@ off_for:
34
34
 
35
35
  group: wording
36
36
  summary:
37
- ja: 英語で、「in order to」「due to the fact that」のように、一語で言えることを何語もかけて言う所
38
- en: Phrases such as "in order to" and "due to the fact that" that take several words to say what one says
37
+ ja: 「することが可能」「現時点において」(in order to、due to the fact that)のように、一語で言えることを何語もかけて言う所
38
+ en: Phrases such as "in order to" and "due to the fact that" (することが可能, 現時点において) that take several words to say what one says
39
39
  example:
40
+ ja:
41
+ before: |
42
+ 資料は社内から閲覧することが可能です。現時点において、追加の予定はありません。
43
+ after: |
44
+ 資料は社内から閲覧できます。現在、追加の予定はありません。
40
45
  en:
41
46
  before: |
42
47
  In order to save time, we met online. Due to the fact that the room was booked, we stayed home.
@@ -44,13 +49,26 @@ example:
44
49
  To save time, we met online. Because the room was booked, we stayed home.
45
50
 
46
51
  not_flagged:
47
- ja: 一覧にある言い回しだけを見ます。英語の文書だけで動きます。契約や法令がわざと使う言い方(with regard to、prior to、in accordance with)は一覧に入れていません。
48
- en: Only the phrases on chaff's list are checked, and only in English documents. Phrases that contracts and statutes use on purpose ("with regard to", "prior to", "in accordance with") are not on it.
52
+ ja: 一覧にある言い回しだけを見ます。契約や法令がわざと使う言い方(with regard to、prior to、in accordance with)は一覧に入れていません。日本語では、人の書いた文章でもふつうの「することができる」と、名詞として要る「必要性」は入れていません。翻訳調(を可能にする)は translationese-density が、「〜を行う」は nominalization が見ます。
53
+ en: Only the phrases on chaff's list are checked. Phrases that contracts and statutes use on purpose ("with regard to", "prior to", "in accordance with") are not on it. In Japanese, することができる, ordinary in human writing, and 必要性, which a noun phrase may need, are left out; translationese (を可能にする) is translationese-density's and 〜を行う is nominalization's.
49
54
  level_meaning:
50
55
  ja: 回りくどい言い回しを含む文が {limit} 文あれば指摘
51
56
  en: reported once {limit} sentences hold one
52
57
  rewrite:
53
58
  depth: light
59
+ ja:
60
+ direction: 回りくどい言い回しを、語彙表の短い形に置き換えてください。文のほかの所は変えません。
61
+ pairs:
62
+ - before: 資料は社内から閲覧することが可能です。
63
+ after: 資料は社内から閲覧できます。
64
+ - before: 現時点において、追加の予定はありません。
65
+ after: 現在、追加の予定はありません。
66
+ - before: 今回の結果は成功であると言えます。
67
+ after: 今回の結果は成功です。
68
+ keep:
69
+ - 文のほかの所と、文が言っていること
70
+ avoid:
71
+ - 言い回しを縮めるついでに、文のほかの所を書き換える
54
72
  en:
55
73
  direction: Replace the wordy phrase with its short form from the lexicon. Leave the rest of the sentence alone.
56
74
  pairs:
@@ -7,7 +7,7 @@ import { MIN_DOCUMENT_LENGTH } from "../detectors/signals.ts";
7
7
  import { structureOf } from "../structure-shape/of-document.ts";
8
8
  import { HUMAN_SHARES } from "./human-shares.ts";
9
9
  import { aiScoreOf, type AiScore, type SignalRun } from "./score.ts";
10
- import { measuredLevelsOf, scoredSignalIds } from "./signals.ts";
10
+ import { compositeSignalIds, measuredLevelsOf, scoredSignalIds } from "./signals.ts";
11
11
 
12
12
  const STRUCTURE_RULE = "ai-structure";
13
13
 
@@ -20,27 +20,37 @@ const structureApplies = (rules: readonly RuleDefinition[], genre: string): bool
20
20
  return rule !== undefined && standingIn(rule, genre, presetLevels(genre)).kind === "on";
21
21
  };
22
22
 
23
- /** The AI-shape rules run on the document at the levels the human shares were measured at, whatever chaff.yaml sets. */
24
- const signalRuns = (doc: ProseDocument, rules: readonly RuleDefinition[], genre: string): SignalRun[] => {
23
+ type SignalResult = { readonly runs: SignalRun[]; readonly compositeFired: string[] };
24
+
25
+ /**
26
+ * The AI-shape rules run on the document at the levels the human shares were measured at, whatever chaff.yaml sets,
27
+ * with ai-structure beside them: it is not counted as a signal, but it is one of the composite's.
28
+ */
29
+ const signalRuns = (doc: ProseDocument, rules: readonly RuleDefinition[], genre: string): SignalResult => {
25
30
  const ofLanguage = rules.filter((rule) => rule.languages === undefined || rule.languages.includes(doc.language));
26
31
  const ids = scoredSignalIds(ofLanguage);
27
- const signalRules = ofLanguage.filter((rule) => ids.includes(rule.id));
28
- const result = runRulesWith(doc, signalRules, { settings: measuredLevelsOf(signalRules, presetLevels(genre)), experimental: true, genre });
29
- return ids.map((rule) => {
32
+ const runRules = ofLanguage.filter((rule) => ids.includes(rule.id) || rule.id === STRUCTURE_RULE);
33
+ const result = runRulesWith(doc, runRules, { settings: measuredLevelsOf(runRules, presetLevels(genre)), experimental: true, genre });
34
+ const fired = (rule: string): boolean => result.findings.some((finding) => finding.rule === rule);
35
+ const runs = ids.map((rule) => {
30
36
  const notRun = result.skipped.find((skip) => skip.rule === rule)?.why;
31
37
  const count = result.findings.filter((finding) => finding.rule === rule).length;
32
38
  return notRun === undefined ? { rule, count } : { rule, count, notRun };
33
39
  });
40
+ return { runs, compositeFired: compositeSignalIds(ofLanguage).filter(fired) };
34
41
  };
35
42
 
36
43
  /** The quick score of a document read as lint reads it, against human documents of its genre group. */
37
- export const aiScoreOfDocument = (doc: ProseDocument, rules: readonly RuleDefinition[], genre: string): AiScore =>
38
- aiScoreOf({
44
+ export const aiScoreOfDocument = (doc: ProseDocument, rules: readonly RuleDefinition[], genre: string): AiScore => {
45
+ const { runs, compositeFired } = signalRuns(doc, rules, genre);
46
+ return aiScoreOf({
39
47
  group: genreGroupOf(genre),
40
48
  length: wordsOf(doc),
41
49
  minimum: MIN_DOCUMENT_LENGTH[doc.lengthUnit],
42
50
  unit: doc.lengthUnit,
43
- signals: signalRuns(doc, rules, genre),
51
+ signals: runs,
44
52
  shares: HUMAN_SHARES,
45
53
  structure: structureApplies(rules, genre) ? structureOf(doc) : undefined,
54
+ compositeFired,
46
55
  });
56
+ };
@@ -1,7 +1,17 @@
1
1
  import type { LengthUnit, Localized } from "../plugin.ts";
2
2
  import { localized } from "../render/text.ts";
3
3
  import type { StructureText } from "../outline/structure-text.ts";
4
- import { HIGH_SIGNS, MEDIUM_SIGNS, shownSignsOf, type AiScore, type NotScored, type SignalPlace, type StructurePlace } from "./score.ts";
4
+ import {
5
+ HIGH_SIGNS,
6
+ MEDIUM_SIGNS,
7
+ shownSignsOf,
8
+ TOGETHER_SIGNALS,
9
+ type AiScore,
10
+ type NotScored,
11
+ type SignalPlace,
12
+ type StructurePlace,
13
+ type Together,
14
+ } from "./score.ts";
5
15
  import type { AiScoreText } from "./text.ts";
6
16
 
7
17
  /** What a rendering needs besides the score: the texts, the rules' names, and the genre group's name, in one language. */
@@ -46,7 +56,15 @@ const signalLine = (signal: SignalPlace, view: ScoreView): string => {
46
56
  const namesLine = (names: readonly string[], line: (names: string) => string, view: ScoreView): string[] =>
47
57
  names.length === 0 ? [] : [` ${line(names.join(view.text.listSeparator))}`];
48
58
 
49
- const signalLines = (signals: readonly SignalPlace[], view: ScoreView): string[] => {
59
+ const COMPOSITE = "ai-generated-composite";
60
+
61
+ const togetherLines = (together: Together, view: ScoreView): string[] => {
62
+ if (!together.counted) return [];
63
+ const names = together.fired.map((rule) => nameOf(rule, view)).join(view.text.listSeparator);
64
+ return [` ${view.text.together(nameOf(COMPOSITE, view), names, together.fired.length, TOGETHER_SIGNALS)}`];
65
+ };
66
+
67
+ const signalLines = (signals: readonly SignalPlace[], together: Together, view: ScoreView): string[] => {
50
68
  const compared = signals.filter((signal) => signal.human !== undefined);
51
69
  const shown = compared.filter((signal) => signal.count > 0);
52
70
  const quiet = compared.length - shown.length;
@@ -55,6 +73,7 @@ const signalLines = (signals: readonly SignalPlace[], view: ScoreView): string[]
55
73
  return [
56
74
  view.text.signalsHeading,
57
75
  ...shown.map((signal) => ` ${signalLine(signal, view)}`),
76
+ ...togetherLines(together, view),
58
77
  ...(quiet > 0 ? [` ${view.text.quiet(quiet)}`] : []),
59
78
  ...namesLine(unshared, view.text.noHumanShare, view),
60
79
  ...namesLine(notRun, view.text.notRun, view),
@@ -85,7 +104,7 @@ export const renderAiScoreFriendly = (path: string, score: AiScore, view: ScoreV
85
104
  ` ${view.text.signs(score.signs, score.compared, MEDIUM_SIGNS, HIGH_SIGNS)}`,
86
105
  ` ${view.text.disclaimer}`,
87
106
  "",
88
- ...signalLines(score.signals, view),
107
+ ...signalLines(score.signals, score.together, view),
89
108
  "",
90
109
  ...structureBlock(score, view),
91
110
  ];
@@ -104,7 +123,7 @@ export const aiScoreJson = (score: AiScore): Readonly<Record<string, unknown>> =
104
123
  group: score.group,
105
124
  signs: score.signs,
106
125
  compared: score.compared,
107
- thresholds: { medium: MEDIUM_SIGNS, high: HIGH_SIGNS },
126
+ thresholds: { medium: MEDIUM_SIGNS, high: HIGH_SIGNS, together: TOGETHER_SIGNALS },
108
127
  signals: score.signals.map((signal) => ({
109
128
  rule: signal.rule,
110
129
  count: signal.count,
@@ -121,4 +140,5 @@ export const aiScoreJson = (score: AiScore): Readonly<Record<string, unknown>> =
121
140
  beyond: place.beyond,
122
141
  sameAs: place.sameAs ?? null,
123
142
  })) ?? null,
143
+ together: { fired: score.together.fired, counted: score.together.counted },
124
144
  });
@@ -27,6 +27,12 @@ export const MIN_BASELINE_DOCUMENTS = Math.ceil(1 / RARE_SHARE);
27
27
  export const MEDIUM_SIGNS = 3;
28
28
  export const HIGH_SIGNS = 5;
29
29
 
30
+ /**
31
+ * In the composite's own signals: ai-generated-composite's strict level, held to it by test_ai_score.ts. That many of
32
+ * them firing in one document is one more sign: `yarn ai-score:corpus --all` shows how many human documents reach it.
33
+ */
34
+ export const TOGETHER_SIGNALS = 2;
35
+
30
36
  export type AiLevel = "low" | "medium" | "high";
31
37
 
32
38
  /** One AI-shape rule's run on the document: how many findings it made, or why it did not run. */
@@ -43,6 +49,9 @@ export type SignalPlace = SignalRun & {
43
49
  /** One structure measure against human articles. sameAs: the rule that reads the same shape, when that rule already counts it. */
44
50
  export type StructurePlace = Placement & { readonly sameAs: string | undefined };
45
51
 
52
+ /** The composite's signals that fired in the document, and whether enough fired together to count as one more sign. */
53
+ export type Together = { readonly fired: readonly string[]; readonly counted: boolean };
54
+
46
55
  export type NotScored =
47
56
  | { readonly reason: "too-short"; readonly length: number; readonly minimum: number; readonly unit: LengthUnit }
48
57
  | { readonly reason: "no-baseline"; readonly compared: number; readonly needed: number };
@@ -59,6 +68,7 @@ export type AiScore = {
59
68
  readonly signals: readonly SignalPlace[];
60
69
  /** The structure measures against human articles, or undefined where they are not compared for the genre. */
61
70
  readonly structure: readonly StructurePlace[] | undefined;
71
+ readonly together: Together;
62
72
  };
63
73
 
64
74
  /** What the score is computed from. structure: undefined where the structure baseline does not apply to the genre. */
@@ -70,6 +80,8 @@ export type ScoreInput = {
70
80
  readonly signals: readonly SignalRun[];
71
81
  readonly shares: HumanShares;
72
82
  readonly structure: StructureScore | undefined;
83
+ /** The ids of ai-generated-composite's signals that fired, at the levels the human shares were measured at. */
84
+ readonly compositeFired: readonly string[];
73
85
  };
74
86
 
75
87
  export const levelOf = (signs: number): AiLevel => {
@@ -106,16 +118,25 @@ export const aiScoreOf = (input: ScoreInput): AiScore => {
106
118
  const signals = input.signals.map((run) => placeSignal(run, input.shares, input.group));
107
119
  const placements = input.structure?.placements.map((placement) => placeStructure(placement, signals));
108
120
  const measures = placements ?? [];
109
- const signs = signals.filter((signal) => signal.unusual).length + measures.filter((place) => place.beyond && place.sameAs === undefined).length;
121
+ const together = { fired: input.compositeFired, counted: input.compositeFired.length >= TOGETHER_SIGNALS };
122
+ const signs =
123
+ signals.filter((signal) => signal.unusual).length +
124
+ measures.filter((place) => place.beyond && place.sameAs === undefined).length +
125
+ (together.counted ? 1 : 0);
110
126
  const compared =
111
127
  signals.filter((signal) => signal.human !== undefined).length +
112
128
  measures.filter((place) => place.pastShare !== undefined && !comparedTwice(place, signals)).length;
113
129
  const notScored = notScoredOf(input, compared);
114
- return { group: input.group, level: notScored === undefined ? levelOf(signs) : undefined, notScored, signs, compared, signals, structure: placements };
130
+ const level = notScored === undefined ? levelOf(signs) : undefined;
131
+ return { group: input.group, level, notScored, signs, compared, signals, structure: placements, together };
115
132
  };
116
133
 
117
- /** The signs that counted, for one line: rule ids, and structure measures as structure:<id>. */
134
+ /** How the together sign shows in one line: the composite's id at the level whose count it uses. */
135
+ export const TOGETHER_SIGN = "ai-generated-composite:strict";
136
+
137
+ /** The signs that counted, for one line: rule ids, structure measures as structure:<id>, and TOGETHER_SIGN. */
118
138
  export const shownSignsOf = (score: AiScore): string[] => [
119
139
  ...score.signals.filter((signal) => signal.unusual).map((signal) => signal.rule),
120
140
  ...(score.structure ?? []).filter((place) => place.beyond && place.sameAs === undefined).map((place) => `structure:${place.feature.id}`),
141
+ ...(score.together.counted ? [TOGETHER_SIGN] : []),
121
142
  ];
@@ -28,12 +28,22 @@ export const SAME_SHAPE: Readonly<Partial<Record<FeatureId, string>>> = {
28
28
  "three-item-lists": "rule-of-three",
29
29
  };
30
30
 
31
+ /** The signals ai-generated-composite reads: the together sign counts how many of them fired. */
32
+ export const compositeSignalIds = (rules: readonly RuleDefinition[]): readonly string[] => rules.find((rule) => rule.id === COMPOSITE)?.from ?? [];
33
+
31
34
  /** The composite's levels: the score's level boundaries are held to them (test_ai_score.ts). */
32
35
  export const compositeLevels = (rules: readonly RuleDefinition[]): LevelTable => rules.find((rule) => rule.id === COMPOSITE)?.levels ?? {};
33
36
 
34
37
  /**
35
38
  * The level each rule runs at when measured on human documents (`yarn rules:measure`): the genre's level, and normal
36
- * where the genre turns the rule off, so a share exists for every genre group the rule can run in.
39
+ * where the genre turns the rule off, so a share exists for every genre group the rule can run in. A rule that runs only
40
+ * with a style (opt_in) stays off: how often it fires on documents that never chose the style says nothing about it.
37
41
  */
42
+ const measuredLevel = (rule: RuleDefinition, preset: Readonly<Record<string, Level>>): Level => {
43
+ if (rule.opt_in === true) return "off";
44
+ const level = preset[rule.id];
45
+ return level === undefined || level === "off" ? "normal" : level;
46
+ };
47
+
38
48
  export const measuredLevelsOf = (rules: readonly RuleDefinition[], preset: Readonly<Record<string, Level>>): Record<string, Level> =>
39
- Object.fromEntries(rules.map((rule) => [rule.id, preset[rule.id] === undefined || preset[rule.id] === "off" ? "normal" : (preset[rule.id] ?? "normal")]));
49
+ Object.fromEntries(rules.map((rule) => [rule.id, measuredLevel(rule, preset)]));
@@ -18,6 +18,8 @@ export type AiScoreText = {
18
18
  readonly fired: (name: string, count: number, fired: number, documents: number, group: string) => string;
19
19
  /** A signal that fired but is common in human documents of the group, so it does not count. */
20
20
  readonly common: (name: string, count: number, fired: number, documents: number) => string;
21
+ /** The composite's signals that fired together, enough at its strict level to count as one more sign. */
22
+ readonly together: (name: string, names: string, count: number, limit: number) => string;
21
23
  readonly quiet: (count: number) => string;
22
24
  /** The structure measures within what human articles show. */
23
25
  readonly usual: (count: number) => string;
@@ -59,6 +61,7 @@ export const AI_SCORE_TEXT: Texts<AiScoreText> = {
59
61
  `✗ ${name}: ${String(count)} 件 人が書いた文書(${group})${String(documents)} 本のうち ${String(fired)} 本`,
60
62
  common: (name, count, fired, documents) =>
61
63
  `· ${name}: ${String(count)} 件 人の文書でも出る(${String(documents)} 本のうち ${String(fired)} 本)ので数えません`,
64
+ together: (name, names, count, limit) => `✗ ${name}: ${String(count)} 種(${names})。厳しめの段階の ${String(limit)} 種から、目印 1 個に数えます`,
62
65
  quiet: (count) => `· ほかの ${String(count)} 項目は出ていません`,
63
66
  usual: (count) => `· ほかの ${String(count)} 項目は人の記事でふつうの値です`,
64
67
  noHumanShare: (names) => `比べていない(人の文書の基準が無い): ${names}`,
@@ -67,7 +70,7 @@ export const AI_SCORE_TEXT: Texts<AiScoreText> = {
67
70
  sameAs: (name) => `「${name}」と同じ形なので 1 つに数えます`,
68
71
  summary: (headline, signs, path) => `${headline}: 目印 ${String(signs)} 個 ※ 書いたのが AI かどうかの判定ではありません。内訳: chaff ai-score ${path}`,
69
72
  summaryNotScored: (reason) => `AI らしさ: 測っていません(${reason})`,
70
- usage: "使い方: chaff ai-score <file>... [--genre <ジャンル>] [--format text|json] [--compact]",
73
+ usage: "使い方: chaff ai-score <file>... [--genre <ジャンル>] [--language ja|en|…] [--format text|json] [--json] [--compact]",
71
74
  unknownFormat: (format) => `--format は text か json です(${format} は知りません)`,
72
75
  listSeparator: "、",
73
76
  aside: (main, inner) => `${main}(${inner})`,
@@ -86,6 +89,8 @@ export const AI_SCORE_TEXT: Texts<AiScoreText> = {
86
89
  `✗ ${name}: ${String(count)} in ${String(fired)} of ${String(documents)} human-written documents (${group})`,
87
90
  common: (name, count, fired, documents) =>
88
91
  `· ${name}: ${String(count)} common in human documents too (${String(fired)} of ${String(documents)}), not counted`,
92
+ together: (name, names, count, limit) =>
93
+ `✗ ${name}: ${String(count)} of its signals (${names}); from ${String(limit)}, its strict level, that is one more sign`,
89
94
  quiet: (count) => `· the other ${String(count)} did not show`,
90
95
  usual: (count) => `· the other ${String(count)} are usual for human articles`,
91
96
  noHumanShare: (names) => `not compared (no human baseline): ${names}`,
@@ -95,7 +100,7 @@ export const AI_SCORE_TEXT: Texts<AiScoreText> = {
95
100
  summary: (headline, signs, path) =>
96
101
  `${headline}: ${String(signs)} ${signs === 1 ? "sign" : "signs"}. Not a verdict on whether AI wrote it. Breakdown: chaff ai-score ${path}`,
97
102
  summaryNotScored: (reason) => `AI-likeness: not scored (${reason})`,
98
- usage: "usage: chaff ai-score <file>... [--genre <genre>] [--format text|json] [--compact]",
103
+ usage: "usage: chaff ai-score <file>... [--genre <genre>] [--language ja|en|…] [--format text|json] [--json] [--compact]",
99
104
  unknownFormat: (format) => `--format is text or json (not ${format})`,
100
105
  listSeparator: ", ",
101
106
  aside: (main, inner) => `${main} (${inner})`,
@@ -44,7 +44,7 @@ const lastSentenceStart = (text: string): number => {
44
44
  return ends.at(-1) ?? 0;
45
45
  };
46
46
 
47
- const alternation = (words: readonly string[]): string =>
47
+ export const alternation = (words: readonly string[]): string =>
48
48
  words
49
49
  .toSorted((a, b) => b.length - a.length)
50
50
  .map(escapeRegExp)
@@ -52,16 +52,18 @@ const alternation = (words: readonly string[]): string =>
52
52
 
53
53
  /**
54
54
  * 数と、それが数えるもの。数の前が数字・英字・数の字なら数の途中(十三、23、eleven の中)。
55
- * 英語は数と数える語の間に語を二つまで置ける(three key steps)。数える語が無くても、文がコロンで終わる直前の数(the following two:)は数に読む。
55
+ * 英語は数と数える語の間に語を二つまで置ける(three key steps)。数える語が無くても、文がコロンで終わる直前の数(the following two:)と、
56
+ * その後ろに語が一つだけある数(the following three documents:)は数に読む。どちらも先を指す語のすぐ後ろでだけ予告になる(pointsAhead)。
56
57
  */
57
58
  const phrasePattern = (words: CountWords): RegExp => {
58
59
  const numberChars = escapeRegExp([...new Set(words.numbers.join(""))].join(""));
59
60
  const numbers = words.numbers.length === 0 ? "\\p{Nd}+" : `\\p{Nd}+|${alternation(words.numbers)}`;
60
61
  const counted = `[ \\t\\u00a0]?(?:\\p{Ll}[\\p{Ll}-]*[ \\t]){0,2}(${alternation(words.counters)})(?![A-Za-z])`;
61
- return new RegExp(`(?<![\\p{N}A-Za-z${numberChars}])(${numbers})(?:${counted}|(?=[ \\t]?[::][ \\t]*$))`, "giu");
62
+ const uncounted = String.raw`(?:[ \t]\p{Ll}[\p{Ll}-]*)?(?=[ \t]?[::][ \t]*$)`;
63
+ return new RegExp(`(?<![\\p{N}A-Za-z${numberChars}])(${numbers})(?:${counted}|${uncounted})`, "giu");
62
64
  };
63
65
 
64
- const valueOf = (written: string, numbers: readonly string[]): number => {
66
+ export const valueOf = (written: string, numbers: readonly string[]): number => {
65
67
  const digits = Number(written.normalize("NFKC"));
66
68
  if (!Number.isNaN(digits)) return digits;
67
69
  return numbers.findIndex((number) => number.toLowerCase() === written.toLowerCase()) + 1;
@@ -111,15 +113,20 @@ const pointsAhead = (sentence: string, phrase: Phrase, anchors: readonly string[
111
113
  return COLON_END.test(sentence.trimEnd()) && !number.test(sentence.slice(phrase.end));
112
114
  };
113
115
 
114
- /** 最後の一文の予告。数がちょうど一つで、目安や順番でなく、先を指しているときだけ。 */
116
+ /**
117
+ * 最後の一文の予告。数がちょうど一つで、目安や順番でなく、先を指しているときだけ。数える語の無い数に語が続くもの
118
+ * (2 weeks:)は、先を指す語のすぐ後ろでなければ数に数えない(within 2 weeks: は期限で、予告の数を消さない)。
119
+ */
115
120
  const announcedIn = (sentence: string, words: CountWords, patterns: Patterns): Phrase | undefined => {
116
- const phrases = [...sentence.matchAll(patterns.phrase)].map((match) => ({
117
- start: match.index,
118
- numberEnd: match.index + (match[1] ?? "").length,
119
- end: match.index + match[0].length,
120
- announced: valueOf(match[1] ?? "", words.numbers),
121
- counted: match[2] !== undefined,
122
- }));
121
+ const phrases = [...sentence.matchAll(patterns.phrase)]
122
+ .map((match) => ({
123
+ start: match.index,
124
+ numberEnd: match.index + (match[1] ?? "").length,
125
+ end: match.index + match[0].length,
126
+ announced: valueOf(match[1] ?? "", words.numbers),
127
+ counted: match[2] !== undefined,
128
+ }))
129
+ .filter((phrase) => phrase.counted || phrase.end === phrase.numberEnd || pointsAhead(sentence, phrase, words.anchors, patterns.number));
123
130
  const only = phrases.length === 1 ? phrases[0] : undefined;
124
131
  if (only === undefined || only.announced < 1 || isHedged(sentence, only, words)) return undefined;
125
132
  return pointsAhead(sentence, only, words.anchors, patterns.number) ? only : undefined;