chaffjs 0.35.0 → 0.37.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 (823) 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/chronology-rows.d.ts +9 -0
  8. package/dist/chronology-rows.d.ts.map +1 -0
  9. package/dist/chronology-rows.js +79 -0
  10. package/dist/chronology-rows.js.map +1 -0
  11. package/dist/company-name-run.d.ts +8 -0
  12. package/dist/company-name-run.d.ts.map +1 -0
  13. package/dist/company-name-run.js +30 -0
  14. package/dist/company-name-run.js.map +1 -0
  15. package/dist/compound-head.d.ts +7 -0
  16. package/dist/compound-head.d.ts.map +1 -0
  17. package/dist/compound-head.js +19 -0
  18. package/dist/compound-head.js.map +1 -0
  19. package/dist/date-format.d.ts +8 -3
  20. package/dist/date-format.d.ts.map +1 -1
  21. package/dist/date-format.js +36 -3
  22. package/dist/date-format.js.map +1 -1
  23. package/dist/derived/count-per-period.d.ts +23 -0
  24. package/dist/derived/count-per-period.d.ts.map +1 -0
  25. package/dist/derived/count-per-period.js +14 -0
  26. package/dist/derived/count-per-period.js.map +1 -0
  27. package/dist/detectors/acronym-context.d.ts +4 -0
  28. package/dist/detectors/acronym-context.d.ts.map +1 -1
  29. package/dist/detectors/acronym-context.js +29 -1
  30. package/dist/detectors/acronym-context.js.map +1 -1
  31. package/dist/detectors/acronym-expansion.d.ts +5 -1
  32. package/dist/detectors/acronym-expansion.d.ts.map +1 -1
  33. package/dist/detectors/acronym-expansion.js +42 -3
  34. package/dist/detectors/acronym-expansion.js.map +1 -1
  35. package/dist/detectors/acronym-known.d.ts +19 -0
  36. package/dist/detectors/acronym-known.d.ts.map +1 -0
  37. package/dist/detectors/acronym-known.js +32 -0
  38. package/dist/detectors/acronym-known.js.map +1 -0
  39. package/dist/detectors/acronym-link.d.ts +19 -0
  40. package/dist/detectors/acronym-link.d.ts.map +1 -0
  41. package/dist/detectors/acronym-link.js +65 -0
  42. package/dist/detectors/acronym-link.js.map +1 -0
  43. package/dist/detectors/acronym-mention.d.ts +5 -0
  44. package/dist/detectors/acronym-mention.d.ts.map +1 -0
  45. package/dist/detectors/acronym-mention.js +34 -0
  46. package/dist/detectors/acronym-mention.js.map +1 -0
  47. package/dist/detectors/acronym-name.d.ts +8 -1
  48. package/dist/detectors/acronym-name.d.ts.map +1 -1
  49. package/dist/detectors/acronym-name.js +25 -6
  50. package/dist/detectors/acronym-name.js.map +1 -1
  51. package/dist/detectors/addressee-edge.d.ts +13 -0
  52. package/dist/detectors/addressee-edge.d.ts.map +1 -0
  53. package/dist/detectors/addressee-edge.js +13 -0
  54. package/dist/detectors/addressee-edge.js.map +1 -0
  55. package/dist/detectors/addressee-title-edge.d.ts +21 -0
  56. package/dist/detectors/addressee-title-edge.d.ts.map +1 -0
  57. package/dist/detectors/addressee-title-edge.js +22 -0
  58. package/dist/detectors/addressee-title-edge.js.map +1 -0
  59. package/dist/detectors/announced-count.d.ts.map +1 -1
  60. package/dist/detectors/announced-count.js +1 -0
  61. package/dist/detectors/announced-count.js.map +1 -1
  62. package/dist/detectors/bare-comparative.d.ts +4 -0
  63. package/dist/detectors/bare-comparative.d.ts.map +1 -1
  64. package/dist/detectors/bare-comparative.js +28 -3
  65. package/dist/detectors/bare-comparative.js.map +1 -1
  66. package/dist/detectors/blank-structure.d.ts +7 -1
  67. package/dist/detectors/blank-structure.d.ts.map +1 -1
  68. package/dist/detectors/blank-structure.js +13 -8
  69. package/dist/detectors/blank-structure.js.map +1 -1
  70. package/dist/detectors/bracket-specified.d.ts +6 -0
  71. package/dist/detectors/bracket-specified.d.ts.map +1 -0
  72. package/dist/detectors/bracket-specified.js +23 -0
  73. package/dist/detectors/bracket-specified.js.map +1 -0
  74. package/dist/detectors/broken-link.d.ts +6 -0
  75. package/dist/detectors/broken-link.d.ts.map +1 -1
  76. package/dist/detectors/broken-link.js +23 -2
  77. package/dist/detectors/broken-link.js.map +1 -1
  78. package/dist/detectors/capitalised-term.d.ts +4 -0
  79. package/dist/detectors/capitalised-term.d.ts.map +1 -1
  80. package/dist/detectors/capitalised-term.js +18 -1
  81. package/dist/detectors/capitalised-term.js.map +1 -1
  82. package/dist/detectors/caps-caption.d.ts +17 -6
  83. package/dist/detectors/caps-caption.d.ts.map +1 -1
  84. package/dist/detectors/caps-caption.js +65 -0
  85. package/dist/detectors/caps-caption.js.map +1 -1
  86. package/dist/detectors/caps-phrase.d.ts +6 -0
  87. package/dist/detectors/caps-phrase.d.ts.map +1 -0
  88. package/dist/detectors/caps-phrase.js +16 -0
  89. package/dist/detectors/caps-phrase.js.map +1 -0
  90. package/dist/detectors/char-shape.d.ts +1 -0
  91. package/dist/detectors/char-shape.d.ts.map +1 -1
  92. package/dist/detectors/char-shape.js +56 -20
  93. package/dist/detectors/char-shape.js.map +1 -1
  94. package/dist/detectors/citation-sentence.d.ts +8 -0
  95. package/dist/detectors/citation-sentence.d.ts.map +1 -0
  96. package/dist/detectors/citation-sentence.js +40 -0
  97. package/dist/detectors/citation-sentence.js.map +1 -0
  98. package/dist/detectors/cited-title.d.ts +3 -2
  99. package/dist/detectors/cited-title.d.ts.map +1 -1
  100. package/dist/detectors/cited-title.js +14 -3
  101. package/dist/detectors/cited-title.js.map +1 -1
  102. package/dist/detectors/contraction-mention.d.ts +3 -0
  103. package/dist/detectors/contraction-mention.d.ts.map +1 -0
  104. package/dist/detectors/contraction-mention.js +22 -0
  105. package/dist/detectors/contraction-mention.js.map +1 -0
  106. package/dist/detectors/counter-edge.d.ts +2 -1
  107. package/dist/detectors/counter-edge.d.ts.map +1 -1
  108. package/dist/detectors/counter-edge.js +17 -2
  109. package/dist/detectors/counter-edge.js.map +1 -1
  110. package/dist/detectors/dash-break.d.ts +7 -0
  111. package/dist/detectors/dash-break.d.ts.map +1 -0
  112. package/dist/detectors/dash-break.js +30 -0
  113. package/dist/detectors/dash-break.js.map +1 -0
  114. package/dist/detectors/date-any-year.d.ts +7 -3
  115. package/dist/detectors/date-any-year.d.ts.map +1 -1
  116. package/dist/detectors/date-any-year.js +30 -8
  117. package/dist/detectors/date-any-year.js.map +1 -1
  118. package/dist/detectors/date-format.d.ts.map +1 -1
  119. package/dist/detectors/date-format.js +2 -1
  120. package/dist/detectors/date-format.js.map +1 -1
  121. package/dist/detectors/date-year.d.ts +9 -3
  122. package/dist/detectors/date-year.d.ts.map +1 -1
  123. package/dist/detectors/date-year.js +45 -9
  124. package/dist/detectors/date-year.js.map +1 -1
  125. package/dist/detectors/deadline-unit.d.ts +20 -0
  126. package/dist/detectors/deadline-unit.d.ts.map +1 -0
  127. package/dist/detectors/deadline-unit.js +19 -0
  128. package/dist/detectors/deadline-unit.js.map +1 -0
  129. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  130. package/dist/detectors/defined-term-form.js +33 -7
  131. package/dist/detectors/defined-term-form.js.map +1 -1
  132. package/dist/detectors/definition-use.d.ts.map +1 -1
  133. package/dist/detectors/definition-use.js +14 -6
  134. package/dist/detectors/definition-use.js.map +1 -1
  135. package/dist/detectors/derived-numbers.d.ts.map +1 -1
  136. package/dist/detectors/derived-numbers.js +17 -4
  137. package/dist/detectors/derived-numbers.js.map +1 -1
  138. package/dist/detectors/document-shape.d.ts +5 -0
  139. package/dist/detectors/document-shape.d.ts.map +1 -1
  140. package/dist/detectors/document-shape.js +15 -1
  141. package/dist/detectors/document-shape.js.map +1 -1
  142. package/dist/detectors/doubled-across-aside.d.ts +9 -0
  143. package/dist/detectors/doubled-across-aside.d.ts.map +1 -0
  144. package/dist/detectors/doubled-across-aside.js +27 -0
  145. package/dist/detectors/doubled-across-aside.js.map +1 -0
  146. package/dist/detectors/doubled-punctuation.d.ts +3 -3
  147. package/dist/detectors/doubled-punctuation.d.ts.map +1 -1
  148. package/dist/detectors/doubled-punctuation.js +23 -4
  149. package/dist/detectors/doubled-punctuation.js.map +1 -1
  150. package/dist/detectors/doubled-word.d.ts.map +1 -1
  151. package/dist/detectors/doubled-word.js +2 -1
  152. package/dist/detectors/doubled-word.js.map +1 -1
  153. package/dist/detectors/duplicate-heading.d.ts +1 -0
  154. package/dist/detectors/duplicate-heading.d.ts.map +1 -1
  155. package/dist/detectors/duplicate-heading.js +25 -3
  156. package/dist/detectors/duplicate-heading.js.map +1 -1
  157. package/dist/detectors/ellipsis.d.ts.map +1 -1
  158. package/dist/detectors/ellipsis.js +13 -1
  159. package/dist/detectors/ellipsis.js.map +1 -1
  160. package/dist/detectors/email-letter.d.ts +40 -3
  161. package/dist/detectors/email-letter.d.ts.map +1 -1
  162. package/dist/detectors/email-letter.js +110 -17
  163. package/dist/detectors/email-letter.js.map +1 -1
  164. package/dist/detectors/field-label.d.ts +7 -0
  165. package/dist/detectors/field-label.d.ts.map +1 -0
  166. package/dist/detectors/field-label.js +23 -0
  167. package/dist/detectors/field-label.js.map +1 -0
  168. package/dist/detectors/footnote-mismatch.d.ts +6 -1
  169. package/dist/detectors/footnote-mismatch.d.ts.map +1 -1
  170. package/dist/detectors/footnote-mismatch.js +28 -7
  171. package/dist/detectors/footnote-mismatch.js.map +1 -1
  172. package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
  173. package/dist/detectors/fullwidth-alnum.js +7 -1
  174. package/dist/detectors/fullwidth-alnum.js.map +1 -1
  175. package/dist/detectors/graded-step.d.ts +20 -0
  176. package/dist/detectors/graded-step.d.ts.map +1 -0
  177. package/dist/detectors/graded-step.js +33 -0
  178. package/dist/detectors/graded-step.js.map +1 -0
  179. package/dist/detectors/gram-openers.d.ts +9 -0
  180. package/dist/detectors/gram-openers.d.ts.map +1 -0
  181. package/dist/detectors/gram-openers.js +40 -0
  182. package/dist/detectors/gram-openers.js.map +1 -0
  183. package/dist/detectors/gram-place.d.ts +3 -1
  184. package/dist/detectors/gram-place.d.ts.map +1 -1
  185. package/dist/detectors/gram-place.js +8 -0
  186. package/dist/detectors/gram-place.js.map +1 -1
  187. package/dist/detectors/gram-predicate.d.ts.map +1 -1
  188. package/dist/detectors/gram-predicate.js +37 -3
  189. package/dist/detectors/gram-predicate.js.map +1 -1
  190. package/dist/detectors/heading-echo.d.ts.map +1 -1
  191. package/dist/detectors/heading-echo.js +28 -2
  192. package/dist/detectors/heading-echo.js.map +1 -1
  193. package/dist/detectors/heading-record-rhythm.d.ts +9 -0
  194. package/dist/detectors/heading-record-rhythm.d.ts.map +1 -0
  195. package/dist/detectors/heading-record-rhythm.js +57 -0
  196. package/dist/detectors/heading-record-rhythm.js.map +1 -0
  197. package/dist/detectors/ime-residue.d.ts +1 -1
  198. package/dist/detectors/ime-residue.d.ts.map +1 -1
  199. package/dist/detectors/ime-residue.js +4 -3
  200. package/dist/detectors/ime-residue.js.map +1 -1
  201. package/dist/detectors/kanji-compound-slip.d.ts +3 -0
  202. package/dist/detectors/kanji-compound-slip.d.ts.map +1 -0
  203. package/dist/detectors/kanji-compound-slip.js +50 -0
  204. package/dist/detectors/kanji-compound-slip.js.map +1 -0
  205. package/dist/detectors/kutoten-consistency.d.ts +10 -2
  206. package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
  207. package/dist/detectors/kutoten-consistency.js +83 -12
  208. package/dist/detectors/kutoten-consistency.js.map +1 -1
  209. package/dist/detectors/lexicon.d.ts.map +1 -1
  210. package/dist/detectors/lexicon.js +13 -4
  211. package/dist/detectors/lexicon.js.map +1 -1
  212. package/dist/detectors/link-shape.d.ts.map +1 -1
  213. package/dist/detectors/link-shape.js +9 -3
  214. package/dist/detectors/link-shape.js.map +1 -1
  215. package/dist/detectors/list-item-ending.d.ts +18 -0
  216. package/dist/detectors/list-item-ending.d.ts.map +1 -0
  217. package/dist/detectors/list-item-ending.js +35 -0
  218. package/dist/detectors/list-item-ending.js.map +1 -0
  219. package/dist/detectors/list-parallel.d.ts +18 -5
  220. package/dist/detectors/list-parallel.d.ts.map +1 -1
  221. package/dist/detectors/list-parallel.js +116 -36
  222. package/dist/detectors/list-parallel.js.map +1 -1
  223. package/dist/detectors/list-sentence.d.ts +4 -0
  224. package/dist/detectors/list-sentence.d.ts.map +1 -1
  225. package/dist/detectors/list-sentence.js +1 -1
  226. package/dist/detectors/list-sentence.js.map +1 -1
  227. package/dist/detectors/mark-shape.d.ts +13 -4
  228. package/dist/detectors/mark-shape.d.ts.map +1 -1
  229. package/dist/detectors/mark-shape.js +73 -10
  230. package/dist/detectors/mark-shape.js.map +1 -1
  231. package/dist/detectors/mentioned-phrase.d.ts +9 -0
  232. package/dist/detectors/mentioned-phrase.d.ts.map +1 -0
  233. package/dist/detectors/mentioned-phrase.js +25 -0
  234. package/dist/detectors/mentioned-phrase.js.map +1 -0
  235. package/dist/detectors/middle-dot.d.ts +2 -2
  236. package/dist/detectors/middle-dot.d.ts.map +1 -1
  237. package/dist/detectors/middle-dot.js +4 -2
  238. package/dist/detectors/middle-dot.js.map +1 -1
  239. package/dist/detectors/modal-conflict.d.ts.map +1 -1
  240. package/dist/detectors/modal-conflict.js +5 -2
  241. package/dist/detectors/modal-conflict.js.map +1 -1
  242. package/dist/detectors/name-variant.d.ts.map +1 -1
  243. package/dist/detectors/name-variant.js +6 -0
  244. package/dist/detectors/name-variant.js.map +1 -1
  245. package/dist/detectors/notice-paragraph.d.ts +9 -0
  246. package/dist/detectors/notice-paragraph.d.ts.map +1 -0
  247. package/dist/detectors/notice-paragraph.js +21 -0
  248. package/dist/detectors/notice-paragraph.js.map +1 -0
  249. package/dist/detectors/number-style.d.ts.map +1 -1
  250. package/dist/detectors/number-style.js +15 -2
  251. package/dist/detectors/number-style.js.map +1 -1
  252. package/dist/detectors/number-unit.d.ts.map +1 -1
  253. package/dist/detectors/number-unit.js +24 -1
  254. package/dist/detectors/number-unit.js.map +1 -1
  255. package/dist/detectors/numeral-opener.d.ts +6 -0
  256. package/dist/detectors/numeral-opener.d.ts.map +1 -1
  257. package/dist/detectors/numeral-opener.js +24 -1
  258. package/dist/detectors/numeral-opener.js.map +1 -1
  259. package/dist/detectors/obligation-without-deadline.d.ts +5 -1
  260. package/dist/detectors/obligation-without-deadline.d.ts.map +1 -1
  261. package/dist/detectors/obligation-without-deadline.js +44 -23
  262. package/dist/detectors/obligation-without-deadline.js.map +1 -1
  263. package/dist/detectors/open-end-class.d.ts +16 -0
  264. package/dist/detectors/open-end-class.d.ts.map +1 -0
  265. package/dist/detectors/open-end-class.js +65 -0
  266. package/dist/detectors/open-end-class.js.map +1 -0
  267. package/dist/detectors/open-end-condition.d.ts +7 -0
  268. package/dist/detectors/open-end-condition.d.ts.map +1 -0
  269. package/dist/detectors/open-end-condition.js +35 -0
  270. package/dist/detectors/open-end-condition.js.map +1 -0
  271. package/dist/detectors/open-end-names.d.ts +9 -3
  272. package/dist/detectors/open-end-names.d.ts.map +1 -1
  273. package/dist/detectors/open-end-names.js +5 -2
  274. package/dist/detectors/open-end-names.js.map +1 -1
  275. package/dist/detectors/open-end-question.d.ts +15 -0
  276. package/dist/detectors/open-end-question.d.ts.map +1 -0
  277. package/dist/detectors/open-end-question.js +37 -0
  278. package/dist/detectors/open-end-question.js.map +1 -0
  279. package/dist/detectors/open-end-scope.d.ts +16 -0
  280. package/dist/detectors/open-end-scope.d.ts.map +1 -0
  281. package/dist/detectors/open-end-scope.js +47 -0
  282. package/dist/detectors/open-end-scope.js.map +1 -0
  283. package/dist/detectors/opening-date.d.ts +10 -0
  284. package/dist/detectors/opening-date.d.ts.map +1 -0
  285. package/dist/detectors/opening-date.js +33 -0
  286. package/dist/detectors/opening-date.js.map +1 -0
  287. package/dist/detectors/ordinary-phrase.d.ts +20 -0
  288. package/dist/detectors/ordinary-phrase.d.ts.map +1 -0
  289. package/dist/detectors/ordinary-phrase.js +54 -0
  290. package/dist/detectors/ordinary-phrase.js.map +1 -0
  291. package/dist/detectors/organisation-run.d.ts +5 -7
  292. package/dist/detectors/organisation-run.d.ts.map +1 -1
  293. package/dist/detectors/organisation-run.js +10 -0
  294. package/dist/detectors/organisation-run.js.map +1 -1
  295. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  296. package/dist/detectors/orthographic-variant.js +85 -20
  297. package/dist/detectors/orthographic-variant.js.map +1 -1
  298. package/dist/detectors/orthography.d.ts.map +1 -1
  299. package/dist/detectors/orthography.js +9 -2
  300. package/dist/detectors/orthography.js.map +1 -1
  301. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  302. package/dist/detectors/oxford-comma.js +70 -3
  303. package/dist/detectors/oxford-comma.js.map +1 -1
  304. package/dist/detectors/person-consistency.d.ts +2 -1
  305. package/dist/detectors/person-consistency.d.ts.map +1 -1
  306. package/dist/detectors/person-consistency.js +5 -3
  307. package/dist/detectors/person-consistency.js.map +1 -1
  308. package/dist/detectors/phrase-match.d.ts +2 -0
  309. package/dist/detectors/phrase-match.d.ts.map +1 -1
  310. package/dist/detectors/phrase-match.js +11 -4
  311. package/dist/detectors/phrase-match.js.map +1 -1
  312. package/dist/detectors/placeholder-text.d.ts.map +1 -1
  313. package/dist/detectors/placeholder-text.js +18 -3
  314. package/dist/detectors/placeholder-text.js.map +1 -1
  315. package/dist/detectors/placeholder.d.ts +3 -1
  316. package/dist/detectors/placeholder.d.ts.map +1 -1
  317. package/dist/detectors/placeholder.js +8 -3
  318. package/dist/detectors/placeholder.js.map +1 -1
  319. package/dist/detectors/postcode-end.d.ts +3 -0
  320. package/dist/detectors/postcode-end.d.ts.map +1 -0
  321. package/dist/detectors/postcode-end.js +15 -0
  322. package/dist/detectors/postcode-end.js.map +1 -0
  323. package/dist/detectors/prose-total-words.d.ts +5 -0
  324. package/dist/detectors/prose-total-words.d.ts.map +1 -0
  325. package/dist/detectors/prose-total-words.js +14 -0
  326. package/dist/detectors/prose-total-words.js.map +1 -0
  327. package/dist/detectors/range-notation.d.ts +2 -2
  328. package/dist/detectors/range-notation.d.ts.map +1 -1
  329. package/dist/detectors/range-notation.js +18 -7
  330. package/dist/detectors/range-notation.js.map +1 -1
  331. package/dist/detectors/registry/kanji-compound-slip.d.ts +3 -0
  332. package/dist/detectors/registry/kanji-compound-slip.d.ts.map +1 -0
  333. package/dist/detectors/registry/kanji-compound-slip.js +3 -0
  334. package/dist/detectors/registry/kanji-compound-slip.js.map +1 -0
  335. package/dist/detectors/registry/phrase-in-use.d.ts +3 -0
  336. package/dist/detectors/registry/phrase-in-use.d.ts.map +1 -0
  337. package/dist/detectors/registry/phrase-in-use.js +3 -0
  338. package/dist/detectors/registry/phrase-in-use.js.map +1 -0
  339. package/dist/detectors/requirement-smell.d.ts.map +1 -1
  340. package/dist/detectors/requirement-smell.js +35 -7
  341. package/dist/detectors/requirement-smell.js.map +1 -1
  342. package/dist/detectors/scaled-figure-unit.d.ts +28 -0
  343. package/dist/detectors/scaled-figure-unit.d.ts.map +1 -0
  344. package/dist/detectors/scaled-figure-unit.js +78 -0
  345. package/dist/detectors/scaled-figure-unit.js.map +1 -0
  346. package/dist/detectors/sentence-counts.d.ts +12 -2
  347. package/dist/detectors/sentence-counts.d.ts.map +1 -1
  348. package/dist/detectors/sentence-counts.js +52 -11
  349. package/dist/detectors/sentence-counts.js.map +1 -1
  350. package/dist/detectors/sentence-ending.d.ts +2 -0
  351. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  352. package/dist/detectors/sentence-ending.js +10 -3
  353. package/dist/detectors/sentence-ending.js.map +1 -1
  354. package/dist/detectors/sentence-length.d.ts.map +1 -1
  355. package/dist/detectors/sentence-length.js +13 -4
  356. package/dist/detectors/sentence-length.js.map +1 -1
  357. package/dist/detectors/sentence-load.d.ts +4 -1
  358. package/dist/detectors/sentence-load.d.ts.map +1 -1
  359. package/dist/detectors/sentence-load.js +9 -2
  360. package/dist/detectors/sentence-load.js.map +1 -1
  361. package/dist/detectors/signals.d.ts.map +1 -1
  362. package/dist/detectors/signals.js +44 -52
  363. package/dist/detectors/signals.js.map +1 -1
  364. package/dist/detectors/structure-tree.d.ts.map +1 -1
  365. package/dist/detectors/structure-tree.js +14 -13
  366. package/dist/detectors/structure-tree.js.map +1 -1
  367. package/dist/detectors/structure.d.ts.map +1 -1
  368. package/dist/detectors/structure.js +2 -1
  369. package/dist/detectors/structure.js.map +1 -1
  370. package/dist/detectors/subject-name-line.d.ts +8 -0
  371. package/dist/detectors/subject-name-line.d.ts.map +1 -0
  372. package/dist/detectors/subject-name-line.js +53 -0
  373. package/dist/detectors/subject-name-line.js.map +1 -0
  374. package/dist/detectors/superlative-name.d.ts +5 -0
  375. package/dist/detectors/superlative-name.d.ts.map +1 -1
  376. package/dist/detectors/superlative-name.js +9 -0
  377. package/dist/detectors/superlative-name.js.map +1 -1
  378. package/dist/detectors/table-header.d.ts.map +1 -1
  379. package/dist/detectors/table-header.js +13 -1
  380. package/dist/detectors/table-header.js.map +1 -1
  381. package/dist/detectors/technical-docs.d.ts.map +1 -1
  382. package/dist/detectors/technical-docs.js +4 -1
  383. package/dist/detectors/technical-docs.js.map +1 -1
  384. package/dist/detectors/term-mention-sentence.d.ts +4 -0
  385. package/dist/detectors/term-mention-sentence.d.ts.map +1 -0
  386. package/dist/detectors/term-mention-sentence.js +28 -0
  387. package/dist/detectors/term-mention-sentence.js.map +1 -0
  388. package/dist/detectors/titled-run.d.ts +2 -1
  389. package/dist/detectors/titled-run.d.ts.map +1 -1
  390. package/dist/detectors/titled-run.js +9 -4
  391. package/dist/detectors/titled-run.js.map +1 -1
  392. package/dist/detectors/token-shape.d.ts.map +1 -1
  393. package/dist/detectors/token-shape.js +15 -5
  394. package/dist/detectors/token-shape.js.map +1 -1
  395. package/dist/detectors/undefined-term.d.ts.map +1 -1
  396. package/dist/detectors/undefined-term.js +5 -0
  397. package/dist/detectors/undefined-term.js.map +1 -1
  398. package/dist/detectors/unknown-word.d.ts +4 -1
  399. package/dist/detectors/unknown-word.d.ts.map +1 -1
  400. package/dist/detectors/unknown-word.js +1 -1
  401. package/dist/detectors/unknown-word.js.map +1 -1
  402. package/dist/detectors/vague-density.d.ts +5 -2
  403. package/dist/detectors/vague-density.d.ts.map +1 -1
  404. package/dist/detectors/vague-density.js +17 -4
  405. package/dist/detectors/vague-density.js.map +1 -1
  406. package/dist/document-paragraphs.d.ts +4 -0
  407. package/dist/document-paragraphs.d.ts.map +1 -0
  408. package/dist/document-paragraphs.js +24 -0
  409. package/dist/document-paragraphs.js.map +1 -0
  410. package/dist/document.d.ts.map +1 -1
  411. package/dist/document.js +2 -19
  412. package/dist/document.js.map +1 -1
  413. package/dist/figure-references.d.ts +3 -0
  414. package/dist/figure-references.d.ts.map +1 -1
  415. package/dist/figure-references.js +6 -2
  416. package/dist/figure-references.js.map +1 -1
  417. package/dist/format-template.d.ts +3 -0
  418. package/dist/format-template.d.ts.map +1 -0
  419. package/dist/format-template.js +13 -0
  420. package/dist/format-template.js.map +1 -0
  421. package/dist/formula-brackets.d.ts +7 -0
  422. package/dist/formula-brackets.d.ts.map +1 -0
  423. package/dist/formula-brackets.js +29 -0
  424. package/dist/formula-brackets.js.map +1 -0
  425. package/dist/html/html-markdown.d.ts.map +1 -1
  426. package/dist/html/html-markdown.js +2 -1
  427. package/dist/html/html-markdown.js.map +1 -1
  428. package/dist/html/html-site-chrome.d.ts +5 -0
  429. package/dist/html/html-site-chrome.d.ts.map +1 -0
  430. package/dist/html/html-site-chrome.js +56 -0
  431. package/dist/html/html-site-chrome.js.map +1 -0
  432. package/dist/joined-view.d.ts.map +1 -1
  433. package/dist/joined-view.js +1 -0
  434. package/dist/joined-view.js.map +1 -1
  435. package/dist/kanji-compound-slip.d.ts +32 -0
  436. package/dist/kanji-compound-slip.d.ts.map +1 -0
  437. package/dist/kanji-compound-slip.js +63 -0
  438. package/dist/kanji-compound-slip.js.map +1 -0
  439. package/dist/latin-company-form.d.ts +6 -0
  440. package/dist/latin-company-form.d.ts.map +1 -0
  441. package/dist/latin-company-form.js +32 -0
  442. package/dist/latin-company-form.js.map +1 -0
  443. package/dist/latin-word-boundary.d.ts +20 -0
  444. package/dist/latin-word-boundary.d.ts.map +1 -0
  445. package/dist/latin-word-boundary.js +57 -0
  446. package/dist/latin-word-boundary.js.map +1 -0
  447. package/dist/leading-label.d.ts +4 -0
  448. package/dist/leading-label.d.ts.map +1 -0
  449. package/dist/leading-label.js +14 -0
  450. package/dist/leading-label.js.map +1 -0
  451. package/dist/lexicon-genres.d.ts +2 -0
  452. package/dist/lexicon-genres.d.ts.map +1 -1
  453. package/dist/lexicon-genres.js +1 -1
  454. package/dist/lexicon-genres.js.map +1 -1
  455. package/dist/link-shape.d.ts +6 -0
  456. package/dist/link-shape.d.ts.map +1 -1
  457. package/dist/link-shape.js +27 -0
  458. package/dist/link-shape.js.map +1 -1
  459. package/dist/link-title.d.ts +4 -0
  460. package/dist/link-title.d.ts.map +1 -0
  461. package/dist/link-title.js +33 -0
  462. package/dist/link-title.js.map +1 -0
  463. package/dist/list-item-paragraphs.d.ts +15 -0
  464. package/dist/list-item-paragraphs.d.ts.map +1 -0
  465. package/dist/list-item-paragraphs.js +19 -0
  466. package/dist/list-item-paragraphs.js.map +1 -0
  467. package/dist/literal-quote.d.ts +12 -0
  468. package/dist/literal-quote.d.ts.map +1 -0
  469. package/dist/literal-quote.js +43 -0
  470. package/dist/literal-quote.js.map +1 -0
  471. package/dist/nado-closed-list.d.ts.map +1 -1
  472. package/dist/nado-closed-list.js +39 -5
  473. package/dist/nado-closed-list.js.map +1 -1
  474. package/dist/name-misspelt-usual.d.ts +5 -0
  475. package/dist/name-misspelt-usual.d.ts.map +1 -0
  476. package/dist/name-misspelt-usual.js +19 -0
  477. package/dist/name-misspelt-usual.js.map +1 -0
  478. package/dist/name-separator.d.ts.map +1 -1
  479. package/dist/name-separator.js +25 -2
  480. package/dist/name-separator.js.map +1 -1
  481. package/dist/nominal-stem.d.ts +14 -1
  482. package/dist/nominal-stem.d.ts.map +1 -1
  483. package/dist/nominal-stem.js +42 -4
  484. package/dist/nominal-stem.js.map +1 -1
  485. package/dist/notice-header.d.ts +19 -0
  486. package/dist/notice-header.d.ts.map +1 -0
  487. package/dist/notice-header.js +31 -0
  488. package/dist/notice-header.js.map +1 -0
  489. package/dist/person-forms.d.ts +8 -0
  490. package/dist/person-forms.d.ts.map +1 -1
  491. package/dist/person-forms.js +12 -0
  492. package/dist/person-forms.js.map +1 -1
  493. package/dist/plugin.d.ts +5 -0
  494. package/dist/plugin.d.ts.map +1 -1
  495. package/dist/preamble-paragraphs.d.ts +3 -2
  496. package/dist/preamble-paragraphs.d.ts.map +1 -1
  497. package/dist/preamble-paragraphs.js +8 -2
  498. package/dist/preamble-paragraphs.js.map +1 -1
  499. package/dist/sentence-load.d.ts +2 -1
  500. package/dist/sentence-load.d.ts.map +1 -1
  501. package/dist/sentence-load.js +11 -3
  502. package/dist/sentence-load.js.map +1 -1
  503. package/dist/spacing-code.d.ts +1 -0
  504. package/dist/spacing-code.d.ts.map +1 -1
  505. package/dist/spacing-code.js +4 -1
  506. package/dist/spacing-code.js.map +1 -1
  507. package/dist/split-noun.d.ts +10 -0
  508. package/dist/split-noun.d.ts.map +1 -0
  509. package/dist/split-noun.js +50 -0
  510. package/dist/split-noun.js.map +1 -0
  511. package/dist/structure/attached-parts.d.ts +12 -0
  512. package/dist/structure/attached-parts.d.ts.map +1 -0
  513. package/dist/structure/attached-parts.js +44 -0
  514. package/dist/structure/attached-parts.js.map +1 -0
  515. package/dist/structure/build.d.ts.map +1 -1
  516. package/dist/structure/build.js +7 -4
  517. package/dist/structure/build.js.map +1 -1
  518. package/dist/structure/contents-lines.d.ts +7 -0
  519. package/dist/structure/contents-lines.d.ts.map +1 -0
  520. package/dist/structure/contents-lines.js +51 -0
  521. package/dist/structure/contents-lines.js.map +1 -0
  522. package/dist/structure/defining-names.d.ts +37 -0
  523. package/dist/structure/defining-names.d.ts.map +1 -0
  524. package/dist/structure/defining-names.js +122 -0
  525. package/dist/structure/defining-names.js.map +1 -0
  526. package/dist/structure/definition-use.d.ts +8 -4
  527. package/dist/structure/definition-use.d.ts.map +1 -1
  528. package/dist/structure/definition-use.js +123 -38
  529. package/dist/structure/definition-use.js.map +1 -1
  530. package/dist/structure/gerund-phrase.d.ts +8 -0
  531. package/dist/structure/gerund-phrase.d.ts.map +1 -0
  532. package/dist/structure/gerund-phrase.js +30 -0
  533. package/dist/structure/gerund-phrase.js.map +1 -0
  534. package/dist/structure/issues.d.ts +4 -1
  535. package/dist/structure/issues.d.ts.map +1 -1
  536. package/dist/structure/issues.js +5 -2
  537. package/dist/structure/issues.js.map +1 -1
  538. package/dist/structure/list-lead-in.d.ts +19 -0
  539. package/dist/structure/list-lead-in.d.ts.map +1 -0
  540. package/dist/structure/list-lead-in.js +85 -0
  541. package/dist/structure/list-lead-in.js.map +1 -0
  542. package/dist/structure/modal-conflict.d.ts +7 -2
  543. package/dist/structure/modal-conflict.d.ts.map +1 -1
  544. package/dist/structure/modal-conflict.js +36 -7
  545. package/dist/structure/modal-conflict.js.map +1 -1
  546. package/dist/structure/negated-act.d.ts +17 -0
  547. package/dist/structure/negated-act.d.ts.map +1 -0
  548. package/dist/structure/negated-act.js +32 -0
  549. package/dist/structure/negated-act.js.map +1 -0
  550. package/dist/structure/numbering.d.ts +3 -1
  551. package/dist/structure/numbering.d.ts.map +1 -1
  552. package/dist/structure/numbering.js +20 -8
  553. package/dist/structure/numbering.js.map +1 -1
  554. package/dist/structure/prose-total.d.ts +4 -0
  555. package/dist/structure/prose-total.d.ts.map +1 -1
  556. package/dist/structure/prose-total.js +16 -6
  557. package/dist/structure/prose-total.js.map +1 -1
  558. package/dist/structure/repeated-number.d.ts +24 -0
  559. package/dist/structure/repeated-number.d.ts.map +1 -0
  560. package/dist/structure/repeated-number.js +89 -0
  561. package/dist/structure/repeated-number.js.map +1 -0
  562. package/dist/structure/rounded-amount.d.ts +8 -0
  563. package/dist/structure/rounded-amount.d.ts.map +1 -0
  564. package/dist/structure/rounded-amount.js +48 -0
  565. package/dist/structure/rounded-amount.js.map +1 -0
  566. package/dist/structure/side-step.d.ts +8 -0
  567. package/dist/structure/side-step.d.ts.map +1 -0
  568. package/dist/structure/side-step.js +21 -0
  569. package/dist/structure/side-step.js.map +1 -0
  570. package/dist/structure/spanned-label-blank.d.ts +8 -0
  571. package/dist/structure/spanned-label-blank.d.ts.map +1 -0
  572. package/dist/structure/spanned-label-blank.js +37 -0
  573. package/dist/structure/spanned-label-blank.js.map +1 -0
  574. package/dist/structure/universal.d.ts +10 -4
  575. package/dist/structure/universal.d.ts.map +1 -1
  576. package/dist/structure/universal.js +26 -7
  577. package/dist/structure/universal.js.map +1 -1
  578. package/dist/structure/unspaced-heading.d.ts +10 -0
  579. package/dist/structure/unspaced-heading.d.ts.map +1 -0
  580. package/dist/structure/unspaced-heading.js +24 -0
  581. package/dist/structure/unspaced-heading.js.map +1 -0
  582. package/dist/structure/written-list-path.d.ts +10 -0
  583. package/dist/structure/written-list-path.d.ts.map +1 -0
  584. package/dist/structure/written-list-path.js +37 -0
  585. package/dist/structure/written-list-path.js.map +1 -0
  586. package/dist/structure/written-resolve.d.ts +1 -1
  587. package/dist/structure/written-resolve.d.ts.map +1 -1
  588. package/dist/structure/written-resolve.js +15 -9
  589. package/dist/structure/written-resolve.js.map +1 -1
  590. package/dist/title-line.d.ts +23 -0
  591. package/dist/title-line.d.ts.map +1 -0
  592. package/dist/title-line.js +28 -0
  593. package/dist/title-line.js.map +1 -0
  594. package/dist/topic-clause.d.ts +7 -0
  595. package/dist/topic-clause.d.ts.map +1 -0
  596. package/dist/topic-clause.js +87 -0
  597. package/dist/topic-clause.js.map +1 -0
  598. package/dist/uncounted-particles.d.ts +18 -0
  599. package/dist/uncounted-particles.d.ts.map +1 -0
  600. package/dist/uncounted-particles.js +47 -0
  601. package/dist/uncounted-particles.js.map +1 -0
  602. package/package.json +3 -3
  603. package/rules/adversative-ga-repeat.yaml +1 -0
  604. package/rules/all-caps-shouting.yaml +2 -2
  605. package/rules/announced-count-mismatch.yaml +2 -2
  606. package/rules/bare-url-mix.yaml +2 -2
  607. package/rules/bracket-nesting.yaml +2 -2
  608. package/rules/bracket-width-consistency.yaml +2 -2
  609. package/rules/broken-link.yaml +2 -2
  610. package/rules/cliche.yaml +4 -3
  611. package/rules/code-fence-language-mix.yaml +2 -2
  612. package/rules/comparative-without-baseline.yaml +2 -2
  613. package/rules/concrete-evidence-density.yaml +1 -0
  614. package/rules/contraction-consistency.yaml +2 -2
  615. package/rules/dangling-figure-reference.yaml +2 -2
  616. package/rules/date-without-year.yaml +10 -2
  617. package/rules/defined-term-form.yaml +2 -2
  618. package/rules/doubled-punctuation.yaml +4 -4
  619. package/rules/doubled-word.yaml +2 -2
  620. package/rules/duplicate-definition.yaml +2 -2
  621. package/rules/duplicate-heading.yaml +2 -2
  622. package/rules/duration-mismatch.yaml +2 -2
  623. package/rules/email-greeting-closing.yaml +2 -2
  624. package/rules/email-subject-length.yaml +2 -2
  625. package/rules/empty-table-cell.yaml +2 -2
  626. package/rules/footnote-mismatch.yaml +2 -2
  627. package/rules/fullwidth-alnum-consistency.yaml +2 -2
  628. package/rules/heading-echo.yaml +2 -2
  629. package/rules/ime-residue.yaml +2 -2
  630. package/rules/kanji-compound-slip.yaml +67 -0
  631. package/rules/kutoten-consistency.yaml +4 -4
  632. package/rules/latin-spacing.yaml +2 -2
  633. package/rules/list-item-form-mix.yaml +2 -2
  634. package/rules/max-kanji-continuous.yaml +6 -4
  635. package/rules/max-sentence-length.yaml +2 -2
  636. package/rules/modal-conflict.yaml +1 -0
  637. package/rules/nado-closed-list.yaml +2 -2
  638. package/rules/ngram-repetition.yaml +2 -2
  639. package/rules/no-doubled-joshi.yaml +2 -2
  640. package/rules/no-mixed-desumasu.yaml +3 -3
  641. package/rules/no-nakaguro-parallel.yaml +2 -0
  642. package/rules/number-without-unit.yaml +9 -4
  643. package/rules/numbering-gap.yaml +7 -2
  644. package/rules/numeral-sentence-start.yaml +2 -2
  645. package/rules/obligation-without-deadline.yaml +2 -2
  646. package/rules/orthographic-variant.yaml +2 -2
  647. package/rules/oxford-comma-consistency.yaml +3 -3
  648. package/rules/preamble-length.yaml +3 -2
  649. package/rules/range-notation-consistency.yaml +2 -2
  650. package/rules/requirement-smell.yaml +3 -3
  651. package/rules/table-header-variant.yaml +2 -2
  652. package/rules/teki-overuse.yaml +3 -2
  653. package/rules/title-length.yaml +2 -2
  654. package/rules/topic-predicate-distance.yaml +2 -2
  655. package/rules/total-mismatch.yaml +2 -2
  656. package/rules/translationese-density.yaml +2 -2
  657. package/rules/undefined-acronym.yaml +5 -2
  658. package/rules/undefined-term.yaml +2 -2
  659. package/rules/unfilled-placeholder.yaml +4 -4
  660. package/rules/unqualified-superlative.yaml +1 -1
  661. package/rules/unused-definition.yaml +2 -2
  662. package/rules/use-before-definition.yaml +2 -2
  663. package/rules/vague-word-density.yaml +2 -2
  664. package/skills/chaff/SKILL.md +7 -1
  665. package/src/announced-count.ts +35 -8
  666. package/src/chronology-rows.ts +86 -0
  667. package/src/company-name-run.ts +37 -0
  668. package/src/compound-head.ts +25 -0
  669. package/src/date-format.ts +43 -4
  670. package/src/derived/count-per-period.ts +28 -0
  671. package/src/detectors/acronym-context.ts +30 -1
  672. package/src/detectors/acronym-expansion.ts +54 -6
  673. package/src/detectors/acronym-known.ts +40 -0
  674. package/src/detectors/acronym-link.ts +75 -0
  675. package/src/detectors/acronym-mention.ts +44 -0
  676. package/src/detectors/acronym-name.ts +29 -6
  677. package/src/detectors/addressee-edge.ts +16 -0
  678. package/src/detectors/addressee-title-edge.ts +39 -0
  679. package/src/detectors/announced-count.ts +1 -0
  680. package/src/detectors/bare-comparative.ts +44 -3
  681. package/src/detectors/blank-structure.ts +21 -10
  682. package/src/detectors/bracket-specified.ts +25 -0
  683. package/src/detectors/broken-link.ts +26 -2
  684. package/src/detectors/capitalised-term.ts +26 -2
  685. package/src/detectors/caps-caption.ts +76 -0
  686. package/src/detectors/caps-phrase.ts +17 -0
  687. package/src/detectors/char-shape.ts +73 -14
  688. package/src/detectors/citation-sentence.ts +44 -0
  689. package/src/detectors/cited-title.ts +15 -3
  690. package/src/detectors/contraction-mention.ts +24 -0
  691. package/src/detectors/counter-edge.ts +17 -2
  692. package/src/detectors/dash-break.ts +45 -0
  693. package/src/detectors/date-any-year.ts +34 -9
  694. package/src/detectors/date-format.ts +2 -1
  695. package/src/detectors/date-year.ts +64 -16
  696. package/src/detectors/deadline-unit.ts +40 -0
  697. package/src/detectors/defined-term-form.ts +32 -12
  698. package/src/detectors/definition-use.ts +17 -9
  699. package/src/detectors/derived-numbers.ts +19 -4
  700. package/src/detectors/document-shape.ts +20 -1
  701. package/src/detectors/doubled-across-aside.ts +36 -0
  702. package/src/detectors/doubled-punctuation.ts +28 -7
  703. package/src/detectors/doubled-word.ts +2 -1
  704. package/src/detectors/duplicate-heading.ts +26 -3
  705. package/src/detectors/ellipsis.ts +16 -1
  706. package/src/detectors/email-letter.ts +142 -23
  707. package/src/detectors/field-label.ts +25 -0
  708. package/src/detectors/footnote-mismatch.ts +39 -7
  709. package/src/detectors/fullwidth-alnum.ts +9 -1
  710. package/src/detectors/graded-step.ts +52 -0
  711. package/src/detectors/gram-openers.ts +50 -0
  712. package/src/detectors/gram-place.ts +10 -1
  713. package/src/detectors/gram-predicate.ts +43 -3
  714. package/src/detectors/heading-echo.ts +31 -3
  715. package/src/detectors/heading-record-rhythm.ts +57 -0
  716. package/src/detectors/ime-residue.ts +4 -3
  717. package/src/detectors/kanji-compound-slip.ts +61 -0
  718. package/src/detectors/kutoten-consistency.ts +102 -14
  719. package/src/detectors/lexicon.ts +18 -5
  720. package/src/detectors/link-shape.ts +10 -3
  721. package/src/detectors/list-item-ending.ts +51 -0
  722. package/src/detectors/list-parallel.ts +158 -33
  723. package/src/detectors/list-sentence.ts +5 -1
  724. package/src/detectors/mark-shape.ts +89 -10
  725. package/src/detectors/mentioned-phrase.ts +38 -0
  726. package/src/detectors/middle-dot.ts +7 -2
  727. package/src/detectors/modal-conflict.ts +5 -2
  728. package/src/detectors/name-variant.ts +6 -0
  729. package/src/detectors/notice-paragraph.ts +33 -0
  730. package/src/detectors/number-style.ts +14 -2
  731. package/src/detectors/number-unit.ts +28 -1
  732. package/src/detectors/numeral-opener.ts +27 -1
  733. package/src/detectors/obligation-without-deadline.ts +29 -4
  734. package/src/detectors/open-end-class.ts +78 -0
  735. package/src/detectors/open-end-condition.ts +40 -0
  736. package/src/detectors/open-end-names.ts +9 -3
  737. package/src/detectors/open-end-question.ts +50 -0
  738. package/src/detectors/open-end-scope.ts +62 -0
  739. package/src/detectors/opening-date.ts +47 -0
  740. package/src/detectors/ordinary-phrase.ts +62 -0
  741. package/src/detectors/organisation-run.ts +18 -2
  742. package/src/detectors/orthographic-variant.ts +124 -25
  743. package/src/detectors/orthography.ts +15 -2
  744. package/src/detectors/oxford-comma.ts +74 -3
  745. package/src/detectors/person-consistency.ts +5 -3
  746. package/src/detectors/phrase-match.ts +16 -5
  747. package/src/detectors/placeholder-text.ts +18 -3
  748. package/src/detectors/placeholder.ts +10 -3
  749. package/src/detectors/postcode-end.ts +16 -0
  750. package/src/detectors/prose-total-words.ts +18 -0
  751. package/src/detectors/range-notation.ts +26 -6
  752. package/src/detectors/registry/kanji-compound-slip.ts +4 -0
  753. package/src/detectors/registry/phrase-in-use.ts +4 -0
  754. package/src/detectors/requirement-smell.ts +45 -8
  755. package/src/detectors/scaled-figure-unit.ts +103 -0
  756. package/src/detectors/sentence-counts.ts +64 -12
  757. package/src/detectors/sentence-ending.ts +12 -3
  758. package/src/detectors/sentence-length.ts +17 -4
  759. package/src/detectors/sentence-load.ts +9 -2
  760. package/src/detectors/signals.ts +50 -53
  761. package/src/detectors/structure-tree.ts +14 -14
  762. package/src/detectors/structure.ts +2 -1
  763. package/src/detectors/subject-name-line.ts +66 -0
  764. package/src/detectors/superlative-name.ts +10 -0
  765. package/src/detectors/table-header.ts +15 -1
  766. package/src/detectors/technical-docs.ts +5 -1
  767. package/src/detectors/term-mention-sentence.ts +31 -0
  768. package/src/detectors/titled-run.ts +9 -4
  769. package/src/detectors/token-shape.ts +16 -5
  770. package/src/detectors/undefined-term.ts +8 -0
  771. package/src/detectors/unknown-word.ts +1 -1
  772. package/src/detectors/vague-density.ts +20 -4
  773. package/src/document-paragraphs.ts +27 -0
  774. package/src/document.ts +3 -23
  775. package/src/figure-references.ts +7 -2
  776. package/src/format-template.ts +15 -0
  777. package/src/formula-brackets.ts +36 -0
  778. package/src/html/html-markdown.ts +2 -1
  779. package/src/html/html-site-chrome.ts +104 -0
  780. package/src/joined-view.ts +1 -0
  781. package/src/kanji-compound-slip.ts +98 -0
  782. package/src/latin-company-form.ts +38 -0
  783. package/src/latin-word-boundary.ts +64 -0
  784. package/src/leading-label.ts +15 -0
  785. package/src/lexicon-genres.ts +1 -1
  786. package/src/link-shape.ts +31 -0
  787. package/src/link-title.ts +38 -0
  788. package/src/list-item-paragraphs.ts +22 -0
  789. package/src/literal-quote.ts +55 -0
  790. package/src/nado-closed-list.ts +48 -5
  791. package/src/name-misspelt-usual.ts +25 -0
  792. package/src/name-separator.ts +27 -2
  793. package/src/nominal-stem.ts +62 -5
  794. package/src/notice-header.ts +57 -0
  795. package/src/person-forms.ts +15 -0
  796. package/src/plugin.ts +5 -0
  797. package/src/preamble-paragraphs.ts +13 -3
  798. package/src/sentence-load.ts +14 -3
  799. package/src/spacing-code.ts +5 -1
  800. package/src/split-noun.ts +63 -0
  801. package/src/structure/attached-parts.ts +47 -0
  802. package/src/structure/build.ts +7 -4
  803. package/src/structure/contents-lines.ts +63 -0
  804. package/src/structure/defining-names.ts +155 -0
  805. package/src/structure/definition-use.ts +149 -32
  806. package/src/structure/gerund-phrase.ts +31 -0
  807. package/src/structure/issues.ts +7 -3
  808. package/src/structure/list-lead-in.ts +94 -0
  809. package/src/structure/modal-conflict.ts +42 -7
  810. package/src/structure/negated-act.ts +49 -0
  811. package/src/structure/numbering.ts +24 -9
  812. package/src/structure/prose-total.ts +20 -6
  813. package/src/structure/repeated-number.ts +110 -0
  814. package/src/structure/rounded-amount.ts +55 -0
  815. package/src/structure/side-step.ts +21 -0
  816. package/src/structure/spanned-label-blank.ts +39 -0
  817. package/src/structure/universal.ts +33 -9
  818. package/src/structure/unspaced-heading.ts +27 -0
  819. package/src/structure/written-list-path.ts +46 -0
  820. package/src/structure/written-resolve.ts +16 -9
  821. package/src/title-line.ts +53 -0
  822. package/src/topic-clause.ts +109 -0
  823. package/src/uncounted-particles.ts +72 -0
