chaffjs 0.34.0 → 0.36.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 (976) hide show
  1. package/README.ja.md +12 -0
  2. package/README.md +15 -0
  3. package/dist/announced-count.d.ts +2 -0
  4. package/dist/announced-count.d.ts.map +1 -1
  5. package/dist/announced-count.js +29 -7
  6. package/dist/announced-count.js.map +1 -1
  7. package/dist/capitals-passage.d.ts +3 -0
  8. package/dist/capitals-passage.d.ts.map +1 -0
  9. package/dist/capitals-passage.js +26 -0
  10. package/dist/capitals-passage.js.map +1 -0
  11. package/dist/chronology-rows.d.ts +9 -0
  12. package/dist/chronology-rows.d.ts.map +1 -0
  13. package/dist/chronology-rows.js +79 -0
  14. package/dist/chronology-rows.js.map +1 -0
  15. package/dist/coined-hyphen-name.d.ts +13 -0
  16. package/dist/coined-hyphen-name.d.ts.map +1 -0
  17. package/dist/coined-hyphen-name.js +21 -0
  18. package/dist/coined-hyphen-name.js.map +1 -0
  19. package/dist/company-name-run.d.ts +8 -0
  20. package/dist/company-name-run.d.ts.map +1 -0
  21. package/dist/company-name-run.js +30 -0
  22. package/dist/company-name-run.js.map +1 -0
  23. package/dist/company-names.d.ts +6 -1
  24. package/dist/company-names.d.ts.map +1 -1
  25. package/dist/company-names.js +22 -3
  26. package/dist/company-names.js.map +1 -1
  27. package/dist/compound-head.d.ts +7 -0
  28. package/dist/compound-head.d.ts.map +1 -0
  29. package/dist/compound-head.js +19 -0
  30. package/dist/compound-head.js.map +1 -0
  31. package/dist/date-format.d.ts +8 -3
  32. package/dist/date-format.d.ts.map +1 -1
  33. package/dist/date-format.js +36 -3
  34. package/dist/date-format.js.map +1 -1
  35. package/dist/derived/count-per-period.d.ts +23 -0
  36. package/dist/derived/count-per-period.d.ts.map +1 -0
  37. package/dist/derived/count-per-period.js +14 -0
  38. package/dist/derived/count-per-period.js.map +1 -0
  39. package/dist/detectors/acronym-context.d.ts +5 -1
  40. package/dist/detectors/acronym-context.d.ts.map +1 -1
  41. package/dist/detectors/acronym-context.js +32 -4
  42. package/dist/detectors/acronym-context.js.map +1 -1
  43. package/dist/detectors/acronym-definition.d.ts +13 -0
  44. package/dist/detectors/acronym-definition.d.ts.map +1 -0
  45. package/dist/detectors/acronym-definition.js +90 -0
  46. package/dist/detectors/acronym-definition.js.map +1 -0
  47. package/dist/detectors/acronym-expansion.d.ts +5 -1
  48. package/dist/detectors/acronym-expansion.d.ts.map +1 -1
  49. package/dist/detectors/acronym-expansion.js +35 -3
  50. package/dist/detectors/acronym-expansion.js.map +1 -1
  51. package/dist/detectors/acronym-known.d.ts +19 -0
  52. package/dist/detectors/acronym-known.d.ts.map +1 -0
  53. package/dist/detectors/acronym-known.js +32 -0
  54. package/dist/detectors/acronym-known.js.map +1 -0
  55. package/dist/detectors/acronym-link.d.ts +14 -0
  56. package/dist/detectors/acronym-link.d.ts.map +1 -0
  57. package/dist/detectors/acronym-link.js +32 -0
  58. package/dist/detectors/acronym-link.js.map +1 -0
  59. package/dist/detectors/acronym-lone.d.ts +13 -0
  60. package/dist/detectors/acronym-lone.d.ts.map +1 -0
  61. package/dist/detectors/acronym-lone.js +22 -0
  62. package/dist/detectors/acronym-lone.js.map +1 -0
  63. package/dist/detectors/acronym-name.d.ts +62 -0
  64. package/dist/detectors/acronym-name.d.ts.map +1 -0
  65. package/dist/detectors/acronym-name.js +94 -0
  66. package/dist/detectors/acronym-name.js.map +1 -0
  67. package/dist/detectors/addressee-edge.d.ts +13 -0
  68. package/dist/detectors/addressee-edge.d.ts.map +1 -0
  69. package/dist/detectors/addressee-edge.js +13 -0
  70. package/dist/detectors/addressee-edge.js.map +1 -0
  71. package/dist/detectors/announced-count.d.ts.map +1 -1
  72. package/dist/detectors/announced-count.js +1 -0
  73. package/dist/detectors/announced-count.js.map +1 -1
  74. package/dist/detectors/bare-comparative.d.ts +4 -0
  75. package/dist/detectors/bare-comparative.d.ts.map +1 -1
  76. package/dist/detectors/bare-comparative.js +28 -3
  77. package/dist/detectors/bare-comparative.js.map +1 -1
  78. package/dist/detectors/blank-structure.d.ts +7 -1
  79. package/dist/detectors/blank-structure.d.ts.map +1 -1
  80. package/dist/detectors/blank-structure.js +13 -8
  81. package/dist/detectors/blank-structure.js.map +1 -1
  82. package/dist/detectors/bracket-specified.d.ts +6 -0
  83. package/dist/detectors/bracket-specified.d.ts.map +1 -0
  84. package/dist/detectors/bracket-specified.js +23 -0
  85. package/dist/detectors/bracket-specified.js.map +1 -0
  86. package/dist/detectors/broken-link.d.ts +6 -0
  87. package/dist/detectors/broken-link.d.ts.map +1 -1
  88. package/dist/detectors/broken-link.js +23 -2
  89. package/dist/detectors/broken-link.js.map +1 -1
  90. package/dist/detectors/capitalised-term.d.ts +14 -2
  91. package/dist/detectors/capitalised-term.d.ts.map +1 -1
  92. package/dist/detectors/capitalised-term.js +115 -4
  93. package/dist/detectors/capitalised-term.js.map +1 -1
  94. package/dist/detectors/caps-caption.d.ts +12 -0
  95. package/dist/detectors/caps-caption.d.ts.map +1 -0
  96. package/dist/detectors/caps-caption.js +89 -0
  97. package/dist/detectors/caps-caption.js.map +1 -0
  98. package/dist/detectors/caps-phrase.d.ts +6 -0
  99. package/dist/detectors/caps-phrase.d.ts.map +1 -0
  100. package/dist/detectors/caps-phrase.js +16 -0
  101. package/dist/detectors/caps-phrase.js.map +1 -0
  102. package/dist/detectors/char-shape.d.ts +1 -0
  103. package/dist/detectors/char-shape.d.ts.map +1 -1
  104. package/dist/detectors/char-shape.js +72 -30
  105. package/dist/detectors/char-shape.js.map +1 -1
  106. package/dist/detectors/cited-title.d.ts +3 -2
  107. package/dist/detectors/cited-title.d.ts.map +1 -1
  108. package/dist/detectors/cited-title.js +14 -3
  109. package/dist/detectors/cited-title.js.map +1 -1
  110. package/dist/detectors/clause-shape.d.ts +1 -1
  111. package/dist/detectors/clause-shape.d.ts.map +1 -1
  112. package/dist/detectors/clause-shape.js +9 -4
  113. package/dist/detectors/clause-shape.js.map +1 -1
  114. package/dist/detectors/concrete-evidence.d.ts +13 -1
  115. package/dist/detectors/concrete-evidence.d.ts.map +1 -1
  116. package/dist/detectors/concrete-evidence.js +59 -0
  117. package/dist/detectors/concrete-evidence.js.map +1 -1
  118. package/dist/detectors/contraction-minority.d.ts +11 -0
  119. package/dist/detectors/contraction-minority.d.ts.map +1 -0
  120. package/dist/detectors/contraction-minority.js +10 -0
  121. package/dist/detectors/contraction-minority.js.map +1 -0
  122. package/dist/detectors/counter-edge.d.ts +7 -1
  123. package/dist/detectors/counter-edge.d.ts.map +1 -1
  124. package/dist/detectors/counter-edge.js +40 -2
  125. package/dist/detectors/counter-edge.js.map +1 -1
  126. package/dist/detectors/date-any-year.d.ts +12 -5
  127. package/dist/detectors/date-any-year.d.ts.map +1 -1
  128. package/dist/detectors/date-any-year.js +69 -12
  129. package/dist/detectors/date-any-year.js.map +1 -1
  130. package/dist/detectors/date-format.d.ts.map +1 -1
  131. package/dist/detectors/date-format.js +2 -1
  132. package/dist/detectors/date-format.js.map +1 -1
  133. package/dist/detectors/date-heading-year.d.ts +18 -0
  134. package/dist/detectors/date-heading-year.d.ts.map +1 -0
  135. package/dist/detectors/date-heading-year.js +38 -0
  136. package/dist/detectors/date-heading-year.js.map +1 -0
  137. package/dist/detectors/date-year.d.ts +19 -3
  138. package/dist/detectors/date-year.d.ts.map +1 -1
  139. package/dist/detectors/date-year.js +69 -8
  140. package/dist/detectors/date-year.js.map +1 -1
  141. package/dist/detectors/deadline-unit.d.ts +20 -0
  142. package/dist/detectors/deadline-unit.d.ts.map +1 -0
  143. package/dist/detectors/deadline-unit.js +19 -0
  144. package/dist/detectors/deadline-unit.js.map +1 -0
  145. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  146. package/dist/detectors/defined-term-form.js +59 -12
  147. package/dist/detectors/defined-term-form.js.map +1 -1
  148. package/dist/detectors/definition-use.d.ts.map +1 -1
  149. package/dist/detectors/definition-use.js +6 -3
  150. package/dist/detectors/definition-use.js.map +1 -1
  151. package/dist/detectors/derived-numbers.d.ts.map +1 -1
  152. package/dist/detectors/derived-numbers.js +17 -4
  153. package/dist/detectors/derived-numbers.js.map +1 -1
  154. package/dist/detectors/doubled-across-aside.d.ts +9 -0
  155. package/dist/detectors/doubled-across-aside.d.ts.map +1 -0
  156. package/dist/detectors/doubled-across-aside.js +27 -0
  157. package/dist/detectors/doubled-across-aside.js.map +1 -0
  158. package/dist/detectors/doubled-punctuation.d.ts +3 -3
  159. package/dist/detectors/doubled-punctuation.d.ts.map +1 -1
  160. package/dist/detectors/doubled-punctuation.js +23 -4
  161. package/dist/detectors/doubled-punctuation.js.map +1 -1
  162. package/dist/detectors/doubled-word.d.ts.map +1 -1
  163. package/dist/detectors/doubled-word.js +2 -1
  164. package/dist/detectors/doubled-word.js.map +1 -1
  165. package/dist/detectors/due-date.d.ts.map +1 -1
  166. package/dist/detectors/due-date.js +6 -0
  167. package/dist/detectors/due-date.js.map +1 -1
  168. package/dist/detectors/ellipsis.d.ts.map +1 -1
  169. package/dist/detectors/ellipsis.js +13 -1
  170. package/dist/detectors/ellipsis.js.map +1 -1
  171. package/dist/detectors/email-letter.d.ts +31 -1
  172. package/dist/detectors/email-letter.d.ts.map +1 -1
  173. package/dist/detectors/email-letter.js +76 -14
  174. package/dist/detectors/email-letter.js.map +1 -1
  175. package/dist/detectors/en-shape.d.ts.map +1 -1
  176. package/dist/detectors/en-shape.js +5 -1
  177. package/dist/detectors/en-shape.js.map +1 -1
  178. package/dist/detectors/fact-consistency.d.ts.map +1 -1
  179. package/dist/detectors/fact-consistency.js +3 -2
  180. package/dist/detectors/fact-consistency.js.map +1 -1
  181. package/dist/detectors/field-label.d.ts +7 -0
  182. package/dist/detectors/field-label.d.ts.map +1 -0
  183. package/dist/detectors/field-label.js +23 -0
  184. package/dist/detectors/field-label.js.map +1 -0
  185. package/dist/detectors/footnote-mismatch.d.ts +6 -1
  186. package/dist/detectors/footnote-mismatch.d.ts.map +1 -1
  187. package/dist/detectors/footnote-mismatch.js +28 -7
  188. package/dist/detectors/footnote-mismatch.js.map +1 -1
  189. package/dist/detectors/graded-step.d.ts +20 -0
  190. package/dist/detectors/graded-step.d.ts.map +1 -0
  191. package/dist/detectors/graded-step.js +33 -0
  192. package/dist/detectors/graded-step.js.map +1 -0
  193. package/dist/detectors/gram-openers.d.ts +8 -0
  194. package/dist/detectors/gram-openers.d.ts.map +1 -0
  195. package/dist/detectors/gram-openers.js +16 -0
  196. package/dist/detectors/gram-openers.js.map +1 -0
  197. package/dist/detectors/gram-passages.d.ts +11 -0
  198. package/dist/detectors/gram-passages.d.ts.map +1 -0
  199. package/dist/detectors/gram-passages.js +26 -0
  200. package/dist/detectors/gram-passages.js.map +1 -0
  201. package/dist/detectors/gram-place.d.ts +3 -1
  202. package/dist/detectors/gram-place.d.ts.map +1 -1
  203. package/dist/detectors/gram-place.js +8 -0
  204. package/dist/detectors/gram-place.js.map +1 -1
  205. package/dist/detectors/gram-predicate.d.ts.map +1 -1
  206. package/dist/detectors/gram-predicate.js +37 -3
  207. package/dist/detectors/gram-predicate.js.map +1 -1
  208. package/dist/detectors/heading-echo.d.ts.map +1 -1
  209. package/dist/detectors/heading-echo.js +28 -2
  210. package/dist/detectors/heading-echo.js.map +1 -1
  211. package/dist/detectors/heading-end-mark.d.ts +8 -3
  212. package/dist/detectors/heading-end-mark.d.ts.map +1 -1
  213. package/dist/detectors/heading-end-mark.js +18 -8
  214. package/dist/detectors/heading-end-mark.js.map +1 -1
  215. package/dist/detectors/heading-names.d.ts +7 -0
  216. package/dist/detectors/heading-names.d.ts.map +1 -0
  217. package/dist/detectors/heading-names.js +24 -0
  218. package/dist/detectors/heading-names.js.map +1 -0
  219. package/dist/detectors/heading-numbering.d.ts.map +1 -1
  220. package/dist/detectors/heading-numbering.js +7 -2
  221. package/dist/detectors/heading-numbering.js.map +1 -1
  222. package/dist/detectors/ime-residue.d.ts +1 -1
  223. package/dist/detectors/ime-residue.d.ts.map +1 -1
  224. package/dist/detectors/ime-residue.js +4 -3
  225. package/dist/detectors/ime-residue.js.map +1 -1
  226. package/dist/detectors/inch-mark.d.ts +10 -0
  227. package/dist/detectors/inch-mark.d.ts.map +1 -0
  228. package/dist/detectors/inch-mark.js +48 -0
  229. package/dist/detectors/inch-mark.js.map +1 -0
  230. package/dist/detectors/kanji-compound-slip.d.ts +3 -0
  231. package/dist/detectors/kanji-compound-slip.d.ts.map +1 -0
  232. package/dist/detectors/kanji-compound-slip.js +50 -0
  233. package/dist/detectors/kanji-compound-slip.js.map +1 -0
  234. package/dist/detectors/kutoten-consistency.d.ts +10 -2
  235. package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
  236. package/dist/detectors/kutoten-consistency.js +76 -12
  237. package/dist/detectors/kutoten-consistency.js.map +1 -1
  238. package/dist/detectors/lexicon.d.ts +0 -1
  239. package/dist/detectors/lexicon.d.ts.map +1 -1
  240. package/dist/detectors/lexicon.js +37 -25
  241. package/dist/detectors/lexicon.js.map +1 -1
  242. package/dist/detectors/link-shape.d.ts.map +1 -1
  243. package/dist/detectors/link-shape.js +9 -3
  244. package/dist/detectors/link-shape.js.map +1 -1
  245. package/dist/detectors/list-item-ending.d.ts +18 -0
  246. package/dist/detectors/list-item-ending.d.ts.map +1 -0
  247. package/dist/detectors/list-item-ending.js +35 -0
  248. package/dist/detectors/list-item-ending.js.map +1 -0
  249. package/dist/detectors/list-parallel.d.ts +18 -5
  250. package/dist/detectors/list-parallel.d.ts.map +1 -1
  251. package/dist/detectors/list-parallel.js +116 -36
  252. package/dist/detectors/list-parallel.js.map +1 -1
  253. package/dist/detectors/list-sentence.d.ts +4 -0
  254. package/dist/detectors/list-sentence.d.ts.map +1 -1
  255. package/dist/detectors/list-sentence.js +1 -1
  256. package/dist/detectors/list-sentence.js.map +1 -1
  257. package/dist/detectors/mark-shape.d.ts +15 -5
  258. package/dist/detectors/mark-shape.d.ts.map +1 -1
  259. package/dist/detectors/mark-shape.js +64 -10
  260. package/dist/detectors/mark-shape.js.map +1 -1
  261. package/dist/detectors/mentioned-phrase.d.ts +9 -0
  262. package/dist/detectors/mentioned-phrase.d.ts.map +1 -0
  263. package/dist/detectors/mentioned-phrase.js +25 -0
  264. package/dist/detectors/mentioned-phrase.js.map +1 -0
  265. package/dist/detectors/middle-dot.d.ts +2 -2
  266. package/dist/detectors/middle-dot.d.ts.map +1 -1
  267. package/dist/detectors/middle-dot.js +4 -2
  268. package/dist/detectors/middle-dot.js.map +1 -1
  269. package/dist/detectors/modal-conflict.d.ts.map +1 -1
  270. package/dist/detectors/modal-conflict.js +5 -2
  271. package/dist/detectors/modal-conflict.js.map +1 -1
  272. package/dist/detectors/name-variant-apart.d.ts +27 -0
  273. package/dist/detectors/name-variant-apart.d.ts.map +1 -0
  274. package/dist/detectors/name-variant-apart.js +51 -0
  275. package/dist/detectors/name-variant-apart.js.map +1 -0
  276. package/dist/detectors/name-variant.d.ts.map +1 -1
  277. package/dist/detectors/name-variant.js +18 -11
  278. package/dist/detectors/name-variant.js.map +1 -1
  279. package/dist/detectors/notice-paragraph.d.ts +9 -0
  280. package/dist/detectors/notice-paragraph.d.ts.map +1 -0
  281. package/dist/detectors/notice-paragraph.js +21 -0
  282. package/dist/detectors/notice-paragraph.js.map +1 -0
  283. package/dist/detectors/number-style.d.ts.map +1 -1
  284. package/dist/detectors/number-style.js +15 -2
  285. package/dist/detectors/number-style.js.map +1 -1
  286. package/dist/detectors/number-unit.d.ts.map +1 -1
  287. package/dist/detectors/number-unit.js +24 -1
  288. package/dist/detectors/number-unit.js.map +1 -1
  289. package/dist/detectors/numeral-opener.d.ts +6 -0
  290. package/dist/detectors/numeral-opener.d.ts.map +1 -1
  291. package/dist/detectors/numeral-opener.js +24 -1
  292. package/dist/detectors/numeral-opener.js.map +1 -1
  293. package/dist/detectors/numeral-word.d.ts +15 -0
  294. package/dist/detectors/numeral-word.d.ts.map +1 -0
  295. package/dist/detectors/numeral-word.js +26 -0
  296. package/dist/detectors/numeral-word.js.map +1 -0
  297. package/dist/detectors/obligation-without-deadline.d.ts +5 -1
  298. package/dist/detectors/obligation-without-deadline.d.ts.map +1 -1
  299. package/dist/detectors/obligation-without-deadline.js +44 -23
  300. package/dist/detectors/obligation-without-deadline.js.map +1 -1
  301. package/dist/detectors/open-end-class.d.ts +16 -0
  302. package/dist/detectors/open-end-class.d.ts.map +1 -0
  303. package/dist/detectors/open-end-class.js +65 -0
  304. package/dist/detectors/open-end-class.js.map +1 -0
  305. package/dist/detectors/open-end-condition.d.ts +7 -0
  306. package/dist/detectors/open-end-condition.d.ts.map +1 -0
  307. package/dist/detectors/open-end-condition.js +35 -0
  308. package/dist/detectors/open-end-condition.js.map +1 -0
  309. package/dist/detectors/open-end-names.d.ts +9 -3
  310. package/dist/detectors/open-end-names.d.ts.map +1 -1
  311. package/dist/detectors/open-end-names.js +5 -2
  312. package/dist/detectors/open-end-names.js.map +1 -1
  313. package/dist/detectors/open-end-question.d.ts +15 -0
  314. package/dist/detectors/open-end-question.d.ts.map +1 -0
  315. package/dist/detectors/open-end-question.js +37 -0
  316. package/dist/detectors/open-end-question.js.map +1 -0
  317. package/dist/detectors/open-end-scope.d.ts +16 -0
  318. package/dist/detectors/open-end-scope.d.ts.map +1 -0
  319. package/dist/detectors/open-end-scope.js +47 -0
  320. package/dist/detectors/open-end-scope.js.map +1 -0
  321. package/dist/detectors/opening-date.d.ts +10 -0
  322. package/dist/detectors/opening-date.d.ts.map +1 -0
  323. package/dist/detectors/opening-date.js +33 -0
  324. package/dist/detectors/opening-date.js.map +1 -0
  325. package/dist/detectors/ordinary-phrase.d.ts +20 -0
  326. package/dist/detectors/ordinary-phrase.d.ts.map +1 -0
  327. package/dist/detectors/ordinary-phrase.js +54 -0
  328. package/dist/detectors/ordinary-phrase.js.map +1 -0
  329. package/dist/detectors/organisation-run.d.ts +18 -0
  330. package/dist/detectors/organisation-run.d.ts.map +1 -0
  331. package/dist/detectors/organisation-run.js +80 -0
  332. package/dist/detectors/organisation-run.js.map +1 -0
  333. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  334. package/dist/detectors/orthographic-variant.js +65 -21
  335. package/dist/detectors/orthographic-variant.js.map +1 -1
  336. package/dist/detectors/orthography.d.ts.map +1 -1
  337. package/dist/detectors/orthography.js +6 -1
  338. package/dist/detectors/orthography.js.map +1 -1
  339. package/dist/detectors/outline-label.d.ts +14 -0
  340. package/dist/detectors/outline-label.d.ts.map +1 -0
  341. package/dist/detectors/outline-label.js +32 -0
  342. package/dist/detectors/outline-label.js.map +1 -0
  343. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  344. package/dist/detectors/oxford-comma.js +38 -1
  345. package/dist/detectors/oxford-comma.js.map +1 -1
  346. package/dist/detectors/page-marker.d.ts +6 -0
  347. package/dist/detectors/page-marker.d.ts.map +1 -0
  348. package/dist/detectors/page-marker.js +19 -0
  349. package/dist/detectors/page-marker.js.map +1 -0
  350. package/dist/detectors/parallel-definition.d.ts +16 -0
  351. package/dist/detectors/parallel-definition.d.ts.map +1 -0
  352. package/dist/detectors/parallel-definition.js +51 -0
  353. package/dist/detectors/parallel-definition.js.map +1 -0
  354. package/dist/detectors/person-consistency.d.ts +2 -1
  355. package/dist/detectors/person-consistency.d.ts.map +1 -1
  356. package/dist/detectors/person-consistency.js +5 -3
  357. package/dist/detectors/person-consistency.js.map +1 -1
  358. package/dist/detectors/phrase-match.d.ts +2 -0
  359. package/dist/detectors/phrase-match.d.ts.map +1 -1
  360. package/dist/detectors/phrase-match.js +11 -4
  361. package/dist/detectors/phrase-match.js.map +1 -1
  362. package/dist/detectors/placeholder-text.d.ts.map +1 -1
  363. package/dist/detectors/placeholder-text.js +18 -3
  364. package/dist/detectors/placeholder-text.js.map +1 -1
  365. package/dist/detectors/placeholder.d.ts +3 -1
  366. package/dist/detectors/placeholder.d.ts.map +1 -1
  367. package/dist/detectors/placeholder.js +8 -3
  368. package/dist/detectors/placeholder.js.map +1 -1
  369. package/dist/detectors/postcode-end.d.ts +3 -0
  370. package/dist/detectors/postcode-end.d.ts.map +1 -0
  371. package/dist/detectors/postcode-end.js +15 -0
  372. package/dist/detectors/postcode-end.js.map +1 -0
  373. package/dist/detectors/prose-total-words.d.ts +5 -0
  374. package/dist/detectors/prose-total-words.d.ts.map +1 -0
  375. package/dist/detectors/prose-total-words.js +14 -0
  376. package/dist/detectors/prose-total-words.js.map +1 -0
  377. package/dist/detectors/reference-text.d.ts.map +1 -1
  378. package/dist/detectors/reference-text.js +1 -0
  379. package/dist/detectors/reference-text.js.map +1 -1
  380. package/dist/detectors/registry/kanji-compound-slip.d.ts +3 -0
  381. package/dist/detectors/registry/kanji-compound-slip.d.ts.map +1 -0
  382. package/dist/detectors/registry/kanji-compound-slip.js +3 -0
  383. package/dist/detectors/registry/kanji-compound-slip.js.map +1 -0
  384. package/dist/detectors/registry/phrase-in-use.d.ts +3 -0
  385. package/dist/detectors/registry/phrase-in-use.d.ts.map +1 -0
  386. package/dist/detectors/registry/phrase-in-use.js +3 -0
  387. package/dist/detectors/registry/phrase-in-use.js.map +1 -0
  388. package/dist/detectors/registry/unfilled-placeholder.d.ts.map +1 -1
  389. package/dist/detectors/registry/unfilled-placeholder.js +2 -2
  390. package/dist/detectors/registry/unfilled-placeholder.js.map +1 -1
  391. package/dist/detectors/registry/vague-density.js +1 -1
  392. package/dist/detectors/registry/vague-density.js.map +1 -1
  393. package/dist/detectors/request-owner.d.ts +6 -2
  394. package/dist/detectors/request-owner.d.ts.map +1 -1
  395. package/dist/detectors/request-owner.js +57 -7
  396. package/dist/detectors/request-owner.js.map +1 -1
  397. package/dist/detectors/requirement-smell.d.ts.map +1 -1
  398. package/dist/detectors/requirement-smell.js +39 -7
  399. package/dist/detectors/requirement-smell.js.map +1 -1
  400. package/dist/detectors/scaled-figure-unit.d.ts +28 -0
  401. package/dist/detectors/scaled-figure-unit.d.ts.map +1 -0
  402. package/dist/detectors/scaled-figure-unit.js +78 -0
  403. package/dist/detectors/scaled-figure-unit.js.map +1 -0
  404. package/dist/detectors/sentence-counts.d.ts +2 -0
  405. package/dist/detectors/sentence-counts.d.ts.map +1 -1
  406. package/dist/detectors/sentence-counts.js +18 -7
  407. package/dist/detectors/sentence-counts.js.map +1 -1
  408. package/dist/detectors/sentence-ending.d.ts +2 -0
  409. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  410. package/dist/detectors/sentence-ending.js +10 -3
  411. package/dist/detectors/sentence-ending.js.map +1 -1
  412. package/dist/detectors/sentence-length.d.ts.map +1 -1
  413. package/dist/detectors/sentence-length.js +24 -16
  414. package/dist/detectors/sentence-length.js.map +1 -1
  415. package/dist/detectors/sentence-load.d.ts +4 -1
  416. package/dist/detectors/sentence-load.d.ts.map +1 -1
  417. package/dist/detectors/sentence-load.js +9 -2
  418. package/dist/detectors/sentence-load.js.map +1 -1
  419. package/dist/detectors/sentence-rhythm.d.ts.map +1 -1
  420. package/dist/detectors/sentence-rhythm.js +6 -3
  421. package/dist/detectors/sentence-rhythm.js.map +1 -1
  422. package/dist/detectors/series-label.d.ts +2 -1
  423. package/dist/detectors/series-label.d.ts.map +1 -1
  424. package/dist/detectors/series-label.js +10 -4
  425. package/dist/detectors/series-label.js.map +1 -1
  426. package/dist/detectors/signals.d.ts +4 -0
  427. package/dist/detectors/signals.d.ts.map +1 -1
  428. package/dist/detectors/signals.js +91 -52
  429. package/dist/detectors/signals.js.map +1 -1
  430. package/dist/detectors/structure-tree.d.ts.map +1 -1
  431. package/dist/detectors/structure-tree.js +21 -19
  432. package/dist/detectors/structure-tree.js.map +1 -1
  433. package/dist/detectors/structure.d.ts.map +1 -1
  434. package/dist/detectors/structure.js +2 -1
  435. package/dist/detectors/structure.js.map +1 -1
  436. package/dist/detectors/subject-name-line.d.ts +8 -0
  437. package/dist/detectors/subject-name-line.d.ts.map +1 -0
  438. package/dist/detectors/subject-name-line.js +53 -0
  439. package/dist/detectors/subject-name-line.js.map +1 -0
  440. package/dist/detectors/table-header.d.ts.map +1 -1
  441. package/dist/detectors/table-header.js +13 -1
  442. package/dist/detectors/table-header.js.map +1 -1
  443. package/dist/detectors/technical-docs.d.ts.map +1 -1
  444. package/dist/detectors/technical-docs.js +4 -1
  445. package/dist/detectors/technical-docs.js.map +1 -1
  446. package/dist/detectors/template-sections.d.ts +14 -0
  447. package/dist/detectors/template-sections.d.ts.map +1 -0
  448. package/dist/detectors/template-sections.js +25 -0
  449. package/dist/detectors/template-sections.js.map +1 -0
  450. package/dist/detectors/term-mention-sentence.d.ts +4 -0
  451. package/dist/detectors/term-mention-sentence.d.ts.map +1 -0
  452. package/dist/detectors/term-mention-sentence.js +28 -0
  453. package/dist/detectors/term-mention-sentence.js.map +1 -0
  454. package/dist/detectors/titled-run.d.ts +23 -0
  455. package/dist/detectors/titled-run.d.ts.map +1 -0
  456. package/dist/detectors/titled-run.js +39 -0
  457. package/dist/detectors/titled-run.js.map +1 -0
  458. package/dist/detectors/token-shape.d.ts.map +1 -1
  459. package/dist/detectors/token-shape.js +13 -5
  460. package/dist/detectors/token-shape.js.map +1 -1
  461. package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
  462. package/dist/detectors/unbalanced-bracket.js +4 -0
  463. package/dist/detectors/unbalanced-bracket.js.map +1 -1
  464. package/dist/detectors/undefined-term.d.ts.map +1 -1
  465. package/dist/detectors/undefined-term.js +8 -0
  466. package/dist/detectors/undefined-term.js.map +1 -1
  467. package/dist/detectors/unfilled-placeholder.d.ts +4 -0
  468. package/dist/detectors/unfilled-placeholder.d.ts.map +1 -0
  469. package/dist/detectors/unfilled-placeholder.js +9 -0
  470. package/dist/detectors/unfilled-placeholder.js.map +1 -0
  471. package/dist/detectors/vague-density.d.ts +8 -0
  472. package/dist/detectors/vague-density.d.ts.map +1 -0
  473. package/dist/detectors/vague-density.js +65 -0
  474. package/dist/detectors/vague-density.js.map +1 -0
  475. package/dist/document-paragraphs.d.ts +4 -0
  476. package/dist/document-paragraphs.d.ts.map +1 -0
  477. package/dist/document-paragraphs.js +24 -0
  478. package/dist/document-paragraphs.js.map +1 -0
  479. package/dist/document.d.ts.map +1 -1
  480. package/dist/document.js +2 -19
  481. package/dist/document.js.map +1 -1
  482. package/dist/facts/fact-scope.d.ts +10 -1
  483. package/dist/facts/fact-scope.d.ts.map +1 -1
  484. package/dist/facts/fact-scope.js +34 -3
  485. package/dist/facts/fact-scope.js.map +1 -1
  486. package/dist/facts/table-facts.d.ts +12 -2
  487. package/dist/facts/table-facts.d.ts.map +1 -1
  488. package/dist/facts/table-facts.js +22 -4
  489. package/dist/facts/table-facts.js.map +1 -1
  490. package/dist/figure-references.d.ts +3 -0
  491. package/dist/figure-references.d.ts.map +1 -1
  492. package/dist/figure-references.js +6 -2
  493. package/dist/figure-references.js.map +1 -1
  494. package/dist/format-template.d.ts +3 -0
  495. package/dist/format-template.d.ts.map +1 -0
  496. package/dist/format-template.js +13 -0
  497. package/dist/format-template.js.map +1 -0
  498. package/dist/formula-brackets.d.ts +7 -0
  499. package/dist/formula-brackets.d.ts.map +1 -0
  500. package/dist/formula-brackets.js +29 -0
  501. package/dist/formula-brackets.js.map +1 -0
  502. package/dist/grade-api.d.ts +9 -2
  503. package/dist/grade-api.d.ts.map +1 -1
  504. package/dist/grade-api.js +31 -15
  505. package/dist/grade-api.js.map +1 -1
  506. package/dist/heading-numbering.d.ts +5 -2
  507. package/dist/heading-numbering.d.ts.map +1 -1
  508. package/dist/heading-numbering.js +27 -6
  509. package/dist/heading-numbering.js.map +1 -1
  510. package/dist/html/html-markdown.d.ts.map +1 -1
  511. package/dist/html/html-markdown.js +2 -1
  512. package/dist/html/html-markdown.js.map +1 -1
  513. package/dist/html/html-site-chrome.d.ts +5 -0
  514. package/dist/html/html-site-chrome.d.ts.map +1 -0
  515. package/dist/html/html-site-chrome.js +33 -0
  516. package/dist/html/html-site-chrome.js.map +1 -0
  517. package/dist/joined-view.d.ts.map +1 -1
  518. package/dist/joined-view.js +1 -0
  519. package/dist/joined-view.js.map +1 -1
  520. package/dist/kanji-compound-slip.d.ts +32 -0
  521. package/dist/kanji-compound-slip.d.ts.map +1 -0
  522. package/dist/kanji-compound-slip.js +63 -0
  523. package/dist/kanji-compound-slip.js.map +1 -0
  524. package/dist/latin-company-form.d.ts +6 -0
  525. package/dist/latin-company-form.d.ts.map +1 -0
  526. package/dist/latin-company-form.js +32 -0
  527. package/dist/latin-company-form.js.map +1 -0
  528. package/dist/latin-word-boundary.d.ts +15 -0
  529. package/dist/latin-word-boundary.d.ts.map +1 -0
  530. package/dist/latin-word-boundary.js +40 -0
  531. package/dist/latin-word-boundary.js.map +1 -0
  532. package/dist/lexicon-genres.d.ts +2 -0
  533. package/dist/lexicon-genres.d.ts.map +1 -1
  534. package/dist/lexicon-genres.js +1 -1
  535. package/dist/lexicon-genres.js.map +1 -1
  536. package/dist/link-shape.d.ts +5 -0
  537. package/dist/link-shape.d.ts.map +1 -1
  538. package/dist/link-shape.js +18 -0
  539. package/dist/link-shape.js.map +1 -1
  540. package/dist/link-title.d.ts +4 -0
  541. package/dist/link-title.d.ts.map +1 -0
  542. package/dist/link-title.js +33 -0
  543. package/dist/link-title.js.map +1 -0
  544. package/dist/list-item-paragraphs.d.ts +15 -0
  545. package/dist/list-item-paragraphs.d.ts.map +1 -0
  546. package/dist/list-item-paragraphs.js +19 -0
  547. package/dist/list-item-paragraphs.js.map +1 -0
  548. package/dist/literal-quote.d.ts +12 -0
  549. package/dist/literal-quote.d.ts.map +1 -0
  550. package/dist/literal-quote.js +43 -0
  551. package/dist/literal-quote.js.map +1 -0
  552. package/dist/nado-closed-list.d.ts.map +1 -1
  553. package/dist/nado-closed-list.js +39 -5
  554. package/dist/nado-closed-list.js.map +1 -1
  555. package/dist/name-end-letter.d.ts +5 -0
  556. package/dist/name-end-letter.d.ts.map +1 -1
  557. package/dist/name-end-letter.js +8 -0
  558. package/dist/name-end-letter.js.map +1 -1
  559. package/dist/name-given-before.d.ts +15 -0
  560. package/dist/name-given-before.d.ts.map +1 -0
  561. package/dist/name-given-before.js +30 -0
  562. package/dist/name-given-before.js.map +1 -0
  563. package/dist/name-separator.d.ts +2 -2
  564. package/dist/name-separator.d.ts.map +1 -1
  565. package/dist/name-separator.js +79 -5
  566. package/dist/name-separator.js.map +1 -1
  567. package/dist/name-variants.d.ts +3 -1
  568. package/dist/name-variants.d.ts.map +1 -1
  569. package/dist/name-variants.js +8 -7
  570. package/dist/name-variants.js.map +1 -1
  571. package/dist/name-word-order.d.ts +9 -5
  572. package/dist/name-word-order.d.ts.map +1 -1
  573. package/dist/name-word-order.js +47 -15
  574. package/dist/name-word-order.js.map +1 -1
  575. package/dist/nominal-stem.d.ts +26 -0
  576. package/dist/nominal-stem.d.ts.map +1 -0
  577. package/dist/nominal-stem.js +70 -0
  578. package/dist/nominal-stem.js.map +1 -0
  579. package/dist/person-forms.d.ts +8 -0
  580. package/dist/person-forms.d.ts.map +1 -1
  581. package/dist/person-forms.js +12 -0
  582. package/dist/person-forms.js.map +1 -1
  583. package/dist/plugin.d.ts +5 -0
  584. package/dist/plugin.d.ts.map +1 -1
  585. package/dist/preamble-paragraphs.d.ts +3 -2
  586. package/dist/preamble-paragraphs.d.ts.map +1 -1
  587. package/dist/preamble-paragraphs.js +8 -2
  588. package/dist/preamble-paragraphs.js.map +1 -1
  589. package/dist/sentence-load.d.ts +2 -1
  590. package/dist/sentence-load.d.ts.map +1 -1
  591. package/dist/sentence-load.js +6 -2
  592. package/dist/sentence-load.js.map +1 -1
  593. package/dist/spacing-code.d.ts +1 -0
  594. package/dist/spacing-code.d.ts.map +1 -1
  595. package/dist/spacing-code.js +4 -1
  596. package/dist/spacing-code.js.map +1 -1
  597. package/dist/split-noun.d.ts +10 -0
  598. package/dist/split-noun.d.ts.map +1 -0
  599. package/dist/split-noun.js +50 -0
  600. package/dist/split-noun.js.map +1 -0
  601. package/dist/structure/attached-parts.d.ts +11 -0
  602. package/dist/structure/attached-parts.d.ts.map +1 -0
  603. package/dist/structure/attached-parts.js +31 -0
  604. package/dist/structure/attached-parts.js.map +1 -0
  605. package/dist/structure/build.d.ts.map +1 -1
  606. package/dist/structure/build.js +7 -4
  607. package/dist/structure/build.js.map +1 -1
  608. package/dist/structure/cited-document-section.d.ts +7 -0
  609. package/dist/structure/cited-document-section.d.ts.map +1 -0
  610. package/dist/structure/cited-document-section.js +33 -0
  611. package/dist/structure/cited-document-section.js.map +1 -0
  612. package/dist/structure/contents-lines.d.ts +7 -0
  613. package/dist/structure/contents-lines.d.ts.map +1 -0
  614. package/dist/structure/contents-lines.js +51 -0
  615. package/dist/structure/contents-lines.js.map +1 -0
  616. package/dist/structure/defining-names.d.ts +37 -0
  617. package/dist/structure/defining-names.d.ts.map +1 -0
  618. package/dist/structure/defining-names.js +122 -0
  619. package/dist/structure/defining-names.js.map +1 -0
  620. package/dist/structure/definition-use.d.ts +3 -2
  621. package/dist/structure/definition-use.d.ts.map +1 -1
  622. package/dist/structure/definition-use.js +99 -31
  623. package/dist/structure/definition-use.js.map +1 -1
  624. package/dist/structure/html-text-blocks.d.ts +8 -0
  625. package/dist/structure/html-text-blocks.d.ts.map +1 -0
  626. package/dist/structure/html-text-blocks.js +47 -0
  627. package/dist/structure/html-text-blocks.js.map +1 -0
  628. package/dist/structure/issues.d.ts +5 -2
  629. package/dist/structure/issues.d.ts.map +1 -1
  630. package/dist/structure/issues.js +24 -6
  631. package/dist/structure/issues.js.map +1 -1
  632. package/dist/structure/labelled-date-order.d.ts +4 -1
  633. package/dist/structure/labelled-date-order.d.ts.map +1 -1
  634. package/dist/structure/labelled-date-order.js +2 -2
  635. package/dist/structure/labelled-date-order.js.map +1 -1
  636. package/dist/structure/labelled-order.d.ts +3 -0
  637. package/dist/structure/labelled-order.d.ts.map +1 -1
  638. package/dist/structure/labelled-order.js +8 -3
  639. package/dist/structure/labelled-order.js.map +1 -1
  640. package/dist/structure/list-lead-in.d.ts +19 -0
  641. package/dist/structure/list-lead-in.d.ts.map +1 -0
  642. package/dist/structure/list-lead-in.js +85 -0
  643. package/dist/structure/list-lead-in.js.map +1 -0
  644. package/dist/structure/list-numbering.d.ts +20 -4
  645. package/dist/structure/list-numbering.d.ts.map +1 -1
  646. package/dist/structure/list-numbering.js +65 -9
  647. package/dist/structure/list-numbering.js.map +1 -1
  648. package/dist/structure/listed-paragraph.d.ts +16 -0
  649. package/dist/structure/listed-paragraph.d.ts.map +1 -0
  650. package/dist/structure/listed-paragraph.js +37 -0
  651. package/dist/structure/listed-paragraph.js.map +1 -0
  652. package/dist/structure/modal-conflict.d.ts +7 -2
  653. package/dist/structure/modal-conflict.d.ts.map +1 -1
  654. package/dist/structure/modal-conflict.js +36 -7
  655. package/dist/structure/modal-conflict.js.map +1 -1
  656. package/dist/structure/negated-act.d.ts +17 -0
  657. package/dist/structure/negated-act.d.ts.map +1 -0
  658. package/dist/structure/negated-act.js +32 -0
  659. package/dist/structure/negated-act.js.map +1 -0
  660. package/dist/structure/numbering.d.ts +5 -2
  661. package/dist/structure/numbering.d.ts.map +1 -1
  662. package/dist/structure/numbering.js +49 -12
  663. package/dist/structure/numbering.js.map +1 -1
  664. package/dist/structure/prose-total.d.ts +4 -0
  665. package/dist/structure/prose-total.d.ts.map +1 -1
  666. package/dist/structure/prose-total.js +16 -6
  667. package/dist/structure/prose-total.js.map +1 -1
  668. package/dist/structure/reference-text.d.ts +9 -1
  669. package/dist/structure/reference-text.d.ts.map +1 -1
  670. package/dist/structure/reference-text.js +21 -3
  671. package/dist/structure/reference-text.js.map +1 -1
  672. package/dist/structure/repeated-number.d.ts +24 -0
  673. package/dist/structure/repeated-number.d.ts.map +1 -0
  674. package/dist/structure/repeated-number.js +89 -0
  675. package/dist/structure/repeated-number.js.map +1 -0
  676. package/dist/structure/rounded-amount.d.ts +8 -0
  677. package/dist/structure/rounded-amount.d.ts.map +1 -0
  678. package/dist/structure/rounded-amount.js +48 -0
  679. package/dist/structure/rounded-amount.js.map +1 -0
  680. package/dist/structure/section-names.d.ts +12 -0
  681. package/dist/structure/section-names.d.ts.map +1 -0
  682. package/dist/structure/section-names.js +26 -0
  683. package/dist/structure/section-names.js.map +1 -0
  684. package/dist/structure/side-step.d.ts +8 -0
  685. package/dist/structure/side-step.d.ts.map +1 -0
  686. package/dist/structure/side-step.js +21 -0
  687. package/dist/structure/side-step.js.map +1 -0
  688. package/dist/structure/spanned-label-blank.d.ts +8 -0
  689. package/dist/structure/spanned-label-blank.d.ts.map +1 -0
  690. package/dist/structure/spanned-label-blank.js +37 -0
  691. package/dist/structure/spanned-label-blank.js.map +1 -0
  692. package/dist/structure/universal.d.ts +3 -1
  693. package/dist/structure/universal.d.ts.map +1 -1
  694. package/dist/structure/universal.js +9 -2
  695. package/dist/structure/universal.js.map +1 -1
  696. package/dist/structure/unspaced-heading.d.ts +10 -0
  697. package/dist/structure/unspaced-heading.d.ts.map +1 -0
  698. package/dist/structure/unspaced-heading.js +24 -0
  699. package/dist/structure/unspaced-heading.js.map +1 -0
  700. package/dist/structure/versioned-label.d.ts +16 -0
  701. package/dist/structure/versioned-label.d.ts.map +1 -0
  702. package/dist/structure/versioned-label.js +48 -0
  703. package/dist/structure/versioned-label.js.map +1 -0
  704. package/dist/structure/written-headings.d.ts +31 -0
  705. package/dist/structure/written-headings.d.ts.map +1 -0
  706. package/dist/structure/written-headings.js +119 -0
  707. package/dist/structure/written-headings.js.map +1 -0
  708. package/dist/structure/written-list-path.d.ts +10 -0
  709. package/dist/structure/written-list-path.d.ts.map +1 -0
  710. package/dist/structure/written-list-path.js +37 -0
  711. package/dist/structure/written-list-path.js.map +1 -0
  712. package/dist/structure/written-resolve.d.ts +12 -0
  713. package/dist/structure/written-resolve.d.ts.map +1 -0
  714. package/dist/structure/written-resolve.js +55 -0
  715. package/dist/structure/written-resolve.js.map +1 -0
  716. package/dist/title-line.d.ts +21 -0
  717. package/dist/title-line.d.ts.map +1 -0
  718. package/dist/title-line.js +27 -0
  719. package/dist/title-line.js.map +1 -0
  720. package/package.json +3 -3
  721. package/rules/all-caps-shouting.yaml +2 -2
  722. package/rules/announced-count-mismatch.yaml +2 -2
  723. package/rules/bare-url-mix.yaml +2 -2
  724. package/rules/bracket-nesting.yaml +2 -2
  725. package/rules/bracket-width-consistency.yaml +2 -2
  726. package/rules/broken-link.yaml +2 -2
  727. package/rules/cliche.yaml +4 -3
  728. package/rules/code-fence-language-mix.yaml +2 -2
  729. package/rules/comparative-without-baseline.yaml +2 -2
  730. package/rules/concrete-evidence-density.yaml +2 -2
  731. package/rules/contraction-consistency.yaml +13 -13
  732. package/rules/dangling-figure-reference.yaml +2 -2
  733. package/rules/dangling-reference.yaml +2 -2
  734. package/rules/date-without-year.yaml +10 -2
  735. package/rules/defined-name-repeated.yaml +2 -2
  736. package/rules/defined-term-form.yaml +2 -2
  737. package/rules/doubled-punctuation.yaml +4 -4
  738. package/rules/doubled-word.yaml +2 -2
  739. package/rules/duplicate-definition.yaml +2 -2
  740. package/rules/duration-mismatch.yaml +2 -2
  741. package/rules/email-greeting-closing.yaml +2 -2
  742. package/rules/email-subject-length.yaml +2 -2
  743. package/rules/empty-table-cell.yaml +2 -2
  744. package/rules/fact-conflict.yaml +2 -2
  745. package/rules/footnote-mismatch.yaml +2 -2
  746. package/rules/heading-echo.yaml +2 -2
  747. package/rules/heading-end-punctuation-mix.yaml +2 -2
  748. package/rules/heading-numbering-mix.yaml +2 -2
  749. package/rules/ime-residue.yaml +2 -2
  750. package/rules/kanji-compound-slip.yaml +67 -0
  751. package/rules/kutoten-consistency.yaml +4 -4
  752. package/rules/latin-spacing.yaml +4 -4
  753. package/rules/list-item-form-mix.yaml +2 -2
  754. package/rules/max-kanji-continuous.yaml +7 -3
  755. package/rules/max-sentence-length.yaml +3 -2
  756. package/rules/modal-conflict.yaml +1 -0
  757. package/rules/nado-closed-list.yaml +2 -2
  758. package/rules/name-variant.yaml +2 -2
  759. package/rules/ngram-repetition.yaml +2 -2
  760. package/rules/no-doubled-joshi.yaml +2 -2
  761. package/rules/no-mixed-desumasu.yaml +3 -3
  762. package/rules/no-nakaguro-parallel.yaml +2 -0
  763. package/rules/number-without-unit.yaml +9 -4
  764. package/rules/numbering-gap.yaml +7 -2
  765. package/rules/numeral-sentence-start.yaml +2 -2
  766. package/rules/obligation-without-deadline.yaml +2 -2
  767. package/rules/orthographic-variant.yaml +2 -2
  768. package/rules/oxford-comma-consistency.yaml +3 -3
  769. package/rules/preamble-length.yaml +2 -2
  770. package/rules/reference-title-mismatch.yaml +2 -2
  771. package/rules/repeated-sentence-ending.yaml +3 -2
  772. package/rules/request-without-deadline.yaml +2 -2
  773. package/rules/requirement-smell.yaml +3 -3
  774. package/rules/sentence-rhythm.yaml +2 -2
  775. package/rules/table-header-variant.yaml +2 -2
  776. package/rules/teki-overuse.yaml +3 -2
  777. package/rules/title-case-consistency.yaml +2 -2
  778. package/rules/total-mismatch.yaml +2 -2
  779. package/rules/translationese-density.yaml +2 -2
  780. package/rules/unbalanced-bracket.yaml +2 -2
  781. package/rules/undefined-acronym.yaml +15 -4
  782. package/rules/undefined-term.yaml +2 -2
  783. package/rules/unfilled-placeholder.yaml +4 -4
  784. package/rules/use-before-definition.yaml +2 -2
  785. package/rules/vague-word-density.yaml +2 -2
  786. package/skills/chaff/SKILL.md +7 -1
  787. package/src/announced-count.ts +35 -8
  788. package/src/capitals-passage.ts +31 -0
  789. package/src/chronology-rows.ts +86 -0
  790. package/src/coined-hyphen-name.ts +27 -0
  791. package/src/company-name-run.ts +37 -0
  792. package/src/company-names.ts +24 -3
  793. package/src/compound-head.ts +25 -0
  794. package/src/date-format.ts +43 -4
  795. package/src/derived/count-per-period.ts +28 -0
  796. package/src/detectors/acronym-context.ts +34 -6
  797. package/src/detectors/acronym-definition.ts +123 -0
  798. package/src/detectors/acronym-expansion.ts +47 -6
  799. package/src/detectors/acronym-known.ts +40 -0
  800. package/src/detectors/acronym-link.ts +37 -0
  801. package/src/detectors/acronym-lone.ts +26 -0
  802. package/src/detectors/acronym-name.ts +140 -0
  803. package/src/detectors/addressee-edge.ts +16 -0
  804. package/src/detectors/announced-count.ts +1 -0
  805. package/src/detectors/bare-comparative.ts +44 -3
  806. package/src/detectors/blank-structure.ts +21 -10
  807. package/src/detectors/bracket-specified.ts +25 -0
  808. package/src/detectors/broken-link.ts +26 -2
  809. package/src/detectors/capitalised-term.ts +154 -4
  810. package/src/detectors/caps-caption.ts +103 -0
  811. package/src/detectors/caps-phrase.ts +17 -0
  812. package/src/detectors/char-shape.ts +99 -26
  813. package/src/detectors/cited-title.ts +15 -3
  814. package/src/detectors/clause-shape.ts +14 -4
  815. package/src/detectors/concrete-evidence.ts +77 -1
  816. package/src/detectors/contraction-minority.ts +11 -0
  817. package/src/detectors/counter-edge.ts +40 -2
  818. package/src/detectors/date-any-year.ts +79 -12
  819. package/src/detectors/date-format.ts +2 -1
  820. package/src/detectors/date-heading-year.ts +55 -0
  821. package/src/detectors/date-year.ts +107 -14
  822. package/src/detectors/deadline-unit.ts +40 -0
  823. package/src/detectors/defined-term-form.ts +58 -17
  824. package/src/detectors/definition-use.ts +7 -3
  825. package/src/detectors/derived-numbers.ts +19 -4
  826. package/src/detectors/doubled-across-aside.ts +36 -0
  827. package/src/detectors/doubled-punctuation.ts +28 -7
  828. package/src/detectors/doubled-word.ts +2 -1
  829. package/src/detectors/due-date.ts +10 -1
  830. package/src/detectors/ellipsis.ts +16 -1
  831. package/src/detectors/email-letter.ts +97 -21
  832. package/src/detectors/en-shape.ts +5 -1
  833. package/src/detectors/fact-consistency.ts +3 -2
  834. package/src/detectors/field-label.ts +25 -0
  835. package/src/detectors/footnote-mismatch.ts +39 -7
  836. package/src/detectors/graded-step.ts +52 -0
  837. package/src/detectors/gram-openers.ts +21 -0
  838. package/src/detectors/gram-passages.ts +36 -0
  839. package/src/detectors/gram-place.ts +10 -1
  840. package/src/detectors/gram-predicate.ts +43 -3
  841. package/src/detectors/heading-echo.ts +31 -3
  842. package/src/detectors/heading-end-mark.ts +23 -10
  843. package/src/detectors/heading-names.ts +31 -0
  844. package/src/detectors/heading-numbering.ts +7 -2
  845. package/src/detectors/ime-residue.ts +4 -3
  846. package/src/detectors/inch-mark.ts +49 -0
  847. package/src/detectors/kanji-compound-slip.ts +61 -0
  848. package/src/detectors/kutoten-consistency.ts +93 -14
  849. package/src/detectors/lexicon.ts +44 -24
  850. package/src/detectors/link-shape.ts +10 -3
  851. package/src/detectors/list-item-ending.ts +51 -0
  852. package/src/detectors/list-parallel.ts +158 -33
  853. package/src/detectors/list-sentence.ts +5 -1
  854. package/src/detectors/mark-shape.ts +70 -10
  855. package/src/detectors/mentioned-phrase.ts +38 -0
  856. package/src/detectors/middle-dot.ts +7 -2
  857. package/src/detectors/modal-conflict.ts +5 -2
  858. package/src/detectors/name-variant-apart.ts +63 -0
  859. package/src/detectors/name-variant.ts +30 -12
  860. package/src/detectors/notice-paragraph.ts +33 -0
  861. package/src/detectors/number-style.ts +14 -2
  862. package/src/detectors/number-unit.ts +28 -1
  863. package/src/detectors/numeral-opener.ts +27 -1
  864. package/src/detectors/numeral-word.ts +33 -0
  865. package/src/detectors/obligation-without-deadline.ts +29 -4
  866. package/src/detectors/open-end-class.ts +78 -0
  867. package/src/detectors/open-end-condition.ts +40 -0
  868. package/src/detectors/open-end-names.ts +9 -3
  869. package/src/detectors/open-end-question.ts +50 -0
  870. package/src/detectors/open-end-scope.ts +62 -0
  871. package/src/detectors/opening-date.ts +47 -0
  872. package/src/detectors/ordinary-phrase.ts +62 -0
  873. package/src/detectors/organisation-run.ts +97 -0
  874. package/src/detectors/orthographic-variant.ts +103 -27
  875. package/src/detectors/orthography.ts +10 -1
  876. package/src/detectors/outline-label.ts +48 -0
  877. package/src/detectors/oxford-comma.ts +40 -1
  878. package/src/detectors/page-marker.ts +26 -0
  879. package/src/detectors/parallel-definition.ts +64 -0
  880. package/src/detectors/person-consistency.ts +5 -3
  881. package/src/detectors/phrase-match.ts +16 -5
  882. package/src/detectors/placeholder-text.ts +18 -3
  883. package/src/detectors/placeholder.ts +10 -3
  884. package/src/detectors/postcode-end.ts +16 -0
  885. package/src/detectors/prose-total-words.ts +18 -0
  886. package/src/detectors/reference-text.ts +1 -0
  887. package/src/detectors/registry/kanji-compound-slip.ts +4 -0
  888. package/src/detectors/registry/phrase-in-use.ts +4 -0
  889. package/src/detectors/registry/unfilled-placeholder.ts +2 -2
  890. package/src/detectors/registry/vague-density.ts +1 -1
  891. package/src/detectors/request-owner.ts +71 -8
  892. package/src/detectors/requirement-smell.ts +53 -7
  893. package/src/detectors/scaled-figure-unit.ts +103 -0
  894. package/src/detectors/sentence-counts.ts +24 -8
  895. package/src/detectors/sentence-ending.ts +12 -3
  896. package/src/detectors/sentence-length.ts +14 -6
  897. package/src/detectors/sentence-load.ts +9 -2
  898. package/src/detectors/sentence-rhythm.ts +8 -4
  899. package/src/detectors/series-label.ts +13 -4
  900. package/src/detectors/signals.ts +105 -55
  901. package/src/detectors/structure-tree.ts +22 -20
  902. package/src/detectors/structure.ts +2 -1
  903. package/src/detectors/subject-name-line.ts +66 -0
  904. package/src/detectors/table-header.ts +15 -1
  905. package/src/detectors/technical-docs.ts +5 -1
  906. package/src/detectors/template-sections.ts +37 -0
  907. package/src/detectors/term-mention-sentence.ts +31 -0
  908. package/src/detectors/titled-run.ts +48 -0
  909. package/src/detectors/token-shape.ts +14 -5
  910. package/src/detectors/unbalanced-bracket.ts +3 -0
  911. package/src/detectors/undefined-term.ts +8 -0
  912. package/src/detectors/unfilled-placeholder.ts +10 -0
  913. package/src/detectors/vague-density.ts +84 -0
  914. package/src/document-paragraphs.ts +27 -0
  915. package/src/document.ts +3 -23
  916. package/src/facts/fact-scope.ts +53 -4
  917. package/src/facts/table-facts.ts +43 -6
  918. package/src/figure-references.ts +7 -2
  919. package/src/format-template.ts +15 -0
  920. package/src/formula-brackets.ts +36 -0
  921. package/src/grade-api.ts +38 -16
  922. package/src/heading-numbering.ts +35 -8
  923. package/src/html/html-markdown.ts +2 -1
  924. package/src/html/html-site-chrome.ts +47 -0
  925. package/src/joined-view.ts +1 -0
  926. package/src/kanji-compound-slip.ts +98 -0
  927. package/src/latin-company-form.ts +38 -0
  928. package/src/latin-word-boundary.ts +46 -0
  929. package/src/lexicon-genres.ts +1 -1
  930. package/src/link-shape.ts +19 -0
  931. package/src/link-title.ts +38 -0
  932. package/src/list-item-paragraphs.ts +22 -0
  933. package/src/literal-quote.ts +55 -0
  934. package/src/nado-closed-list.ts +48 -5
  935. package/src/name-end-letter.ts +9 -0
  936. package/src/name-given-before.ts +40 -0
  937. package/src/name-separator.ts +91 -5
  938. package/src/name-variants.ts +21 -11
  939. package/src/name-word-order.ts +62 -17
  940. package/src/nominal-stem.ts +93 -0
  941. package/src/person-forms.ts +15 -0
  942. package/src/plugin.ts +5 -0
  943. package/src/preamble-paragraphs.ts +13 -3
  944. package/src/sentence-load.ts +7 -2
  945. package/src/spacing-code.ts +5 -1
  946. package/src/split-noun.ts +63 -0
  947. package/src/structure/attached-parts.ts +32 -0
  948. package/src/structure/build.ts +7 -4
  949. package/src/structure/cited-document-section.ts +42 -0
  950. package/src/structure/contents-lines.ts +63 -0
  951. package/src/structure/defining-names.ts +155 -0
  952. package/src/structure/definition-use.ts +116 -25
  953. package/src/structure/html-text-blocks.ts +45 -0
  954. package/src/structure/issues.ts +26 -7
  955. package/src/structure/labelled-date-order.ts +5 -2
  956. package/src/structure/labelled-order.ts +12 -3
  957. package/src/structure/list-lead-in.ts +94 -0
  958. package/src/structure/list-numbering.ts +100 -11
  959. package/src/structure/listed-paragraph.ts +45 -0
  960. package/src/structure/modal-conflict.ts +42 -7
  961. package/src/structure/negated-act.ts +49 -0
  962. package/src/structure/numbering.ts +70 -26
  963. package/src/structure/prose-total.ts +20 -6
  964. package/src/structure/reference-text.ts +25 -3
  965. package/src/structure/repeated-number.ts +110 -0
  966. package/src/structure/rounded-amount.ts +55 -0
  967. package/src/structure/section-names.ts +32 -0
  968. package/src/structure/side-step.ts +21 -0
  969. package/src/structure/spanned-label-blank.ts +39 -0
  970. package/src/structure/universal.ts +11 -2
  971. package/src/structure/unspaced-heading.ts +27 -0
  972. package/src/structure/versioned-label.ts +52 -0
  973. package/src/structure/written-headings.ts +137 -0
  974. package/src/structure/written-list-path.ts +46 -0
  975. package/src/structure/written-resolve.ts +64 -0
  976. package/src/title-line.ts +52 -0
@@ -1,17 +1,42 @@
1
1
  // A date written without its year where the reader cannot tell which year it is: the document's dated dates span more
2
2
  // than one year, or its dates cross the turn of a year. Pure; reads the date nodes of the structure tree.
3
- import type { Detector, Finding, LexiconEntry, ProseDocument, StructureNode } from "../plugin.ts";
3
+ import type { Detector, DetectorOptions, Finding, LexiconEntry, ProseDocument, StructureNode } from "../plugin.ts";
4
+ import { isIn } from "../lexicon-genres.ts";
4
5
  import { inDocumentOrder } from "../structure/issues.ts";
5
6
  import { quoteAt } from "./structure-tree.ts";
6
- import { ANY_YEAR_MARKER_LEXICON, YEAR_SPAN_JOINER_LEXICON, anyYearDate, opensSpan, type AnyYearMarker, type MarkerReach } from "./date-any-year.ts";
7
+ import {
8
+ ANY_YEAR_MARKER_LEXICON,
9
+ MARKER_REACHES,
10
+ YEAR_SPAN_JOINER_LEXICON,
11
+ anyYearDate,
12
+ opensSpan,
13
+ type AnyYearMarker,
14
+ type MarkerReach,
15
+ } from "./date-any-year.ts";
16
+ import { datesUnderYearHeadings, yearLabelOf, type HeadingYearWords } from "./date-heading-year.ts";
17
+ import { openingDateOf } from "./opening-date.ts";
18
+ import { withNearestYear } from "../structure/weekday.ts";
7
19
 