@@ -1,20 +1,23 @@
1
1
  import { proseText } from "../measure.ts";
2
2
  import { dateSpans, wordsOf } from "./structure.ts";
3
- import { compacted, placeAt, type Compacted } from "./gram-place.ts";
3
+ import { compacted, linkedIn, placeAt } from "./gram-place.ts";
4
4
  import { charWindows, wordWindows } from "./gram-windows.ts";
5
5
  import { furnitureMask, isFurniture } from "./gram-furniture.ts";
6
- import { notAcronymSpansOf, type NotAcronymSpans } from "./acronym-context.ts";
7
- import { nameSpansOf } from "./acronym-name.ts";
8
- import { abbreviates, expansionAt, termEntryAcronyms, type ExpandedAt } from "./acronym-expansion.ts";
6
+ import { lexiconNotationOf, type NotAcronymSpans } from "./acronym-context.ts";
7
+ import { abbreviates, expansionAt, termEntryAcronyms, type DefinitionWords, type ExpandedAt } from "./acronym-expansion.ts";
9
8
  import { isExplained } from "./acronym-compound.ts";
10
9
  import { statedAcronyms } from "./acronym-definition.ts";
11
10
  import { isBracketed, isInHeading, isNamePart } from "./acronym-lone.ts";
11
+ import { linkedListTerms, linkTitleSpans } from "./acronym-link.ts";
12
+ import { caseVariantsIn, spelledOutAcronyms } from "./acronym-mention.ts";
12
13
  import { conjugatedForms } from "./conjugated-form.ts";