8
- /** The words that make a yearless date any year's (毎年, 例えば, "each") and that join a period's two ends (から, "to"). */
9
- export type AnyYearWords = { readonly markers: readonly AnyYearMarker[]; readonly joiners: readonly string[] };
20
+ /**
21
+ * The words that make a yearless date any year's (毎年, 例えば, "each"), that join a period's two ends (から, "to"), and
22
+ * that join the names of one list (及び, "and"), for a marker named in one list with the date.
23
+ */
24
+ export type AnyYearWords = { readonly markers: readonly AnyYearMarker[]; readonly joiners: readonly string[]; readonly listJoiners?: readonly string[] };
10
25
 
11
26
  const NO_ANY_YEAR_WORDS: AnyYearWords = { markers: [], joiners: [] };
12
27
 
13
- /** A date as the tree reads it: "2026-10-14" with its year, "10-14" without. */
14
- export type DatePoint = { readonly offset: number; readonly end: number; readonly value: string };
28
+ /**
29
+ * A date as the tree reads it: "2026-10-14" with its year, "10-14" without. `yearHeaded`: the heading of its section
30
+ * names a year ("FY27-Q2 (May 1)", 「2026年度の予定」), which the date takes. `nearStamp`: the document's own date (minutes
31
+ * dated "January 17, 2024") lies within a few months of it in one year only, which the date takes.
32
+ */
33
+ export type DatePoint = {
34
+ readonly offset: number;
35
+ readonly end: number;
36
+ readonly value: string;
37
+ readonly yearHeaded?: boolean;
38
+ readonly nearStamp?: boolean;
39
+ };
15
40
 