13
14
  import { evidenceSpans, hasNumeral, isClaim, isLabelOnly, startsWithin, type AdviceWords } from "./concrete-evidence.ts";
14
15
  import { letteredIndexEntries } from "./lettered-index.ts";
16
+ import { knownByDocument } from "./acronym-known.ts";
15
17
  import { outlineLabelSpans } from "./outline-label.ts";
16
18
  import { hasPredicateIn } from "./gram-predicate.ts";
17
19
  import { gramPassagesOf } from "./gram-passages.ts";
20
+ import { sectionOpeners } from "./gram-openers.ts";
18
21
  import { nameSpans, touchesAny } from "../team-names.ts";
19
22
  import { referenceListSpans } from "../reference-lists.ts";
20
23
  import type { Detector, Finding, ProseDocument, Section, Sentence } from "../plugin.ts";
@@ -97,15 +100,6 @@ type FirstSeen = { readonly gram: string; readonly sentence: Sentence; readonly
97
100
 
98
101
  type Tally = { readonly counts: Map<string, number>; readonly first: Map<string, FirstSeen> };
99
102
 
100
- /** 詰めた文の index 番目の文字が、リンクの文字か。 */
101
- const linkedIn = (doc: ProseDocument, sentence: Sentence, source: Compacted): ((index: number) => boolean) => {
102
- const links = doc.links.filter((link) => link.start < sentence.span.end && sentence.span.start < link.end);
103
- return (index) => {
104
- const at = sentence.span.start + (source.offsets[index] ?? -1);
105
- return links.some((link) => link.start <= at && at < link.end);
106
- };
107
- };
108
-
109
103
  /** 英語は大文字と小文字を区別せずに数える。文頭の "Proposals submitted via" も文中の "proposals submitted via" も同じ言い回し。 */
110
104
  const keyOf = (gram: string, unit: ProseDocument["lengthUnit"]): string => (unit === "word" ? gram.toLowerCase() : gram);
111
105
 
@@ -140,12 +134,16 @@ const gramsOf = (doc: ProseDocument, sentences: readonly Sentence[]): Tally => {
140
134
 
141
135
  type Repeat = { readonly key: string; readonly count: number; readonly at: FirstSeen | undefined };
142
136
 
143
- /** 範囲(gram-passages.ts)ごとに数える。よくある質問の別々の答えは別の範囲。 */
144
- const repeatsOf = (doc: ProseDocument, limit: number): Repeat[] =>
137
+ /** 範囲(gram-passages.ts)ごとに数える。よくある質問の別々の答えは別の範囲。節の最初の文にだけ出るものは節のひな形(gram-openers.ts)。 */
138
+ const repeatsOf = (doc: ProseDocument, limit: number, openers = sectionOpeners(doc.sections, doc.source)): Repeat[] =>
145
139
  gramPassagesOf(doc.sections).flatMap((sentences) => {
146
140
  const tally = gramsOf(doc, sentences);
141
+ const opening = gramsOf(
142
+ doc,
143
+ sentences.filter((sentence) => openers.has(sentence)),
144
+ ).counts;
147
145
  return [...tally.counts.entries()]
148
- .filter(([key, count]) => count > limit && isPhrasing(key, doc.lengthUnit))
146
+ .filter(([key, count]) => count > limit && isPhrasing(key, doc.lengthUnit) && (opening.get(key) ?? 0) < count)
149
147
  .map(([key, count]) => ({ key, count, at: tally.first.get(key) }));
150
148
  });
151
149
 
@@ -184,9 +182,10 @@ export const ngramRepetition: Detector = (doc, options): Finding[] => {
184
182
  *
185
183
  * & で繋いだ大文字は 1 語として読む(ATT&CK、M&IE)。割ると CK や IE が別の略語に見える。
186
184
  * - で繋いだ略語どうしも 1 語(RT-PCR)。割ると RT が別の略語に見える。数字を含むもの(COVID-19)は識別子として外す。
185
+ * 下付きの数字が続く大文字は化学式(CO₂、SO₄)で、説明を待つ略語ではない。数字や小文字が続くもの(CO2、NOx)と同じく語の途中と読む。
187
186
  */
188
187
  const EDGE_BEFORE = String.raw`(?<![A-Za-z0-9_&])`;
189
- const EDGE_AFTER = String.raw`(?![A-Za-z0-9_&])`;
188
+ const EDGE_AFTER = String.raw`(?![A-Za-z0-9_&\u2080-\u2089])`;
190
189
  /** 略語として読む大文字の長さの上限。これより長い大文字の語(BILLING)は、普通の語を大文字で書いたもの。 */
191
190
  const ACRONYM_MAX = 6;
192
191
  const ACRONYM_PART = String.raw`(?:[A-Z]+(?:&[A-Z]+)+|[A-Z]{2,${ACRONYM_MAX}})`;
@@ -274,9 +273,10 @@ const outsideSpans = (hits: readonly AcronymHit[], spans: readonly Span[]): Acro
274
273
  /**
275
274
  * どこか 1 か所で展開してあればよい。初出が節の見出し代わりの語(「5.3. DPA.」)で、
276
275
  * 展開がその直後の文にあることが契約書では普通にある。見るのは語として現れた所だけ(CISA の中の CI は見ない)。
276
+ * 複数形(Special Interest Groups (SIGs))の展開は、s の無い略語(SIG)の展開でもある。
277
277
  */
278
278
  const isExpanded = (body: string, acronym: string, expandedAt: ExpandedAt): boolean =>
279
- [...body.matchAll(new RegExp(`${EDGE_BEFORE}${acronym}${EDGE_AFTER}`, "gu"))].some((match) => expandedAt(body, acronym, match.index));
279
+ [...body.matchAll(new RegExp(`${EDGE_BEFORE}${acronym}s?${EDGE_AFTER}`, "gu"))].some((match) => expandedAt(body, match[0], match.index));
280
280
 
281
281
  /**
282
282
  * 見出しは文にならないので、見出しの中の展開(Maximum Envelope of Water (MEOW) runs)は見出しの文字列で探す。
@@ -287,35 +287,13 @@ const expandsInHeading = (heading: string, acronym: string, expandedAt: Expanded
287
287
 
288
288
  const patternsOf = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
289
289
 
290
- const notationOf = (doc: ProseDocument): NotAcronymSpans => {
291
- const notation = notAcronymSpansOf({
292
- meridiem: patternsOf(doc, "meridiem"),
293
- timeZones: patternsOf(doc, "time-zone"),
294
- currencies: patternsOf(doc, "currency-code"),
295
- usStates: patternsOf(doc, "us-state-code"),
296
- emphasis: patternsOf(doc, "emphasis-word"),
297
- divisions: patternsOf(doc, "numbered-division"),
298
- abbreviatedLabels: patternsOf(doc, "abbreviated-label"),
299
- honorifics: patternsOf(doc, "honorific"),
300
- titles: patternsOf(doc, "name-title"),
301
- dateTimeUnits: patternsOf(doc, "date-time-unit"),
302
- });
303
- const names = nameSpansOf({
304
- legalForms: patternsOf(doc, "legal-form"),
305
- determiners: patternsOf(doc, "name-determiner"),
306
- citationSeries: patternsOf(doc, "citation-series"),
307
- carriers: patternsOf(doc, "carrier-name"),
308
- namePrefixes: patternsOf(doc, "name-prefix"),
309
- streetSuffixes: patternsOf(doc, "street-suffix"),
310
- capitalPhrases: patternsOf(doc, "capital-phrase"),
311
- });
312
- return (text) => [...notation(text), ...names(text)];
313
- };
290
+ const notationOf = (doc: ProseDocument): NotAcronymSpans => lexiconNotationOf((id) => patternsOf(doc, id));
314
291
 
315
- /** 定義の語は、語彙表の形(という)と、この文書で活用して書かれた形(といいます)の両方で照らす。 */
316
- const definitionVerbsOf = (doc: ProseDocument): string[] => {
292
+ /** 定義の語。定義の動詞は、語彙表の形(という)と、この文書で活用して書かれた形(といいます)の両方で照らす。 */
293
+ const definitionWordsOf = (doc: ProseDocument): DefinitionWords => {
317
294
  const verbs = patternsOf(doc, "definition-verb");
318
- return [...verbs, ...conjugatedForms(doc.sentences, verbs)];
295
+ const alternatives = patternsOf(doc, "definition-alternative");
296
+ return { markers: patternsOf(doc, "definition-marker"), verbs: [...verbs, ...conjugatedForms(doc.sentences, verbs)], alternatives };
319
297
  };
320
298
 
321
299
  const acronymFinding = (acronym: string, hit: Hit, count: number, limit: number): Finding => ({
@@ -340,32 +318,51 @@ export const undefinedAcronym: Detector = (doc, options): Finding[] => {
340
318
  const body = bodyOf(doc);
341
319
  // HTTP のメソッド名(GET)は略語ではなく、税の名前(VAT、GST)は読み手が名前として知るので、通じる略語と同じく展開を求めない。
342
320
  // 並べた名前(JAXA)も、繋いだ略語(JAXA-ISAS)の片割れとして説明済みに数える。
321
+ // 文書が自分で知らせた語(select を書いた文書の SELECT、リンクで引いた講演の場 [Jane Roe, FOSDEM 2024](…))も同じ。
343
322
  const common = new Set([
344
323
  ...(options.lexicon ?? []).map((entry) => entry.pattern),
345
- ...patternsOf(doc, "http-method"),
346
- ...patternsOf(doc, "tax-code"),
324
+ ...knownByDocument(doc.source, doc.links).concat(patternsOf(doc, "http-method"), patternsOf(doc, "tax-code")),
347
325
  ...(doc.names ?? []),
348
326
  ]);
349
- const expandedAt = expansionAt({ markers: patternsOf(doc, "definition-marker"), verbs: definitionVerbsOf(doc) });
327
+ const expandedAt = expansionAt(definitionWordsOf(doc));
350
328
  const stated = statedAcronyms(doc.source, { statements: patternsOf(doc, "definition-statement"), markers: patternsOf(doc, "definition-marker") });
351
- const entries = new Set([...termEntryAcronyms(doc.source), ...stated]);
329
+ // 一覧の語のすぐ下でその語を名指すリンク(- GPL / [GNU General Public License …](…))と、略語を話題にして書き出した文
330
+ // (the abbreviation DOB … date of birth)も、略語の説明と読む。
331
+ const spelled = spelledOutAcronyms(
332
+ doc.sentences.map((sentence) => sentence.text),
333
+ patternsOf(doc, "abbreviation-mention"),
334
+ );
335
+ const entries = new Set([...termEntryAcronyms(doc.source), ...stated, ...linkedListTerms(doc.source), ...spelled]);
352
336
  const headings = doc.sections.map((section) => section.heading);
353
- const explainedAlone = (word: string): boolean =>
337
+ const explainedAsWritten = (word: string): boolean =>
354
338
  common.has(word) || entries.has(word) || isExpanded(body, word, expandedAt) || headings.some((heading) => expandsInHeading(heading, word, expandedAt));
355
- const hits = outsideSpans(acronymsOf(doc, notationOf(doc)), [
339
+ // 大文字の違うだけの書き方(TCoP と TCOP)は同じ略語と読む。どちらかで説明してあれば説明済み。
340
+ const written = [body, ...headings].join("\n");
341
+ const explained = new Map<string, boolean>();
342
+ const explainedAlone = (word: string): boolean => {
343
+ const known = explained.get(word) ?? (explainedAsWritten(word) || caseVariantsIn(written, word).some(explainedAsWritten));
344
+ explained.set(word, known);
345
+ return known;
346
+ };
347
+ const counted = outsideSpans(acronymsOf(doc, notationOf(doc)), [
356
348
  ...referenceListSpans(doc.source, patternsOf(doc, "reference-list-heading")),
357
349
  ...outlineLabelSpans(doc.source, patternsOf(doc, "numbered-division")),
358
350
  ]);
351
+ // リンク先のページの題名の略語([NASA Fprime AI Policy](https://…))は、読み手が出会う説明の無い略語として数に入れるが、
352
+ // 書き手が直せないので指さない。
353
+ const hits = outsideSpans(counted, linkTitleSpans(doc.source, doc.links));
359
354
  const acronyms = [...firstHits(hits).keys()];
360
355
  const unexplained = new Set(acronyms.filter((acronym) => !isExplained(acronym, explainedAlone)));
356
+ const quoted = [...firstHits(counted).keys()].filter((acronym) => !acronyms.includes(acronym) && !isExplained(acronym, explainedAlone)).length;
361
357
  const bracketed = (acronym: string): boolean => [body, ...headings].some((text) => isBracketed(text, acronym));
362
358
  // 定義の一覧("SOW" means …)で定義する書き手も、略語を展開する書き手と数える。
363
359
  const definedByWriter = (acronym: string): boolean => bracketed(acronym) || stated.has(acronym);
364
360
  const writerSpellsOut = acronyms.filter((acronym) => !common.has(acronym) && explainedAlone(acronym) && definedByWriter(acronym)).length >= options.limit;
365
361
  // 日付を読むには文書の木を作る。上限に届かない文書では作らない。
366
- if (unexplained.size < options.limit && !writerSpellsOut) return [];
362
+ if (unexplained.size + quoted < options.limit && !writerSpellsOut) return [];
367
363
  const bare = [...firstHits(outsideSpans(hits, dateSpans(doc)))].filter(([acronym]) => unexplained.has(acronym));
368
- if (bare.length >= options.limit) return bare.map(([acronym, hit]) => acronymFinding(acronym, hit, bare.length, options.limit));
364
+ const met = bare.length + quoted;
365
+ if (met >= options.limit) return bare.map(([acronym, hit]) => acronymFinding(acronym, hit, met, options.limit));
369
366
  if (!writerSpellsOut) return [];
370
367
  const alone = bare.filter(([acronym, hit]) => !isNamePartAt(acronym, hit) && !isInHeading(headings, acronym));
371
368
  return alone.map(([acronym, hit]) => acronymFinding(acronym, hit, alone.length, options.limit));
@@ -1,6 +1,8 @@
1
1
  import type { Detector, Finding, ProseDocument, StructureNode } from "../plugin.ts";
2
2
  import { danglingReferences, duplicateDefinitions, inDocumentOrder, type StructureIssue } from "../structure/issues.ts";
3
3
  import { numberingBreaks } from "../structure/numbering.ts";
4
+ import { attachedPartStarts } from "../structure/attached-parts.ts";
5
+ import { sideStepReader } from "../structure/side-step.ts";
4
6
  import { htmlTextBlocks } from "../structure/html-text-blocks.ts";
5
7
  import { listsNumberBreaks } from "../structure/list-numbering.ts";
6
8
  import { weekdayMismatches } from "../structure/weekday.ts";
@@ -9,6 +11,7 @@ import { dateOrderBreaks } from "../structure/date-order.ts";
9
11
  import { totalMismatches, type Amount } from "../structure/total.ts";
10
12
  import { isListedTotal, isPeriodTotalLine, isTotalLikeLine, isTotalLine } from "../structure/total-line.ts";
11
13
  import { proseTotalMismatches } from "../structure/prose-total.ts";
14
+ import { proseTotalWordsOf } from "./prose-total-words.ts";
12
15
  import { countedAmounts, type SummedCounter } from "../structure/counted-amounts.ts";
13
16
  import { measuredAmounts, type MeasureMarks, type SummedMeasure } from "../structure/measured-amounts.ts";
14
17
  import { withCompoundHours } from "../structure/compound-hours.ts";
@@ -41,7 +44,7 @@ const findingsOf =
41
44
  doc.structure === undefined
42
45
  ? []
43
46
  : issuesOf(doc.structure, doc.source).map((issue) => ({
44
- rule,
47
+ ...(issue.variant === undefined ? { rule } : { rule, variant: issue.variant }),
45
48
  severity: "error",
46
49
  line: 0,
47
50
  column: 0,
@@ -52,8 +55,11 @@ const findingsOf =
52
55
  export const danglingReference: Detector = (doc, options) =>
53
56
  findingsOf("dangling-reference", (tree, source) => danglingReferences(tree, source, patternsOf(doc, "section-name-noun")))(doc, options);
54
57
  /** Markdown の HTML ブロックの中の条は木に入らない。そこを挟んだ抜けは、見えなかった番号かもしれない。 */
55
- const structureNumberingGap: Detector = (doc, options) =>
56
- findingsOf("numbering-gap", (tree, source) => numberingBreaks(tree, doc.markup?.markdown === true ? htmlTextBlocks(source) : []))(doc, options);
58
+ const structureNumberingGap: Detector = (doc, options) => {
59
+ const isSideStep = sideStepReader(patternsOf(doc, "side-step-label"));
60
+ const hiddenBlocks = (source: string) => (doc.markup?.markdown === true ? htmlTextBlocks(source) : []);
61
+ return findingsOf("numbering-gap", (tree, source) => numberingBreaks(tree, hiddenBlocks(source), isSideStep))(doc, options);
62
+ };
57
63
 
58
64
  const lineStartAt = (source: string, offset: number): number => source.lastIndexOf("\n", offset - 1) + 1;
59
65
 
@@ -90,7 +96,10 @@ export const numberingGap: Detector = (doc, options): Finding[] => {
90
96
  (left, right) => Number(left.values["offset"]) - Number(right.values["offset"]),
91
97
  );
92
98
  };
93
- export const duplicateDefinition: Detector = findingsOf("duplicate-definition", duplicateDefinitions);
99
+ export const duplicateDefinition: Detector = (doc, options) => {
100
+ const labels = patternsOf(doc, "attached-instrument-label");
101
+ return findingsOf("duplicate-definition", (tree, source) => duplicateDefinitions(tree, attachedPartStarts(source, labels)))(doc, options);
102
+ };
94
103
 
95
104
  /** 曜日の名前は言語パッケージの語彙表(weekday、日曜日から順)から取る。無ければ番号のまま。 */
96
105
  const dayName = (doc: ProseDocument, day: unknown): string => {
@@ -262,20 +271,11 @@ const totalIssues = (doc: ProseDocument, tree: NonNullable<ProseDocument["struct
262
271
  (text) => isPeriodTotalLine(text, words),
263
272
  { isListed: (text) => isListedTotal(text, words), isTotalLike: (text, header) => isTotalLikeLine(text, words, header) },
264
273
  );
265
- const phrases = {
266
- totals: patternsOf(doc, "total-phrase"),
267
- breakdowns: patternsOf(doc, "breakdown-phrase"),
268
- discounts: patternsOf(doc, "discount-word"),
269
- joiners: patternsOf(doc, "breakdown-gap-joiner"),
270
- leads: patternsOf(doc, "total-breakdown-lead"),
271
- partials: patternsOf(doc, "breakdown-partial-word"),
272
- backReferences: patternsOf(doc, "total-back-reference"),
273
- };
274
274
  const prose = proseTotalMismatches(
275
275
  doc.source,
276
276
  doc.sentences.map((sentence) => sentence.span),
277
277
  amounts,
278
- phrases,
278
+ proseTotalWordsOf(doc),
279
279
  );
280
280
  return [...lines, ...prose.filter((issue) => !lines.some((line) => line.offset === issue.offset))];
281
281
  };
@@ -138,7 +138,8 @@ const withoutDateStamps = (doc: ProseDocument, paragraphs: readonly Paragraph[])
138
138
  export const preambleLength: Detector = (doc, options): Finding[] => {
139
139
  const body = bodySectionOf(doc.sections);
140
140
  if (body === undefined) return [];
141
- const all = preambleParagraphs(doc.paragraphs, body.span.start, doc.source);
141
+ const noteMarks = (doc.lexicons["note-mark"] ?? []).map((entry) => entry.pattern);
142
+ const all = preambleParagraphs(doc.paragraphs, body.span.start, doc.source, noteMarks);
142
143
  if (all.length <= options.limit) return [];
143
144
  const before = withoutDateStamps(doc, all);
144
145
  if (before.length <= options.limit) return [];
@@ -0,0 +1,66 @@
1
+ // A line under a heading that gives the name of what the heading is about, not a sentence restating it: the label of a
2
+ // link or an attachment the heading introduces (### 実施要綱について → 実施要綱), or a list named after the heading
3
+ // (## 皆さんの声 → 「皆さんの声」一覧). A converted page keeps such labels as plain lines. Pure.
4
+ import { isContent } from "./content-morphemes.ts";
5
+ import type { Token } from "../plugin.ts";
6
+
7
+ /** A title is made of these: names, the words that build a name (annual, の, of, and), no predicate. */
8
+ const TITLE_POS: ReadonlySet<string> = new Set(["NOUN", "PROPN", "NUM", "PUNCT", "SYM", "X", "ADJ", "ADP", "DET", "CCONJ"]);
9
+ /** A line that ends like a sentence says something, whatever its words. */
10
+ const SENTENCE_END = /[。..!?!?]$/u;
11
+
12
+ const isTitle = (tokens: readonly Token[]): boolean => tokens.some(isContent) && tokens.every((token) => TITLE_POS.has(token.pos));
13
+
14
+ const baseForm = (token: Token): string => (token.lemma ?? token.surface).toLowerCase();
15
+
16
+ /** Brackets a line quotes a title in. */
17
+ const QUOTES: readonly (readonly [string, string])[] = [
18
+ ["「", "」"],
19
+ ["『", "』"],
20
+ ["“", "”"],
21
+ ['"', '"'],
22
+ ];
23
+
24
+ type Span = { readonly start: number; readonly end: number };
25
+
26
+ /** Where the line quotes the whole heading as a title, in the tokens' coordinates. */
27
+ const quotedHeading = (heading: string, line: string, lineStart: number): Span | undefined => {
28
+ const quoted = QUOTES.map(([open, close]) => `${open}${heading}${close}`).find((form) => line.includes(form));
29
+ if (quoted === undefined) return undefined;
30
+ const start = lineStart + line.indexOf(quoted);
31
+ return { start, end: start + quoted.length };
32
+ };
33
+
34
+ /** 「見出し」一覧: the heading quoted as a title, and only a name after it that says what the line is (一覧, page). */
35
+ const namesListAfterHeading = (outside: readonly Token[]): boolean => isTitle(outside);
36
+
37
+ /**
38
+ * 実施要綱 under ### 実施要綱について: the line is a title, and what the heading has beyond it only frames the name (について,
39
+ * About, 紹介). A line that copies the heading whole (### 研究科 → 研究科) is a repeat, and one that drops a word of the
40
+ * heading's own (### 精算方法の概要 → 精算方法) does not name the heading's subject.
41
+ */
42
+ const namesHeadingTopic = (heading: readonly Token[], line: readonly Token[], announcing: ReadonlySet<string>): boolean => {
43
+ if (!isTitle(line)) return false;
44
+ const named = new Set(line.map(baseForm));
45
+ const beyond = heading.filter((token) => token.pos !== "PUNCT" && !named.has(baseForm(token)));
46
+ return beyond.length > 0 && beyond.every((token) => !isContent(token) || announcing.has(baseForm(token)));
47
+ };
48
+
49
+ /**
50
+ * The first line under a heading names what the heading is about. `heading` is the heading's text without its number
51
+ * label, `headingTokens` its tokens; `lineTokens` are the line's, in the coordinates `lineStart` gives. `announcing`
52
+ * holds the words that only frame a subject (the heading-announcer lexicon's ungrouped entries).
53
+ */
54
+ export const namesHeadingSubject = (
55
+ heading: string,
56
+ headingTokens: readonly Token[],
57
+ line: string,
58
+ lineStart: number,
59
+ lineTokens: readonly Token[],
60
+ announcing: ReadonlySet<string>,
61
+ ): boolean => {
62
+ if (line.trim().includes("\n") || SENTENCE_END.test(line.trim()) || heading.trim() === "") return false;
63
+ const quoted = quotedHeading(heading.trim(), line, lineStart);
64
+ if (quoted !== undefined) return namesListAfterHeading(lineTokens.filter((token) => token.span.start < quoted.start || token.span.start >= quoted.end));
65
+ return namesHeadingTopic(headingTokens, lineTokens, announcing);
66
+ };
@@ -31,3 +31,13 @@ export const namesQuantity = (tokens: readonly Token[], range: TokenRange, quant
31
31
  const last = single ? lastJoined(tokens, range.end) : undefined;
32
32
  return last !== undefined && measures(last, quantities);
33
33
  };
34
+
35
+ /**
36
+ * 最上級の名詞に空白を挟まず接尾辞が付いて、別の語になっているか(最大化・最大化する)。「最大にする」という動詞で、
37
+ * 何かが一番だという主張ではない。接尾辞は言語パッケージの語彙表が持つ。
38
+ */
39
+ export const makesWord = (tokens: readonly Token[], range: TokenRange, suffixes: Lexicon): boolean => {
40
+ const last = tokens[range.end - 1];
41
+ const next = tokens[range.end];
42
+ return last !== undefined && next !== undefined && last.span.end === next.span.start && suffixes.some((entry) => entry.pattern === next.surface);
43
+ };
@@ -53,7 +53,21 @@ const rawCells = (line: Line): { readonly raw: string; readonly from: number }[]
53
53
  return inner.at(-1)?.raw.trim() === "" ? inner.slice(0, -1) : inner;
54
54
  };
55
55
 
56
- const labelCell = (line: Line, { raw, from }: { readonly raw: string; readonly from: number }): HeaderCell[] => {
56
+ /**
57
+ * An inline HTML tag in a cell (`<div style="…">`, `</div>`, `<br/>`): the reader sees none of it. A tag name ends at a space,
58
+ * a slash or `>`, so an autolink (`<https://…>`) is not one; an attribute in double quotes may hold a `>`.
59
+ */
60
+ const HTML_TAG = /<\/?[A-Za-z][\w-]*(?:\s(?:"[^"]*"|[^<>"])*)?\/?>/gu;
61
+
62
+ /**
63
+ * The cell with its HTML tags blanked out, same length, so the words keep their offsets and the spaces around them trim.
64
+ * A cell with a code span is left whole: a tag written in code is text the reader sees.
65
+ */
66
+ const withoutTags = (raw: string): string => (raw.includes("`") ? raw : raw.replace(HTML_TAG, (tag) => " ".repeat(tag.length)));
67
+
68
+ const labelCell = (line: Line, cell: { readonly raw: string; readonly from: number }): HeaderCell[] => {
69
+ const { from } = cell;
70
+ const raw = withoutTags(cell.raw);
57
71
  const trimmed = raw.trim();
58
72
  const unwrapped = unwrap(trimmed);
59
73
  const written = unwrapped.replace(INNER_MARKS, "").trim();
@@ -6,6 +6,7 @@ import { codeFences, codeSpans, type CodeFence } from "./code-fences.ts";
6
6
  import { opensAsNounPhrase } from "./nominal-step.ts";
7
7
  import { quoteAt } from "./structure-tree.ts";
8
8
  import { escapeRegExp } from "../orthography.ts";
9
+ import { isFormatTemplate } from "../format-template.ts";
9
10
  import type { Detector, Finding, ProseDocument, Span, Token } from "../plugin.ts";
10
11
 
11
12
  const patternsOf = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
@@ -25,6 +26,9 @@ const finding = (doc: ProseDocument, rule: string, offset: number, values: Reado
25
26
  values: { ...values, offset },
26
27
  });
27
28
 
29
+ /** A fence that should name a language: an untagged format template (<MAJOR>.<MINOR>) is in none, so it is left out. */
30
+ const wantsLanguage = (fence: CodeFence): boolean => fence.language !== "" || !isFormatTemplate(fence.lines);
31
+
28
32
  /** Fences without a language, when they are the fewer kind: a document that mostly leaves the language out is not reported. */
29
33
  export const untaggedFewer = (fences: readonly CodeFence[], limit: number): readonly CodeFence[] => {
30
34
  const untagged = fences.filter((fence) => fence.language === "");
@@ -33,7 +37,7 @@ export const untaggedFewer = (fences: readonly CodeFence[], limit: number): read
33
37
  };
34
38
 
35
39
  export const codeFenceLanguage: Detector = (doc, options): Finding[] => {
36
- const fences = codeFences(doc.source);
40
+ const fences = codeFences(doc.source).filter(wantsLanguage);
37
41
  const tagged = fences.filter((fence) => fence.language !== "").length;
38
42
  return untaggedFewer(fences, options.limit).map((fence) =>
39
43
  finding(doc, "code-fence-language-mix", fence.start, { tagged, untagged: fences.length - tagged }),
@@ -0,0 +1,31 @@
1
+ import { escapeRegExp } from "../orthography.ts";
2
+ import type { Sentence } from "../plugin.ts";
3
+
4
+ // An entry of a definitions list opens with the term it defines, in quotes ("Capital Contributions" The capital
5
+ // contribution to the Venture …). The words after the quoted name are the definition's own body, not uses of the term.
6
+ // Pure.
7
+
8
+ /** The ending a quoted name may carry past the term: a plural or a possessive (Contributions, Contribution's). */
9
+ const ENDING = String.raw`(?:e?s|['’]s)?`;
10
+ /** The label of a list item before the entry (a., (b), 1., iv)). */
11
+ const ITEM_LABEL = String.raw`(?:\(?[\p{L}\p{N}]{1,4}[.)]\s+)?`;
12
+ /** The quotes a term is named in, each with its own closing mark. */
13
+ const QUOTE_PAIRS = [
14
+ ['"', '"'],
15
+ ["“", "”"],
16
+ ["「", "」"],
17
+ ["『", "』"],
18
+ ] as const;
19
+
20
+ const entryHead = (term: string): RegExp => {
21
+ const quoted = QUOTE_PAIRS.map(([open, close]) => `${open}${escapeRegExp(term)}${ENDING}${close}`).join("|");
22
+ return new RegExp(`^\\s*${ITEM_LABEL}(?:${quoted})`, "u");
23
+ };
24
+
25
+ /** Whether the sentence holding offset is a definitions entry that opens with the term in quotes, and offset is after that name. */
26
+ export const inEntryOfTerm = (sentences: readonly Sentence[], term: string, offset: number): boolean => {
27
+ const sentence = sentences.find((candidate) => candidate.span.start <= offset && offset < candidate.span.end);
28
+ if (sentence === undefined) return false;
29
+ const head = entryHead(term).exec(sentence.text);
30
+ return head !== null && offset - sentence.span.start >= head[0].length;
31
+ };
@@ -6,8 +6,12 @@ export type TitleWords = { readonly endings: readonly string[] };
6
6
 
7
7
  /** 題を囲む括弧。鉤括弧と、見出しや分類の名前を囲む隅付き括弧。 */
8
8
  const TITLE_MARKS = { "「": "」", "『": "』", "【": "】" };
9
- /** 名前のすぐ後ろに付く、その名前の補い(就職氷河期世代)、略称(以下「奨励金」という。)、日付や番号。 */
10
- const QUALIFIER_OPENERS = new Set(["(", "("]);
9
+ /**
10
+ * 名前のすぐ後ろ(同じ行の空白を挟んでもよい)に付く、その名前の補い(就職氷河期世代、<創業型>)、略称(以下「奨励金」という。)、
11
+ * 日付や番号、ファイルの種類と大きさ([PDFファイル/333KB])の括弧。角括弧は同じ行で閉じ、Markdown のリンク([文字](…))でないもの。
12
+ * 半角の < は HTML の札と見分けられないので読まない。
13
+ */
14
+ const QUALIFIER = /^[ \t\u3000]*(?:[((<〈[]|\[[^\]\n]*\](?![([]))/u;
11
15
  /** 閉じる語の前に要る字数。1 字なら、題ではなく普通の語(新法、本事業)。 */
12
16
  const MIN_BODY_LENGTH = 2;
13
17
  const BLANK = /^\s*$/u;
@@ -27,11 +31,12 @@ export const endsInTitle = (run: readonly Token[], words: TitleWords): boolean =
27
31
  /**
28
32
  * 文(text)の start から end までの連なりが、題の名前の置き方をしているか。
29
33
  * 括弧の中身の終わりで閉じる(「令和8年度高度統計人材育成強化拠点形成事業」)、すぐ後ろに補いの括弧が付く
30
- * (国家公務員中途採用者選考試験(就職氷河期世代))、または文がその連なりだけ(要綱の題を並べた行)。
34
+ * (国家公務員中途採用者選考試験(就職氷河期世代)、持続化補助金<創業型>、登録申込書 [PDFファイル/333KB])、
35
+ * または文がその連なりだけ(要綱の題を並べた行)。
31
36
  */
32
37
  export const isTitlePosition = (text: string, start: number, end: number): boolean => {
33
38
  const closesBracket = quotedSpans(text, TITLE_MARKS).some((span) => span.end === end && span.start <= start);
34
- const qualified = QUALIFIER_OPENERS.has(text.charAt(end));
39
+ const qualified = QUALIFIER.test(text.slice(end));
35
40
  const alone = BLANK.test(text.slice(0, start)) && BLANK.test(text.slice(end));
36
41
  return closesBracket || qualified || alone;
37
42
  };
@@ -1,10 +1,13 @@
1
1
  import { hasParticle, isClosed, lastContent } from "../sentence-shape.ts";
2
2
  import { isWithinAny, quotedIn } from "../quoted-span.ts";
3
+ import { chronologyRows } from "../chronology-rows.ts";
4
+ import { externalLinkTitleSpans } from "../link-title.ts";
3
5
  import type { Detector, Finding, Span, Token } from "../plugin.ts";
6
+ import { countedTokens, uncountedWordsOf } from "../uncounted-particles.ts";
4
7
 
5
8
  /**
6
9
  * 文末が名詞で終わる(体言止め)。箇条書きでは普通だが、本文では文が途中で切れて読める。
7
- * 実文書で測ったら、指摘の 9 割が箇条書きの項目だった。箇条書きは除く。
10
+ * 実文書で測ったら、指摘の 9 割が箇条書きの項目だった。箇条書きは除く。年表の行(1950年4月 設立。)も名詞で止める書き方なので除く。
8
11
  */
9
12
  const NOMINAL = new Set(["NOUN", "PROPN"]);
10
13
 
@@ -14,8 +17,9 @@ const isDependent = (token: Token): boolean => token.features?.["NounType"] ===
14
17
  const inside = (span: Span, spans: readonly Span[]): boolean => spans.some((other) => span.start >= other.start && span.start < other.end);
15
18
 
16
19
  export const nounEnding: Detector = (doc, options): Finding[] => {
20
+ const rows = chronologyRows(doc);
17
21
  const ended = doc.sentences.filter((sentence) => {
18
- if (inside(sentence.span, doc.listSpans) || !isClosed(sentence) || !hasParticle(sentence)) return false;
22
+ if (inside(sentence.span, doc.listSpans) || rows.has(sentence) || !isClosed(sentence) || !hasParticle(sentence)) return false;
19
23
  const last = lastContent(sentence);
20
24
  return last !== undefined && NOMINAL.has(last.pos) && !isDependent(last);
21
25
  });
@@ -62,19 +66,26 @@ const BREAK: Run = { surface: "", tokens: [] };
62
66
  *
63
67
  * 鉤括弧で引いたもの(括弧ごと)は、名詞と同じく連なりの中身として飛ばす。引いた題名(「食品中のウイルスの制御のための…ガイドライン」)や
64
68
  * 発言は書き手が言い換えられないので、中の助詞は数えない。題名も名前なので、外の連なり(弊社の「新製品」の販売の計画)は続けて数える。
69
+ * 外のページの題名を引いたリンクの文字(- [サービスの料金の計算の方法](https://…))も、引いた題名と同じに読む。
65
70
  */
66
- const runsOf = (tokens: readonly Token[], nesting: readonly string[], quoted: readonly Span[]): Run[] =>
71
+ const runsOf = (tokens: readonly Token[], nesting: readonly string[], breaks: readonly string[], quoted: readonly Span[]): Run[] =>
67
72
  tokens.reduce<Run[]>((acc, token) => {
68
73
  if (isWithinAny(quoted, token.span)) return acc;
69
74
  if (nesting.includes(token.surface)) return extend(acc, token);
70
- if (token.pos === "PUNCT" || PARTICLE.has(token.pos)) acc.push(BREAK);
75
+ if (token.pos === "PUNCT" || PARTICLE.has(token.pos) || breaks.includes(token.surface)) acc.push(BREAK);
71
76
  return acc;
72
77
  }, []);
73
78
 
79
+ /** 句と句の間の記号(制限=タグの制限、A→B)。半角の = や : は名詞として読まれ、句読点のようには切れない。 */
80
+ const RUN_BREAK_LEXICON = "particle-run-break";
81
+
74
82
  export const doubledParticle: Detector = (doc, options): Finding[] => {
75
83
  const nesting = (options.lexicon ?? []).map((entry) => entry.pattern);
84
+ const titles = externalLinkTitleSpans(doc.source, doc.links);
85
+ const breaks = (doc.lexicons[RUN_BREAK_LEXICON] ?? []).map((entry) => entry.pattern);
86
+ const numbering = uncountedWordsOf(doc.lexicons, nesting);
76
87
  return doc.sentences.flatMap((sentence) =>
77
- runsOf(sentence.tokens ?? [], nesting, quotedIn(sentence))
88
+ runsOf(countedTokens(sentence.tokens ?? [], numbering), nesting, breaks, [...quotedIn(sentence), ...titles])
78
89
  .filter((run) => run.tokens.length > options.limit)
79
90
  .map((run) => ({
80
91
  rule: "no-doubled-joshi",
@@ -81,6 +81,12 @@ export const undefinedTerms = (source: string, sentences: readonly (readonly Tok
81
81
 
82
82
  const patternsOf = (doc: ProseDocument, lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
83
83
 
84
+ /** The words of one group of a lexicon; undefined: the entries with no group. */
85
+ const groupOf = (doc: ProseDocument, lexicon: string, group: string | undefined): string[] =>
86
+ (doc.lexicons[lexicon] ?? []).filter((entry) => entry.group === group).map((entry) => entry.pattern);
87
+
88
+ const ATTACHED = "attached-document-cue";
89
+
84
90
  const findingOf = (doc: ProseDocument, use: UndefinedTerm): Finding => ({
85
91
  rule: "undefined-term",
86
92
  severity: "info",
@@ -107,6 +113,8 @@ const capitalisedUses = (doc: ProseDocument, sentences: readonly (readonly Token
107
113
  definedElsewhere: patternsOf(doc, "defined-elsewhere"),
108
114
  capacityMarkers: patternsOf(doc, "capacity-marker"),
109
115
  articles: patternsOf(doc, "article"),
116
+ attachedCues: groupOf(doc, ATTACHED, undefined),
117
+ attachedTitleEnds: groupOf(doc, ATTACHED, "title-end"),
110
118
  };
111
119
  const marked = [...(doc.markup?.headings ?? []), ...doc.links, ...setApartSpans(doc.source)];
112
120
  return capitalisedTerms({ source: doc.source, readable: readableText(doc.source), sentences, defined, named: namedWords(doc.source), marked, words });
@@ -13,7 +13,7 @@ const MAX_LENGTH = 30;
13
13
  const patternsOf = (doc: ProseDocument, name: string): string[] => (doc.lexicons[name] ?? []).map((entry) => entry.pattern.toLowerCase());
14
14
 
15
15
  /** 辞書と、語彙表 extra-word の語と、チームの names と、別の rule が言う誤り(known-misspelling)を足した語。 */
16
- const spellerOf = (doc: ProseDocument, dictionary: ReadonlySet<string>): Speller => ({
16
+ export const spellerOf = (doc: ProseDocument, dictionary: ReadonlySet<string>): Speller => ({
17
17
  words: [dictionary, new Set([...patternsOf(doc, "extra-word"), ...(doc.names ?? []).map((name) => name.toLowerCase())])],
18
18
  suffixes: (doc.lexicons["word-suffix"] ?? []).map((entry) => ({ suffix: entry.pattern, replacement: entry.instead_of ?? "" })),
19
19
  prefixes: patternsOf(doc, "word-prefix"),
@@ -8,8 +8,11 @@ import { escapeRegExp } from "../orthography.ts";
8
8
  import type { Detector, Finding, Lexicon, LexiconEntry, Sentence } from "../plugin.ts";
9
9
  import { comparableText, comparableWords, entryRanges } from "./lexicon-match.ts";
10
10
  import { rateOver } from "./lexicon.ts";
11
+ import { specifiedByBracket } from "./bracket-specified.ts";
11
12
 
12
13
  const TERMS_OF_ART = "vague-word-term-of-art";
14
+ /** The words that start an aside giving a name (以下「HR」という, hereinafter): such an aside pins nothing down. */
15
+ const NAME_MARKERS = "definition-marker";
13
16
 
14
17
  type Place = { readonly start: number; readonly end: number };
15
18
 
@@ -36,13 +39,25 @@ const covers = (outer: Place, inner: Place): boolean => outer.start <= inner.sta
36
39
 
37
40
  const isLonger = (outer: Match, inner: Match): boolean => outer.place.end - outer.place.start > inner.place.end - inner.place.start;
38
41
 
39
- /** The vague words of one sentence, in the order written, each once: none inside a longer vague word or a term of art. */
40
- export const vagueWordsIn = (sentence: Sentence, vague: Lexicon, termsOfArt: Lexicon): string[] => {
42
+ /** Whether a bracket right after the match pins the word down; token places are in the document, text places in the comparable text. */
43
+ const pinnedDown = (sentence: Sentence, match: Match, byTokens: boolean, nameMarkers: readonly string[]): boolean =>
44
+ byTokens
45
+ ? specifiedByBracket(sentence.text, match.place.end - sentence.span.start, nameMarkers)
46
+ : specifiedByBracket(comparableText(sentence), match.place.end, nameMarkers);
47
+
48
+ /**
49
+ * The vague words of one sentence, in the order written, each once: none inside a longer vague word or a term of art,
50
+ * and none pinned down by the bracket right after it (一定の事項(…)). nameMarkers: the words that start a name in an aside.
51
+ */
52
+ export const vagueWordsIn = (sentence: Sentence, vague: Lexicon, termsOfArt: Lexicon, nameMarkers: readonly string[] = []): string[] => {
41
53
  const byTokens = readsTokens(sentence, [...vague, ...termsOfArt]);
42
54
  const matches = matchesOf(sentence, vague, byTokens);
43
55
  const terms = matchesOf(sentence, termsOfArt, byTokens);
44
56
  const kept = matches.filter(
45
- (match) => !matches.some((other) => isLonger(other, match) && covers(other.place, match.place)) && !terms.some((term) => covers(term.place, match.place)),
57
+ (match) =>
58
+ !matches.some((other) => isLonger(other, match) && covers(other.place, match.place)) &&
59
+ !terms.some((term) => covers(term.place, match.place)) &&
60
+ !pinnedDown(sentence, match, byTokens, nameMarkers),
46
61
  );
47
62
  return [...new Set(kept.toSorted((left, right) => left.place.start - right.place.start).map((match) => match.pattern))];
48
63
  };
@@ -51,8 +66,9 @@ type SentenceHits = { readonly sentence: Sentence; readonly words: readonly stri
51
66
 
52
67
  export const vagueDensity: Detector = (doc, options): Finding[] => {
53
68
  const termsOfArt = entriesForGenre(doc.lexicons[TERMS_OF_ART] ?? [], options.genre);
69
+ const nameMarkers = (doc.lexicons[NAME_MARKERS] ?? []).map((entry) => entry.pattern);
54
70
  const hits: SentenceHits[] = doc.sentences
55
- .map((sentence) => ({ sentence, words: vagueWordsIn(sentence, options.lexicon ?? [], termsOfArt) }))
71
+ .map((sentence) => ({ sentence, words: vagueWordsIn(sentence, options.lexicon ?? [], termsOfArt, nameMarkers) }))
56
72
  .filter((hit) => hit.words.length > 0);
57
73
  const count = hits.reduce((sum, hit) => sum + hit.words.length, 0);
58
74
  const density = rateOver(doc, count, options.limit);