16
41
  /** The first and the last year of the document's dated dates. */
17
42
  export type YearSpan = { readonly from: number; readonly to: number };
@@ -106,9 +131,24 @@ const hasYearWord = (point: DatePoint, source: string, yearWords: readonly YearW
106
131
  */
107
132
  const yearGiven = (point: DatePoint, anchors: readonly DatePoint[], source: string, yearWords: readonly YearWord[]): boolean => {
108
133
  const start = lineStart(source, point.offset);
109
- return hasYearWord(point, source, yearWords) || anchors.some((other) => other.offset >= start && other.offset < point.offset);
134
+ const placed = point.yearHeaded === true || point.nearStamp === true;
135
+ return placed || hasYearWord(point, source, yearWords) || anchors.some((other) => other.offset >= start && other.offset < point.offset);
110
136
  };
111
137
 
138
+ const DAY_MS = 24 * 60 * 60 * 1000;
139
+ const COMMON_YEAR_MS = 365 * DAY_MS;
140
+ /** A year with no 29 February, so that "03-01" follows "02-28" as it does in most years. */
141
+ const COMMON_YEAR = 2025;
142
+
143
+ const dayOf = (value: string): number => Date.UTC(COMMON_YEAR, Number(value.slice(0, 2)) - 1, Number(value.slice(3, 5)));
144
+
145
+ /**
146
+ * A period of one whole year: its end is the day before its start (January 1 to December 31, 4月1日から3月31日). Without
147
+ * a year it is every year's, like a calendar or a fiscal year.
148
+ */
149
+ export const wholeYear = (start: string, end: string): boolean =>
150
+ MONTH_DAY.test(start) && MONTH_DAY.test(end) && (dayOf(end) + DAY_MS - dayOf(start)) % COMMON_YEAR_MS === 0;
151
+
112
152
  /**
113
153
  * The yearless dates whose year the reader cannot tell. Where most dates carry a year (at least two, and more than the
114
154
  * yearless ones) and those years differ, every yearless one is reported: in a one-year document the year is plain. Where
@@ -124,9 +164,17 @@ export const yearGaps = (
124
164
  const dated = points.filter((point) => FULL.test(point.value));
125
165
  const anchors = [...dated, ...points.filter((point) => hasYearWord(point, source, yearWords))];
126
166
  const nextOf = new Map(points.map((point, index) => [point, points[index + 1]]));
167
+ const previousOf = new Map(points.map((point, index) => [point, points[index - 1]]));
168
+ const yearlySpan = (start: DatePoint | undefined, end: DatePoint | undefined): boolean =>
169
+ start !== undefined && end !== undefined && wholeYear(start.value, end.value) && opensSpan(start, end, source, anyYear.joiners);
170
+ const markedAnyYear = (point: DatePoint | undefined): boolean => point !== undefined && anyYearDate(point, source, anyYear.markers, anyYear.listJoiners);
127
171
  const yearOfAny = (point: DatePoint): boolean => {
128
172
  const next = nextOf.get(point);
129
- if (anyYearDate(point, source, anyYear.markers)) return true;
173
+ const previous = previousOf.get(point);
174
+ if (markedAnyYear(point)) return true;
175
+ if (yearlySpan(point, next) || yearlySpan(previous, point)) return true;
176
+ // The end of a period whose start is any year's is too: 「祝休日及び12月29日から1月3日まで」.
177
+ if (previous !== undefined && opensSpan(previous, point, source, anyYear.joiners) && markedAnyYear(previous)) return true;
130
178
  return next !== undefined && opensSpan(point, next, source, anyYear.joiners) && hasYearWord(next, source, yearWords);
131
179
  };
132
180
  // A recurring day or an example's date has no year to write, and is not the document's way of writing dates either.
@@ -134,30 +182,75 @@ export const yearGaps = (
134
182
  const span = spanOf(dated);
135
183
  const unclear = dated.length >= 2 && yearless.length < dated.length && span !== undefined && span.to > span.from;
136
184
  const datedSides = new Set(dated.flatMap((point) => sideOf(monthOf(FULL, point.value)) ?? []));
137
- const previousOf = new Map(points.map((point, index) => [point, points[index - 1]]));
138
185
  return yearless.flatMap((point): YearGap[] => {
139
186
  if (unclear) return [{ point, kind: "years", span }];
140
187
  return crossesYear(point, previousOf.get(point), datedSides) ? [{ point, kind: "boundary", span }] : [];
141
188
  });
142
189
  };
143
190
 
144
- export const datePoints = (tree: StructureNode): DatePoint[] =>
145
- inDocumentOrder(tree).flatMap((node) => (node.kind === "date" ? [{ offset: node.span.start, end: node.span.end, value: String(node.attrs["value"]) }] : []));
191
+ const NO_HEADING_YEAR_WORDS: HeadingYearWords = { eras: [], labels: [] };
192
+
193
+ /** A yearless date that the document's own date ("2024-01-17") places in one year: within a few months of it. */
194
+ const nearStampOf = (value: string, stamp: string | undefined): boolean => stamp !== undefined && withNearestYear(value, stamp) !== undefined;
195
+
196
+ export const datePoints = (tree: StructureNode, headingWords: HeadingYearWords = NO_HEADING_YEAR_WORDS, stamp?: string): DatePoint[] => {
197
+ const yearHeaded = new Set(datesUnderYearHeadings(tree, headingWords));
198
+ return inDocumentOrder(tree).flatMap((node) => {
199
+ if (node.kind !== "date") return [];
200
+ const value = String(node.attrs["value"]);
201
+ return [{ offset: node.span.start, end: node.span.end, value, yearHeaded: yearHeaded.has(node.span.start), nearStamp: nearStampOf(value, stamp) }];
202
+ });
203
+ };
204
+
205
+ /**
206
+ * The document's own date: a date alone, or labelled, on a line of its title block. A date-only paragraph further down
207
+ * (an agenda's "April 4, 2023") is a date the text talks about, not the document's.
208
+ */
209
+ const stampOf = (doc: ProseDocument, tree: StructureNode): string | undefined => {
210
+ const dates = inDocumentOrder(tree).flatMap((node) => (node.kind === "date" ? [{ ...node.span, value: String(node.attrs["value"]) }] : []));
211
+ const labels = (doc.lexicons["date-stamp-label"] ?? []).map((entry: LexiconEntry) => entry.pattern);
212
+ return openingDateOf(doc.source, dates, labels);
213
+ };
214
+
215
+ /**
216
+ * The genres whose date at the top is the occasion the text is about (minutes, a letter), from the rule's dated_genres.
217
+ * A web page's date at the top says when it was posted, and its days and months may be any year's.
218
+ */
219
+ const datedByOccasion = (options: DetectorOptions): boolean => {
220
+ const genres = options.settings?.["dated_genres"];
221
+ const genre = options.genre;
222
+ return genre !== undefined && Array.isArray(genres) && genres.some((target: string) => isIn(genre, target));
223
+ };
224
+
225
+ const pointsOf = (doc: ProseDocument, tree: StructureNode, options: DetectorOptions): DatePoint[] =>
226
+ datePoints(tree, headingYearWordsOf(doc), datedByOccasion(options) ? stampOf(doc, tree) : undefined);
146
227
 
147
228
  const yearWordsOf = (doc: ProseDocument): YearWord[] =>
148
229
  (doc.lexicons[YEAR_REFERENCE_LEXICON] ?? []).map((entry: LexiconEntry) => ({ word: entry.pattern, position: entry.position }));
149
230
 
150
- const reachOf = (group: string | undefined): MarkerReach => (group === "adjacent" || group === "label" ? group : "sentence");
231
+ /** The era names (calendar-era) and the fiscal-year names ("FY{y}" of reporting-period-frame) a heading may give a year with. */
232
+ const headingYearWordsOf = (doc: ProseDocument): HeadingYearWords => ({
233
+ eras: (doc.lexicons["calendar-era"] ?? []).map((entry: LexiconEntry) => entry.pattern),
234
+ labels: (doc.lexicons["reporting-period-frame"] ?? []).flatMap((entry: LexiconEntry) =>
235
+ entry.group === "fiscal-year" ? (yearLabelOf(entry.pattern) ?? []) : [],
236
+ ),
237
+ });
238
+
239
+ /** The words that join the names of one list (及び, "and"): a `listed` marker stands before the date with these between. */
240
+ const LIST_JOINER_LEXICON = "enumeration-joiner";
241
+
242
+ const reachOf = (group: string | undefined): MarkerReach => MARKER_REACHES.find((reach) => reach === group) ?? "sentence";
151
243
 
152
244
  const anyYearWordsOf = (doc: ProseDocument): AnyYearWords => ({
153
245
  markers: (doc.lexicons[ANY_YEAR_MARKER_LEXICON] ?? []).map((entry: LexiconEntry) => ({ word: entry.pattern, reach: reachOf(entry.group) })),
154
246
  joiners: (doc.lexicons[YEAR_SPAN_JOINER_LEXICON] ?? []).map((entry: LexiconEntry) => entry.pattern),
247
+ listJoiners: (doc.lexicons[LIST_JOINER_LEXICON] ?? []).map((entry: LexiconEntry) => entry.pattern),
155
248
  });
156
249
 
157
- export const dateWithoutYear: Detector = (doc: ProseDocument): Finding[] =>
250
+ export const dateWithoutYear: Detector = (doc: ProseDocument, options: DetectorOptions): Finding[] =>
158
251
  doc.structure === undefined
159
252
  ? []
160
- : yearGaps(datePoints(doc.structure), doc.source, yearWordsOf(doc), anyYearWordsOf(doc)).map((gap) => ({
253
+ : yearGaps(pointsOf(doc, doc.structure, options), doc.source, yearWordsOf(doc), anyYearWordsOf(doc)).map((gap) => ({
161
254
  rule: "date-without-year",
162
255
  severity: "warning",
163
256
  line: 0,
@@ -0,0 +1,40 @@
1
+ import type { Span } from "../plugin.ts";
2
+
3
+ // The unit a duty is written in: its article, else its list, else its paragraph. A duty in a unit that names the dated
4
+ // deadline of its own act is timed by it: 「乙は代金を支払う。」 beside 「支払期日までに支払うことができないときは…」. A date
5
+ // for another act (a delivery date beside a duty to pay) times nothing. Pure.
6
+
7
+ /** The spans a document is cut into, from the widest kind that counts as one unit to the narrowest. */
8
+ export type Units = { readonly articles: readonly Span[]; readonly lists: readonly Span[]; readonly paragraphs: readonly Span[] };
9
+
10
+ /** A dated deadline's name (支払期日, due date) and the act it times (支払, pay). */
11
+ export type NamedDeadline = { readonly name: string; readonly act: string };
12
+
13
+ const within = (span: Span, offset: number): boolean => offset >= span.start && offset < span.end;
14
+
15
+ /** The innermost span holding the offset: an article nested in another is a unit of its own. */
16
+ const innermost = (spans: readonly Span[], offset: number): Span | undefined =>
17
+ spans
18
+ .filter((span) => within(span, offset))
19
+ .reduce<Span | undefined>((inner, span) => (inner === undefined || span.start > inner.start ? span : inner), undefined);
20
+
21
+ /** The unit that holds the offset: its article, else its list, else its paragraph; undefined when none does. */
22
+ export const unitAt = (units: Units, offset: number): Span | undefined =>
23
+ [units.articles, units.lists, units.paragraphs].map((spans) => innermost(spans, offset)).find((span) => span !== undefined);
24
+
25
+ /**
26
+ * The acts whose dated deadline the unit holding the offset names. holds: whether a text holds a name (as a phrase, so
27
+ * that a Latin name is read as whole words).
28
+ */
29
+ export const actsTimedAt = (
30
+ source: string,
31
+ units: Units,
32
+ offset: number,
33
+ deadlines: readonly NamedDeadline[],
34
+ holds: (text: string, name: string) => boolean,
35
+ ): string[] => {
36
+ const unit = unitAt(units, offset);
37
+ if (unit === undefined) return [];
38
+ const text = source.slice(unit.start, unit.end);
39
+ return [...new Set(deadlines.filter((deadline) => holds(text, deadline.name)).map((deadline) => deadline.act))];
40
+ };
@@ -1,12 +1,14 @@
1
1
  // A defined term used later in another form, and a long name used again after its short name was defined. Pure. The
2
2
  // definitions come from the document's structure tree (以下「甲」という, ("Seller")); which words may stand in a long
3
3
  // name is read from the tokens' parts of speech.
4
+ import { inEntryOfTerm } from "./term-mention-sentence.ts";
4
5
  import { definedTerms, usesOf, type BodyText, type DefinedTerm } from "../structure/definition-use.ts";
5
6
  import { escapeRegExp } from "../orthography.ts";
6
7
  import { prefixGroupsOf, prefixVariants, variantUses } from "../structure/term-prefix.ts";
7
8
  import { quoteAt } from "./structure-tree.ts";
8
9
  import { isPartOfAddress } from "./address-word.ts";
9
10
  import { exactOffsets, extendedAfter, extendedBefore } from "./term-extension.ts";
11
+ import { headsKindPhrase, insideLongerTerm, isNamedAsTerm, isNarrowedUse } from "./ordinary-phrase.ts";
10
12
  import { CLOSES_SENTENCE, isNameField, isSignatureLine, opensClosingBlock, SLACK } from "./name-field.ts";
11
13
  import type { Detector, Finding, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
12
14
 
@@ -146,18 +148,36 @@ const prefixFindings = (doc: ProseDocument, texts: readonly BodyText[], term: De
146
148
  ),
147
149
  );
148
150
 
149
- /** The term set in quotes again, unless the document's profile says a quoted term is the term mentioned (「株主」とあるのは). */
150
- const quotedFindings = (doc: ProseDocument, term: DefinedTerm, uses: readonly number[], definingEnd: number): Finding[] =>
151
- doc.profile?.quoteMentionsTerm === true
152
- ? []
153
- : quotedUses(doc.source, term.term, uses, definingEnd).map((offset) =>
154
- finding(doc, "defined-term-form", offset, "quoted", { term: term.term, line: term.line }),
155
- );
151
+ const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
152
+
153
+ /**
154
+ * The term set in quotes again, unless the document's profile says a quoted term is the term mentioned (「株主」とあるのは),
155
+ * or the words before the quote name it as a term (the definition of "Material Adverse Effect").
156
+ */
157
+ const quotedFindings = (doc: ProseDocument, term: DefinedTerm, uses: readonly number[], definingEnd: number): Finding[] => {
158
+ if (doc.profile?.quoteMentionsTerm === true) return [];
159
+ const cues = patternsOf(doc, "term-mention-cue");
160
+ return quotedUses(doc.source, term.term, uses, definingEnd)
161
+ .filter((offset) => !isNamedAsTerm(doc.source, offset - 1, cues))
162
+ .map((offset) => finding(doc, "defined-term-form", offset, "quoted", { term: term.term, line: term.line }));
163
+ };
164
+
165
+ /**
166
+ * A lower-case use that is the ordinary word in a phrase of its own: inside another defined term (certificate of merger),
167
+ * narrowed by the word before it (the common parent), or heading a kind of thing (certificates of deposit).
168
+ */
169
+ const isOrdinaryPhraseAt = (doc: ProseDocument, offset: number, term: string, defined: readonly string[]): boolean => {
170
+ if (insideLongerTerm(doc.source, offset, term, defined)) return true;
171
+ const { tokens, at } = tokensAt(doc, offset);
172
+ if (at === -1) return false;
173
+ const last = tokens.findLastIndex((token) => token.span.start < offset + term.length);
174
+ return isNarrowedUse(tokens, at, patternsOf(doc, "defined-term-pointer")) || headsKindPhrase(tokens, last);
175
+ };
156
176
 
157
177
  /** The term written longer with a word of its definition (文書管理責任者, the Application), after the sentence that defines it. */
158
178
  const extendedFindings = (doc: ProseDocument, texts: readonly BodyText[], term: DefinedTerm, spans: readonly Span[], defined: readonly string[]): Finding[] => {
159
179
  const definition = definingSentence(doc, term.span)?.text ?? "";
160
- const pointers = (doc.lexicons["defined-term-pointer"] ?? []).map((entry) => entry.pattern);
180
+ const pointers = patternsOf(doc, "defined-term-pointer");
161
181
  // Every sentence that defines the term (a second definition too) holds the long words it is defined from.
162
182
  const defining = spans.map((span) => definingSentence(doc, span)?.span ?? span);
163
183
  const definingEnd = definingSentenceEnd(doc, term.span);
@@ -182,11 +202,11 @@ export const definedTermForm: Detector = (doc, options): Finding[] => {
182
202
  const uses = usesOf(term.term, texts, spans, "loose");
183
203
  const definingEnd = definingSentenceEnd(doc, term.span);
184
204
  const quoted = quotedFindings(doc, term, uses, definingEnd);
185
- const caseUses = withLoweredWords(doc, term.term, texts, spans, uses);
205
+ const caseUses = withLoweredWords(doc, term.term, texts, spans, uses).filter((offset) => !inEntryOfTerm(doc.sentences, term.term, offset));
186
206
  const nounUses = caseUses.filter((offset) => !isVerbAt(doc, offset));
187
- const lower = lowerCaseUses(doc.source, term.term, nounUses, definingEnd, options.limit).map((offset) =>
188
- finding(doc, "defined-term-form", offset, "case", { term: term.term, line: term.line }),
189
- );
207
+ const lower = lowerCaseUses(doc.source, term.term, nounUses, definingEnd, options.limit)
208
+ .filter((offset) => !isOrdinaryPhraseAt(doc, offset, term.term, defined))
209
+ .map((offset) => finding(doc, "defined-term-form", offset, "case", { term: term.term, line: term.line }));
190
210
  return [...quoted, ...lower, ...prefixFindings(doc, texts, term, definingEnd, defined), ...extendedFindings(doc, texts, term, spans, defined)];
191
211
  });
192
212
  };
@@ -199,11 +219,31 @@ const MIN_NAME_CHARS = 4;
199
219
  /** In English a long name has two words or more (Acme Corporation); one capitalised word is the term's own kind of word. */
200
220
  const MIN_NAME_WORDS = 2;
201
221
  const LATIN = /\p{Script=Latin}/u;
222
+ const LETTER = /\p{L}/u;
223
+ const JAPANESE = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}]/u;
202
224
 
203
225
  const isNamePart = (token: Token): boolean => NAME_PARTS.has(token.pos) || NAME_MARKS.has(token.surface);
204
226
 
227
+ /**
228
+ * A label for each of several things or for all of them together ((each, a "Certificate"), (collectively, the "Plans"))
229
+ * names the head of the clause before it (a certificate that represented any share of Common Stock), not its last words.
230
+ */
231
+ const LABELS_THE_CLAUSE = /^[((](?:each|collectively)\b/iu;
232
+
233
+ /**
234
+ * Whether the words make a long name. In English, two words with letters, one of them capitalised: a figure is not a word
235
+ * of a name (as amended on January 26, 2015 (the "Indenture"), a par value of $1.00 (the "Preference Stock")), and lower-case
236
+ * words (with respect thereto) are used in their own sense. A name with Japanese in it (株式会社ABC), four characters or more.
237
+ */
238
+ const isLongName = (name: string): boolean => {
239
+ const words = name.split(/\s+/u).filter((word) => LETTER.test(word));
240
+ if (words.length === 0 || [...name].length < MIN_NAME_CHARS) return false;
241
+ return !LATIN.test(name) || JAPANESE.test(name) || (words.length >= MIN_NAME_WORDS && words.some((word) => UPPER_START.test(word)));
242
+ };
243
+
205
244
  /** The long name written right before an inline definition: the run of name words that ends at its opening bracket. */
206
245
  export const nameBefore = (sentence: Sentence, bracket: number): string | undefined => {
246
+ if (LABELS_THE_CLAUSE.test(sentence.text.slice(bracket - sentence.span.start))) return undefined;
207
247
  const tokens = (sentence.tokens ?? []).filter((token) => token.span.end <= bracket);
208
248
  const firstOfRun = tokens.findLastIndex((token) => !isNamePart(token)) + 1;
209
249
  if (isModifier(tokens[firstOfRun - 1])) return undefined;
@@ -212,16 +252,17 @@ export const nameBefore = (sentence: Sentence, bracket: number): string | undefi
212
252
  const end = run.at(-1);
213
253
  if (first === undefined || end === undefined || bracket - end.span.end > 1) return undefined;
214
254
  const name = withoutTrailingMarks(sentence.text.slice(first.span.start - sentence.span.start, end.span.end - sentence.span.start));
215
- const words = name.split(/\s+/u).length;
216
- return [...name].length < MIN_NAME_CHARS || (LATIN.test(name) && words < MIN_NAME_WORDS) ? undefined : name;
255
+ return isLongName(name) ? name : undefined;
217
256
  };
218
257
 
219
258
  /**
220
- * A word that narrows the name before it: an article, an adjective, a verb, or の (妊娠中の女性従業員, the Beta Preview, 本利用規約).
221
- * The words then name a kind of thing the definition picks out, not one party, and are used in their own sense again.
259
+ * A word that narrows the name before it: an article, an adjective, a verb, or a possessive (妊娠中の女性従業員, the Beta
260
+ * Preview, 本利用規約, users of Customer's Web site). The words then name a kind of thing the definition picks out, not one
261
+ * party, and are used in their own sense again.
222
262
  */
223
263
  const MODIFIERS = new Set(["DET", "ADJ", "VERB", "AUX"]);
224
- const isModifier = (token: Token | undefined): boolean => token !== undefined && (MODIFIERS.has(token.pos) || token.surface === "の");
264
+ const POSSESSIVES = new Set(["の", "'s", "’s", "'", "’"]);
265
+ const isModifier = (token: Token | undefined): boolean => token !== undefined && (MODIFIERS.has(token.pos) || POSSESSIVES.has(token.surface));
225
266
 
226
267
  const TRAILING_MARKS = new Set([",", ".", " "]);
227
268
 
@@ -1,6 +1,7 @@
1
1
  import type { Detector, Finding, ProseDocument } from "../plugin.ts";
2
2
  import { definedTerms, unusedDefinitions, usesBeforeDefinition, type BodyText, type IsTitle, type Mentioned } from "../structure/definition-use.ts";
3
3
  import { titleLineNumbers } from "../structure/title-lines.ts";
4
+ import { contentsLineNumbers } from "../structure/contents-lines.ts";
4
5
  import { expansionConflicts, expansionsIn } from "../acronym-expansions.ts";
5
6
  import { linesOf, lineNumberAt } from "../structure/lines.ts";
6
7
  import { isQuotedAlone } from "../quoted-span.ts";
@@ -34,10 +35,13 @@ export const unusedDefinition: Detector = (doc): Finding[] =>
34
35
  findingAt(doc, defined.span.start, { term: defined.term }),
35
36
  );
36
37
 
37
- /** 題・見出し(Markdown の見出し、章・節の行、条の前の見出しの行)の上の位置か。 */
38
+ const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
39
+
40
+ /** 題・見出し(Markdown の見出し、章・節の行、条の前の見出しの行)と、目次・索引の行の上の位置か。 */
38
41
  const titleIn = (doc: ProseDocument): IsTitle => {
39
42
  const lines = linesOf(doc.source);
40
- const numbers = titleLineNumbers(doc.structure, lines, doc.markup?.headings ?? []);
43
+ const headings = doc.markup?.headings ?? [];
44
+ const numbers = new Set([...titleLineNumbers(doc.structure, lines, headings), ...contentsLineNumbers(lines, headings, patternsOf(doc, "toc-heading"))]);
41
45
  return (offset) => numbers.has(lineNumberAt(lines, offset) ?? 0);
42
46
  };
43
47
 
@@ -45,7 +49,7 @@ const titleIn = (doc: ProseDocument): IsTitle => {
45
49
  export const useBeforeDefinition: Detector = (doc): Finding[] =>
46
50
  doc.structure === undefined
47
51
  ? []
48
- : usesBeforeDefinition(definedTerms(doc.structure), bodyOf(doc), mentionedIn(doc), titleIn(doc)).map((use) =>
52
+ : usesBeforeDefinition(definedTerms(doc.structure), bodyOf(doc), mentionedIn(doc), titleIn(doc), patternsOf(doc, "self-prefix")).map((use) =>
49
53
  findingAt(doc, use.offset, { term: use.term.term, defined: use.term.line }),
50
54
  );
51
55
 
@@ -4,6 +4,8 @@ import { documentDateOf } from "./document-date.ts";
4
4
  import { overlapsAny, spanIndex } from "../compare/spans.ts";
5
5
  import { yearOf, type DurationUnit } from "../derived/date-arithmetic.ts";
6
6
  import { durationMismatches, type DatedValue, type Duration } from "../derived/durations.ts";
7
+ import { isCountPerPeriod, type PeriodWord, type PerPeriodWords } from "../derived/count-per-period.ts";
8
+ import { occurrences } from "../structure/stated-multiple.ts";
7
9
  import { elapsedMismatches, type Elapsed, type OriginWord, type Year } from "../derived/elapsed.ts";
8
10
  import { numberWordCounts } from "../derived/number-word-counts.ts";
9
11
  import { hyphenatedCounts, withoutArticle } from "../derived/hyphenated-counts.ts";
@@ -91,12 +93,25 @@ const isApproximate = (doc: ProseDocument, span: Attributed): boolean =>
91
93
  positioned(doc, "approximate-marker", "before").some((word) => textBefore(doc, span).endsWith(word)) ||
92
94
  positioned(doc, "approximate-marker", "after").some((word) => textAfter(doc, span).startsWith(word));
93
95
 
94
- /** 木の数量(3 months)と、名詞の前に書いた期間(a 3-month trial)。 */
95
- const durationsOf = (doc: ProseDocument, quantities: readonly Quantity[], text: string): Duration[] =>
96
- [...quantities, ...hyphenatedCounts(text, patternsOf(doc, ...DURATION_LEXICONS.map(([id]) => id)))].flatMap((quantity) => {
96
+ const isDurationUnit = (group: string | undefined): group is DurationUnit => DURATION_LEXICONS.some(([, unit]) => unit === group);
97
+
98
+ const perPeriodWordsOf = (doc: ProseDocument): PerPeriodWords => ({
99
+ periods: (doc.lexicons["duration-per-period"] ?? []).flatMap((entry): PeriodWord[] =>
100
+ isDurationUnit(entry.group) ? [{ word: entry.pattern.toLowerCase(), position: entry.position === "after" ? "after" : "before", unit: entry.group }] : [],
101
+ ),
102
+ schedules: spanIndex(occurrences(doc.source, patternsOf(doc, "weekly-days-off"))),
103
+ });
104
+
105
+ /** 木の数量(3 months)と、名詞の前に書いた期間(a 3-month trial)。期間あたりの数(週3日)は期間ではない。 */
106
+ const durationsOf = (doc: ProseDocument, quantities: readonly Quantity[], text: string): Duration[] => {
107
+ const perPeriod = perPeriodWordsOf(doc);
108
+ return [...quantities, ...hyphenatedCounts(text, patternsOf(doc, ...DURATION_LEXICONS.map(([id]) => id)))].flatMap((quantity) => {
97
109
  const unit = DURATION_LEXICONS.find(([id]) => patternsOf(doc, id).some((pattern) => pattern.normalize("NFKC") === quantity.unit))?.[1];
98
- return unit === undefined || isApproximate(doc, quantity) ? [] : [{ ...quantity, unit }];
110
+ if (unit === undefined || isApproximate(doc, quantity)) return [];
111
+ const duration = { ...quantity, unit };
112
+ return isCountPerPeriod(duration, textBefore(doc, quantity), textAfter(doc, quantity), perPeriod) ? [] : [duration];
99
113
  });
114
+ };
100
115
 
101
116
  const sentencesOf = (doc: ProseDocument): Span[] => doc.sentences.map((sentence) => sentence.span);
102
117
 
@@ -0,0 +1,36 @@
1
+ import type { Token } from "../plugin.ts";
2
+
3
+ // 同じ助詞のあいだに括弧の注だけがある(「本利用規約は(以下、本規約)は」)。注を書き足したときに、前の助詞を消し忘れた跡。
4
+ // 「AはBは」の対比は、あいだに語があるので当たらない。
5
+
6
+ const MAX_ASIDE = 80;
7
+ /** 注の前後に置ける空白(行の中だけ)。 */
8
+ const MAX_SPACES = 2;
9
+ const SPACES = `[ \\t\\u3000]{0,${String(MAX_SPACES)}}`;
10
+ /** 助詞の後ろの、括弧ひとつの注(入れ子でない)とその前後の空白。 */
11
+ const ASIDE = new RegExp(`^${SPACES}[((][^(())\\n]{1,${String(MAX_ASIDE)}}[))]${SPACES}`, "u");
12
+ /** 括弧と注と前後の空白が収まる長さ。これより先は読まない。 */
13
+ const LOOK_AHEAD = MAX_ASIDE + 2 + MAX_SPACES * 2;
14
+
15
+ /** 「別表の(1)の欄」の「の」は、括弧の番号を挟んで名前を続ける書き方なので数えない。 */
16
+ const JOINS_NAMES = "の";
17
+
18
+ const isParticle = (token: Token): boolean => token.pos === "ADP" && token.surface !== JOINS_NAMES;
19
+
20
+ /** 二つの同じ助詞と、そのあいだの括弧の注。 */
21
+ export type AsidePair = { readonly first: Token; readonly second: Token };
22
+
23
+ /** first の後ろが括弧の注だけで、その直後に同じ助詞があれば、その助詞。source は文書全体で、token の span もその座標。 */
24
+ const particleAfterAside = (source: string, tokens: readonly Token[], first: Token): Token | undefined => {
25
+ const aside = ASIDE.exec(source.slice(first.span.end, first.span.end + LOOK_AHEAD))?.[0];
26
+ if (aside === undefined) return undefined;
27
+ const second = tokens.find((token) => token.span.start === first.span.end + aside.length);
28
+ return second !== undefined && isParticle(second) && second.surface === first.surface ? second : undefined;
29
+ };
30
+
31
+ /** 文の語のうち、括弧の注を挟んで同じ助詞が二度ある所。Pure. */
32
+ export const doubledAcrossAside = (source: string, tokens: readonly Token[]): AsidePair[] =>
33
+ tokens.flatMap((first) => {
34
+ const second = isParticle(first) ? particleAfterAside(source, tokens, first) : undefined;
35
+ return second === undefined ? [] : [{ first, second }];
36
+ });
@@ -1,4 +1,6 @@
1
- import type { Detector, Finding } from "../plugin.ts";
1
+ import type { Detector, Finding, Span } from "../plugin.ts";
2
+ import { latinCompanyFormRegExp, latinCompanyFormSpans } from "../latin-company-form.ts";
3
+ import { firstEndingAfter } from "../soft-break.ts";
2
4
  import { quoteAround } from "./quote-around.ts";
3
5
 
4
6
  /**
@@ -32,16 +34,35 @@ const withoutWordDot = (text: string, found: DoubledMarks): DoubledMarks =>
32
34
  ? { start: found.start, run: found.run.slice(0, -1) }
33
35
  : found;
34
36
 
35
- const isSlip = (text: string, { start, run }: DoubledMarks): boolean =>
36
- run.length >= 2 && !isDrawnOut(run) && !isDrawnOutThenClosed(run) && !AFTER_ABBREVIATION.test(run) && !isJoinedDots(text, start, run);
37
+ /**
38
+ * 並びのうち、英字の会社の形(CO.,LTD.、INC.)の中の印の数。形の点や「,」は名前の一部で、並びの印ではない。
39
+ * names は昇順で重ならない(正規表現の順の一致)。並びに掛かりうるのは、並びの終わる前に始まる高々 run.length 個の形。
40
+ */
41
+ const marksInNames = ({ start, run }: DoubledMarks, names: readonly Span[]): number => {
42
+ const first = firstEndingAfter(names, start);
43
+ const near = names.slice(first, first + run.length);
44
+ return [...run].filter((_, at) => near.some((name) => start + at >= name.start && start + at < name.end)).length;
45
+ };
46
+
47
+ const isSlip = (text: string, found: DoubledMarks, names: readonly Span[]): boolean => {
48
+ const { start, run } = found;
49
+ return (
50
+ run.length - marksInNames(found, names) >= 2 &&
51
+ !isDrawnOut(run) &&
52
+ !isDrawnOutThenClosed(run) &&
53
+ !AFTER_ABBREVIATION.test(run) &&
54
+ !isJoinedDots(text, start, run)
55
+ );
56
+ };
37
57
 
38
- /** text の中の、句読点が重なった並び(位置と並び)。 */
39
- export const doubledMarks = (text: string): DoubledMarks[] =>
40
- [...text.matchAll(PUNCTUATION_RUN)].map((match) => withoutWordDot(text, { start: match.index, run: match[0] })).filter((found) => isSlip(text, found));
58
+ /** text の中の、句読点が重なった並び(位置と並び)。names は数えない名前(英字の会社の形)の範囲。 */
59
+ export const doubledMarks = (text: string, names: readonly Span[] = []): DoubledMarks[] =>
60
+ [...text.matchAll(PUNCTUATION_RUN)].map((match) => withoutWordDot(text, { start: match.index, run: match[0] })).filter((found) => isSlip(text, found, names));
41
61
 
42
62
  export const doubledPunctuation: Detector = (doc): Finding[] => {
43
63
  const text = doc.prose ?? doc.source;
44
- return doubledMarks(text).map(({ start, run }) => ({
64
+ const forms = latinCompanyFormRegExp((doc.lexicons["company-form-latin"] ?? []).map((entry) => entry.pattern));
65
+ return doubledMarks(text, latinCompanyFormSpans(text, forms)).map(({ start, run }) => ({
45
66
  rule: "",
46
67
  severity: "warning",
47
68
  line: 0,
@@ -1,5 +1,6 @@
1
1
  import type { Detector, Finding, Lexicon, Sentence, Token } from "../plugin.ts";
2
2
  import { citedNamesOf, endsCitedName } from "./cited-name.ts";
3
+ import { doubledAcrossAside } from "./doubled-across-aside.ts";
3
4
 
4
5
  /**
5
6
  * 語を書き損じて二度書いた(the the / 資料をを)。消し忘れと、書き換えの途中で残った語(our the platform)の二つ。
@@ -159,7 +160,7 @@ export const doubledWord: Detector = (doc, options): Finding[] => {
159
160
  const kinds = new Set((doc.lexicons[DOCUMENT_KIND] ?? []).map((entry) => entry.pattern));
160
161
  const phrases = doc.lexicons[FIXED_PHRASE] ?? [];
161
162
  return doc.sentences.flatMap((sentence) =>
162
- doubledIn(doc.source, sentence.tokens ?? [], spaced, allowed, phrases)
163
+ [...doubledIn(doc.source, sentence.tokens ?? [], spaced, allowed, phrases), ...(spaced ? [] : doubledAcrossAside(doc.source, sentence.tokens ?? []))]
163
164
  .filter((doubled) => !endsCitedName(doubled.first, doubled.second, cited, kinds))
164
165
  .map((doubled) => findingOf(sentence, doubled, spaced)),
165
166
  );
@@ -4,7 +4,8 @@
4
4
  // order (dated-pair-label, date-now-word, and dated-span-label for the words whose line states a period, read up to its end,
5
5
  // or from its start in the group a dated-span-label entry names;
6
6
  // a table whose header names both columns of a pair, from dated-pair-label and the header-only dated-column-label;
7
- // a signature line giving a pair's later date, from the role words of dated-signer-label);
7
+ // a signature line giving a pair's later date, from the role words of dated-signer-label;
8
+ // a pair's label naming a version, End of support for 5.0.0 or 3.0.0 のサポート終了日, from dated-pair-version-word);
8
9
  // the dates are the structure tree's, and the lines are read with code masked.
9
10
  import type { Detector, Finding, ProseDocument } from "../plugin.ts";
10
11
  import { actionDueBeforeMeeting, type ActionWords } from "../structure/action-due.ts";
@@ -15,6 +16,7 @@ import { inDocumentOrder, type StructureIssue } from "../structure/issues.ts";
15
16
  import { proseAndTablesOf } from "../table-text.ts";
16
17
  import { periodWordsOf } from "./range-words.ts";
17
18
  import { quoteAt } from "./structure-tree.ts";
19
+ import type { VersionWords } from "../structure/versioned-label.ts";
18
20
  import { readableDates, withReadableDates } from "./readable-dates.ts";
19
21
 
20
22
  /** A record's facts table can sit well below its header date (a listing date above the table holding the move-in date). */
@@ -37,6 +39,12 @@ const actionWordsOf = (doc: ProseDocument): ActionWords => ({
37
39
  minutes: patternsOf(doc, "minutes-title-word"),
38
40
  });
39
41
 
42
+ const versionWordsOf = (doc: ProseDocument): VersionWords => {
43
+ const entries = doc.lexicons["dated-pair-version-word"] ?? [];
44
+ const at = (position: "before" | "after"): string[] => entries.filter((entry) => entry.position === position).map((entry) => entry.pattern);
45
+ return { after: at("after"), before: at("before") };
46
+ };
47
+
40
48
  const orderAsidesOf = (doc: ProseDocument): string[] => [...patternsOf(doc, "deadline-passed-word"), ...patternsOf(doc, "date-now-word")];
41
49
 
42
50
  const treeDates = (tree: NonNullable<ProseDocument["structure"]>): OrderDate[] =>
@@ -70,6 +78,7 @@ export const dueDate: Detector = (doc): Finding[] => {
70
78
  spans,
71
79
  whole: doc.source,
72
80
  signers: doc.lexicons["dated-signer-label"] ?? [],
81
+ versions: versionWordsOf(doc),
73
82
  }).map((issue) => findingOf(doc, issue, variantOf(issue))),
74
83
  ...columnDatesOutOfOrder(text, dates, [...pairs, ...(doc.lexicons["dated-column-label"] ?? [])], orderAsidesOf(doc)).map((issue) =>
75
84
  findingOf(doc, issue, "order"),
@@ -35,6 +35,19 @@ const wordAround = (text: string, start: number, end: number): string => {
35
35
  return text.slice(from, after === -1 ? text.length : end + after);
36
36
  };
37
37
 
38
+ /**
39
+ * A leader pads a label out to a column: the label opens a line or follows a sentence end, holds no space or punctuation,
40
+ * and two spaces or more follow the dots (化学品事業…… then two full-width spaces, then the description). One such place
41
+ * may be an ellipsis followed by spaces; MIN_LEADERS of them are a list of labels.
42
+ */
43
+ const LEADER_LABEL = /(?:^|[\n。.!?!?])[^\S\n]*[^\s\p{P}]{1,20}$/u;
44
+ const LEADER_PADDING = /^[^\S\n]{2}/u;
45
+ const LABEL_REACH = 24;
46
+ const MIN_LEADERS = 2;
47
+
48
+ const isLeaderShaped = (text: string, start: number, end: number): boolean =>
49
+ LEADER_PADDING.test(text.slice(end)) && LEADER_LABEL.test(text.slice(Math.max(0, start - LABEL_REACH), start));
50
+
38
51
  /** Dots that are not an ellipsis in running text: a range, a path or address, a table of contents leader. */
39
52
  const isNotProse = (text: string, start: number, end: number): boolean =>
40
53
  NOT_PROSE_BESIDE.test(text.charAt(start - 1)) ||
@@ -50,9 +63,11 @@ export const ellipsesIn = (text: string, forms: readonly string[]): WrittenEllip
50
63
  .map(escapeRegExp)
51
64
  .join("|");
52
65
  const pattern = new RegExp(`(?<!${ELLIPSIS_PART})(?:${alternatives})(?!${ELLIPSIS_PART})`, "gu");
53
- return [...text.matchAll(pattern)].flatMap((match) =>
66
+ const found = [...text.matchAll(pattern)].flatMap((match) =>
54
67
  isNotProse(text, match.index, match.index + match[0].length) ? [] : [{ offset: match.index, form: match[0] }],
55
68
  );
69
+ const leaders = found.filter((ellipsis) => isLeaderShaped(text, ellipsis.offset, ellipsis.offset + ellipsis.form.length));
70
+ return leaders.length < MIN_LEADERS ? found : found.filter((ellipsis) => !leaders.includes(ellipsis));
56
71
  };
57
72
 
58
73
  export const ellipsisConsistency: Detector = (doc, options): Finding[] => {