chaffjs 0.38.0 → 0.40.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 (892) hide show
  1. package/README.ja.md +21 -4
  2. package/README.md +20 -2
  3. package/checks/ai-tells.yaml +153 -0
  4. package/dist/acronym-expansion.d.ts +4 -0
  5. package/dist/acronym-expansion.d.ts.map +1 -0
  6. package/dist/acronym-expansion.js +46 -0
  7. package/dist/acronym-expansion.js.map +1 -0
  8. package/dist/ai-score/human-shares.d.ts.map +1 -1
  9. package/dist/ai-score/human-shares.js +54 -12
  10. package/dist/ai-score/human-shares.js.map +1 -1
  11. package/dist/ai-score/of-document.d.ts.map +1 -1
  12. package/dist/ai-score/of-document.js +4 -2
  13. package/dist/ai-score/of-document.js.map +1 -1
  14. package/dist/alternative-words.d.ts +6 -0
  15. package/dist/alternative-words.d.ts.map +1 -1
  16. package/dist/alternative-words.js +10 -0
  17. package/dist/alternative-words.js.map +1 -1
  18. package/dist/body-section.d.ts +3 -1
  19. package/dist/body-section.d.ts.map +1 -1
  20. package/dist/body-section.js +9 -2
  21. package/dist/body-section.js.map +1 -1
  22. package/dist/capitals-with-small.d.ts +5 -0
  23. package/dist/capitals-with-small.d.ts.map +1 -1
  24. package/dist/capitals-with-small.js +15 -0
  25. package/dist/capitals-with-small.js.map +1 -1
  26. package/dist/checks.d.ts +11 -0
  27. package/dist/checks.d.ts.map +1 -1
  28. package/dist/checks.js +27 -1
  29. package/dist/checks.js.map +1 -1
  30. package/dist/cli-args.js +1 -1
  31. package/dist/cli-args.js.map +1 -1
  32. package/dist/cli-text.d.ts.map +1 -1
  33. package/dist/cli-text.js +4 -0
  34. package/dist/cli-text.js.map +1 -1
  35. package/dist/closing-code.d.ts +8 -0
  36. package/dist/closing-code.d.ts.map +1 -0
  37. package/dist/closing-code.js +18 -0
  38. package/dist/closing-code.js.map +1 -0
  39. package/dist/commands/fix-plan.d.ts.map +1 -1
  40. package/dist/commands/fix-plan.js +64 -4
  41. package/dist/commands/fix-plan.js.map +1 -1
  42. package/dist/commands/test.d.ts.map +1 -1
  43. package/dist/commands/test.js +16 -2
  44. package/dist/commands/test.js.map +1 -1
  45. package/dist/date-format.d.ts +19 -1
  46. package/dist/date-format.d.ts.map +1 -1
  47. package/dist/date-format.js +41 -5
  48. package/dist/date-format.js.map +1 -1
  49. package/dist/detectors/acronym-context.d.ts +5 -2
  50. package/dist/detectors/acronym-context.d.ts.map +1 -1
  51. package/dist/detectors/acronym-context.js +19 -4
  52. package/dist/detectors/acronym-context.js.map +1 -1
  53. package/dist/detectors/acronym-expansion.d.ts.map +1 -1
  54. package/dist/detectors/acronym-expansion.js +25 -0
  55. package/dist/detectors/acronym-expansion.js.map +1 -1
  56. package/dist/detectors/acronym-gloss.d.ts +19 -0
  57. package/dist/detectors/acronym-gloss.d.ts.map +1 -1
  58. package/dist/detectors/acronym-gloss.js +115 -0
  59. package/dist/detectors/acronym-gloss.js.map +1 -1
  60. package/dist/detectors/acronym-mention.d.ts +5 -0
  61. package/dist/detectors/acronym-mention.d.ts.map +1 -1
  62. package/dist/detectors/acronym-mention.js +16 -0
  63. package/dist/detectors/acronym-mention.js.map +1 -1
  64. package/dist/detectors/acronym-name.d.ts +14 -2
  65. package/dist/detectors/acronym-name.d.ts.map +1 -1
  66. package/dist/detectors/acronym-name.js +28 -3
  67. package/dist/detectors/acronym-name.js.map +1 -1
  68. package/dist/detectors/acronym-series.d.ts +7 -0
  69. package/dist/detectors/acronym-series.d.ts.map +1 -0
  70. package/dist/detectors/acronym-series.js +25 -0
  71. package/dist/detectors/acronym-series.js.map +1 -0
  72. package/dist/detectors/ai-phrasing.d.ts +3 -6
  73. package/dist/detectors/ai-phrasing.d.ts.map +1 -1
  74. package/dist/detectors/ai-phrasing.js +17 -16
  75. package/dist/detectors/ai-phrasing.js.map +1 -1
  76. package/dist/detectors/ai-structure.d.ts +1 -0
  77. package/dist/detectors/ai-structure.d.ts.map +1 -1
  78. package/dist/detectors/ai-structure.js +15 -4
  79. package/dist/detectors/ai-structure.js.map +1 -1
  80. package/dist/detectors/alnum-number.d.ts +1 -0
  81. package/dist/detectors/alnum-number.d.ts.map +1 -1
  82. package/dist/detectors/alnum-number.js +7 -3
  83. package/dist/detectors/alnum-number.js.map +1 -1
  84. package/dist/detectors/bare-comparative.d.ts +6 -0
  85. package/dist/detectors/bare-comparative.d.ts.map +1 -1
  86. package/dist/detectors/bare-comparative.js +31 -12
  87. package/dist/detectors/bare-comparative.js.map +1 -1
  88. package/dist/detectors/blank-runs.d.ts +12 -0
  89. package/dist/detectors/blank-runs.d.ts.map +1 -0
  90. package/dist/detectors/blank-runs.js +27 -0
  91. package/dist/detectors/blank-runs.js.map +1 -0
  92. package/dist/detectors/bold-emphasis-form.d.ts +8 -0
  93. package/dist/detectors/bold-emphasis-form.d.ts.map +1 -0
  94. package/dist/detectors/bold-emphasis-form.js +40 -0
  95. package/dist/detectors/bold-emphasis-form.js.map +1 -0
  96. package/dist/detectors/bold-emphasis.d.ts +0 -1
  97. package/dist/detectors/bold-emphasis.d.ts.map +1 -1
  98. package/dist/detectors/bold-emphasis.js +14 -12
  99. package/dist/detectors/bold-emphasis.js.map +1 -1
  100. package/dist/detectors/bold-label.d.ts +3 -1
  101. package/dist/detectors/bold-label.d.ts.map +1 -1
  102. package/dist/detectors/bold-label.js +16 -6
  103. package/dist/detectors/bold-label.js.map +1 -1
  104. package/dist/detectors/capitalised-term.d.ts.map +1 -1
  105. package/dist/detectors/capitalised-term.js +28 -9
  106. package/dist/detectors/capitalised-term.js.map +1 -1
  107. package/dist/detectors/caps-caption.d.ts +5 -0
  108. package/dist/detectors/caps-caption.d.ts.map +1 -1
  109. package/dist/detectors/caps-caption.js +20 -2
  110. package/dist/detectors/caps-caption.js.map +1 -1
  111. package/dist/detectors/char-shape.d.ts.map +1 -1
  112. package/dist/detectors/char-shape.js +86 -27
  113. package/dist/detectors/char-shape.js.map +1 -1
  114. package/dist/detectors/chat-log-line.d.ts +8 -0
  115. package/dist/detectors/chat-log-line.d.ts.map +1 -0
  116. package/dist/detectors/chat-log-line.js +13 -0
  117. package/dist/detectors/chat-log-line.js.map +1 -0
  118. package/dist/detectors/citation-string.d.ts +9 -0
  119. package/dist/detectors/citation-string.d.ts.map +1 -0
  120. package/dist/detectors/citation-string.js +86 -0
  121. package/dist/detectors/citation-string.js.map +1 -0
  122. package/dist/detectors/closing-cliche.d.ts +18 -0
  123. package/dist/detectors/closing-cliche.d.ts.map +1 -0
  124. package/dist/detectors/closing-cliche.js +58 -0
  125. package/dist/detectors/closing-cliche.js.map +1 -0
  126. package/dist/detectors/closing-exhortation.d.ts +18 -0
  127. package/dist/detectors/closing-exhortation.d.ts.map +1 -0
  128. package/dist/detectors/closing-exhortation.js +55 -0
  129. package/dist/detectors/closing-exhortation.js.map +1 -0
  130. package/dist/detectors/cold-open.d.ts +25 -0
  131. package/dist/detectors/cold-open.d.ts.map +1 -0
  132. package/dist/detectors/cold-open.js +121 -0
  133. package/dist/detectors/cold-open.js.map +1 -0
  134. package/dist/detectors/comparative-context.d.ts +21 -0
  135. package/dist/detectors/comparative-context.d.ts.map +1 -0
  136. package/dist/detectors/comparative-context.js +57 -0
  137. package/dist/detectors/comparative-context.js.map +1 -0
  138. package/dist/detectors/concrete-evidence-density.d.ts +3 -0
  139. package/dist/detectors/concrete-evidence-density.d.ts.map +1 -0
  140. package/dist/detectors/concrete-evidence-density.js +75 -0
  141. package/dist/detectors/concrete-evidence-density.js.map +1 -0
  142. package/dist/detectors/concrete-evidence.d.ts +14 -0
  143. package/dist/detectors/concrete-evidence.d.ts.map +1 -1
  144. package/dist/detectors/concrete-evidence.js +24 -0
  145. package/dist/detectors/concrete-evidence.js.map +1 -1
  146. package/dist/detectors/contraction-emphasis.d.ts +3 -0
  147. package/dist/detectors/contraction-emphasis.d.ts.map +1 -0
  148. package/dist/detectors/contraction-emphasis.js +24 -0
  149. package/dist/detectors/contraction-emphasis.js.map +1 -0
  150. package/dist/detectors/contraction-mention.d.ts +12 -1
  151. package/dist/detectors/contraction-mention.d.ts.map +1 -1
  152. package/dist/detectors/contraction-mention.js +39 -6
  153. package/dist/detectors/contraction-mention.js.map +1 -1
  154. package/dist/detectors/contraction-mix.d.ts +3 -0
  155. package/dist/detectors/contraction-mix.d.ts.map +1 -0
  156. package/dist/detectors/contraction-mix.js +69 -0
  157. package/dist/detectors/contraction-mix.js.map +1 -0
  158. package/dist/detectors/contrast-frame.d.ts +5 -0
  159. package/dist/detectors/contrast-frame.d.ts.map +1 -1
  160. package/dist/detectors/contrast-frame.js +53 -6
  161. package/dist/detectors/contrast-frame.js.map +1 -1
  162. package/dist/detectors/coordinate-adjective.d.ts +2 -1
  163. package/dist/detectors/coordinate-adjective.d.ts.map +1 -1
  164. package/dist/detectors/coordinate-adjective.js +4 -2
  165. package/dist/detectors/coordinate-adjective.js.map +1 -1
  166. package/dist/detectors/date-format.d.ts.map +1 -1
  167. package/dist/detectors/date-format.js +13 -1
  168. package/dist/detectors/date-format.js.map +1 -1
  169. package/dist/detectors/duplicate-definition.d.ts +3 -0
  170. package/dist/detectors/duplicate-definition.d.ts.map +1 -0
  171. package/dist/detectors/duplicate-definition.js +16 -0
  172. package/dist/detectors/duplicate-definition.js.map +1 -0
  173. package/dist/detectors/duplicate-heading.d.ts +4 -2
  174. package/dist/detectors/duplicate-heading.d.ts.map +1 -1
  175. package/dist/detectors/duplicate-heading.js +35 -11
  176. package/dist/detectors/duplicate-heading.js.map +1 -1
  177. package/dist/detectors/email-frame-words.d.ts +10 -0
  178. package/dist/detectors/email-frame-words.d.ts.map +1 -0
  179. package/dist/detectors/email-frame-words.js +34 -0
  180. package/dist/detectors/email-frame-words.js.map +1 -0
  181. package/dist/detectors/email-letter.d.ts +3 -7
  182. package/dist/detectors/email-letter.d.ts.map +1 -1
  183. package/dist/detectors/email-letter.js +13 -21
  184. package/dist/detectors/email-letter.js.map +1 -1
  185. package/dist/detectors/final-period-captions.d.ts +15 -0
  186. package/dist/detectors/final-period-captions.d.ts.map +1 -0
  187. package/dist/detectors/final-period-captions.js +61 -0
  188. package/dist/detectors/final-period-captions.js.map +1 -0
  189. package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
  190. package/dist/detectors/fullwidth-alnum.js +20 -4
  191. package/dist/detectors/fullwidth-alnum.js.map +1 -1
  192. package/dist/detectors/gram-furniture.d.ts +18 -1
  193. package/dist/detectors/gram-furniture.d.ts.map +1 -1
  194. package/dist/detectors/gram-furniture.js +71 -0
  195. package/dist/detectors/gram-furniture.js.map +1 -1
  196. package/dist/detectors/gram-openers.d.ts +16 -0
  197. package/dist/detectors/gram-openers.d.ts.map +1 -1
  198. package/dist/detectors/gram-openers.js +52 -0
  199. package/dist/detectors/gram-openers.js.map +1 -1
  200. package/dist/detectors/gram-predicate.d.ts.map +1 -1
  201. package/dist/detectors/gram-predicate.js +40 -7
  202. package/dist/detectors/gram-predicate.js.map +1 -1
  203. package/dist/detectors/gram-repetition.d.ts +3 -0
  204. package/dist/detectors/gram-repetition.d.ts.map +1 -0
  205. package/dist/detectors/gram-repetition.js +158 -0
  206. package/dist/detectors/gram-repetition.js.map +1 -0
  207. package/dist/detectors/heading-level-skip.d.ts +6 -0
  208. package/dist/detectors/heading-level-skip.d.ts.map +1 -1
  209. package/dist/detectors/heading-level-skip.js +24 -1
  210. package/dist/detectors/heading-level-skip.js.map +1 -1
  211. package/dist/detectors/heading-numbering.js +2 -2
  212. package/dist/detectors/heading-numbering.js.map +1 -1
  213. package/dist/detectors/heading-sentences.d.ts +10 -0
  214. package/dist/detectors/heading-sentences.d.ts.map +1 -0
  215. package/dist/detectors/heading-sentences.js +32 -0
  216. package/dist/detectors/heading-sentences.js.map +1 -0
  217. package/dist/detectors/hyphen-copied-text.d.ts +3 -0
  218. package/dist/detectors/hyphen-copied-text.d.ts.map +1 -0
  219. package/dist/detectors/hyphen-copied-text.js +49 -0
  220. package/dist/detectors/hyphen-copied-text.js.map +1 -0
  221. package/dist/detectors/kanji-name-edge.d.ts +15 -0
  222. package/dist/detectors/kanji-name-edge.d.ts.map +1 -1
  223. package/dist/detectors/kanji-name-edge.js +30 -0
  224. package/dist/detectors/kanji-name-edge.js.map +1 -1
  225. package/dist/detectors/kanji-run-pieces.d.ts +7 -0
  226. package/dist/detectors/kanji-run-pieces.d.ts.map +1 -1
  227. package/dist/detectors/kanji-run-pieces.js +14 -4
  228. package/dist/detectors/kanji-run-pieces.js.map +1 -1
  229. package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
  230. package/dist/detectors/kutoten-consistency.js +22 -4
  231. package/dist/detectors/kutoten-consistency.js.map +1 -1
  232. package/dist/detectors/lead-in-dash.d.ts +5 -0
  233. package/dist/detectors/lead-in-dash.d.ts.map +1 -1
  234. package/dist/detectors/lead-in-dash.js +9 -0
  235. package/dist/detectors/lead-in-dash.js.map +1 -1
  236. package/dist/detectors/letter-joined-name.d.ts +2 -0
  237. package/dist/detectors/letter-joined-name.d.ts.map +1 -1
  238. package/dist/detectors/letter-joined-name.js +8 -0
  239. package/dist/detectors/letter-joined-name.js.map +1 -1
  240. package/dist/detectors/lexicon.d.ts +1 -2
  241. package/dist/detectors/lexicon.d.ts.map +1 -1
  242. package/dist/detectors/lexicon.js +16 -57
  243. package/dist/detectors/lexicon.js.map +1 -1
  244. package/dist/detectors/list-item.d.ts +14 -0
  245. package/dist/detectors/list-item.d.ts.map +1 -1
  246. package/dist/detectors/list-item.js +30 -1
  247. package/dist/detectors/list-item.js.map +1 -1
  248. package/dist/detectors/list-items.d.ts +1 -1
  249. package/dist/detectors/list-items.d.ts.map +1 -1
  250. package/dist/detectors/list-items.js +2 -0
  251. package/dist/detectors/list-items.js.map +1 -1
  252. package/dist/detectors/list-joint.d.ts +18 -0
  253. package/dist/detectors/list-joint.d.ts.map +1 -0
  254. package/dist/detectors/list-joint.js +42 -0
  255. package/dist/detectors/list-joint.js.map +1 -0
  256. package/dist/detectors/list-layout.d.ts +14 -0
  257. package/dist/detectors/list-layout.d.ts.map +1 -0
  258. package/dist/detectors/list-layout.js +29 -0
  259. package/dist/detectors/list-layout.js.map +1 -0
  260. package/dist/detectors/list-lead-in.d.ts +7 -2
  261. package/dist/detectors/list-lead-in.d.ts.map +1 -1
  262. package/dist/detectors/list-lead-in.js +67 -6
  263. package/dist/detectors/list-lead-in.js.map +1 -1
  264. package/dist/detectors/list-parallel.d.ts +6 -0
  265. package/dist/detectors/list-parallel.d.ts.map +1 -1
  266. package/dist/detectors/list-parallel.js +106 -13
  267. package/dist/detectors/list-parallel.js.map +1 -1
  268. package/dist/detectors/list-run.d.ts +13 -0
  269. package/dist/detectors/list-run.d.ts.map +1 -0
  270. package/dist/detectors/list-run.js +80 -0
  271. package/dist/detectors/list-run.js.map +1 -0
  272. package/dist/detectors/list-sentence.d.ts +11 -0
  273. package/dist/detectors/list-sentence.d.ts.map +1 -1
  274. package/dist/detectors/list-sentence.js +1 -0
  275. package/dist/detectors/list-sentence.js.map +1 -1
  276. package/dist/detectors/mark-shape.d.ts +2 -1
  277. package/dist/detectors/mark-shape.d.ts.map +1 -1
  278. package/dist/detectors/mark-shape.js +10 -6
  279. package/dist/detectors/mark-shape.js.map +1 -1
  280. package/dist/detectors/missing-final-period.d.ts.map +1 -1
  281. package/dist/detectors/missing-final-period.js +3 -1
  282. package/dist/detectors/missing-final-period.js.map +1 -1
  283. package/dist/detectors/name-run.d.ts +2 -0
  284. package/dist/detectors/name-run.d.ts.map +1 -1
  285. package/dist/detectors/name-run.js +1 -1
  286. package/dist/detectors/name-run.js.map +1 -1
  287. package/dist/detectors/name-variant-two-things.d.ts +18 -0
  288. package/dist/detectors/name-variant-two-things.d.ts.map +1 -0
  289. package/dist/detectors/name-variant-two-things.js +84 -0
  290. package/dist/detectors/name-variant-two-things.js.map +1 -0
  291. package/dist/detectors/name-variant.d.ts.map +1 -1
  292. package/dist/detectors/name-variant.js +14 -15
  293. package/dist/detectors/name-variant.js.map +1 -1
  294. package/dist/detectors/numbering-readings.d.ts +2 -2
  295. package/dist/detectors/numbering-readings.d.ts.map +1 -1
  296. package/dist/detectors/numbering-readings.js +7 -0
  297. package/dist/detectors/numbering-readings.js.map +1 -1
  298. package/dist/detectors/open-end-anaphor.d.ts +8 -0
  299. package/dist/detectors/open-end-anaphor.d.ts.map +1 -0
  300. package/dist/detectors/open-end-anaphor.js +22 -0
  301. package/dist/detectors/open-end-anaphor.js.map +1 -0
  302. package/dist/detectors/open-end-lead.d.ts +4 -0
  303. package/dist/detectors/open-end-lead.d.ts.map +1 -0
  304. package/dist/detectors/open-end-lead.js +34 -0
  305. package/dist/detectors/open-end-lead.js.map +1 -0
  306. package/dist/detectors/open-end-scope.d.ts.map +1 -1
  307. package/dist/detectors/open-end-scope.js +7 -1
  308. package/dist/detectors/open-end-scope.js.map +1 -1
  309. package/dist/detectors/ordinal-run-gaps.d.ts +1 -0
  310. package/dist/detectors/ordinal-run-gaps.d.ts.map +1 -1
  311. package/dist/detectors/ordinal-run-gaps.js +1 -1
  312. package/dist/detectors/ordinal-run-gaps.js.map +1 -1
  313. package/dist/detectors/organisation-run.d.ts +6 -0
  314. package/dist/detectors/organisation-run.d.ts.map +1 -1
  315. package/dist/detectors/organisation-run.js +26 -2
  316. package/dist/detectors/organisation-run.js.map +1 -1
  317. package/dist/detectors/orthographic-variant-open.d.ts +37 -0
  318. package/dist/detectors/orthographic-variant-open.d.ts.map +1 -0
  319. package/dist/detectors/orthographic-variant-open.js +81 -0
  320. package/dist/detectors/orthographic-variant-open.js.map +1 -0
  321. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  322. package/dist/detectors/orthographic-variant.js +55 -59
  323. package/dist/detectors/orthographic-variant.js.map +1 -1
  324. package/dist/detectors/orthography.d.ts.map +1 -1
  325. package/dist/detectors/orthography.js +14 -5
  326. package/dist/detectors/orthography.js.map +1 -1
  327. package/dist/detectors/over-general-claim.d.ts.map +1 -1
  328. package/dist/detectors/over-general-claim.js +82 -4
  329. package/dist/detectors/over-general-claim.js.map +1 -1
  330. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  331. package/dist/detectors/oxford-comma.js +61 -27
  332. package/dist/detectors/oxford-comma.js.map +1 -1
  333. package/dist/detectors/particle-run-names.d.ts +8 -0
  334. package/dist/detectors/particle-run-names.d.ts.map +1 -0
  335. package/dist/detectors/particle-run-names.js +17 -0
  336. package/dist/detectors/particle-run-names.js.map +1 -0
  337. package/dist/detectors/placeholder-text.d.ts.map +1 -1
  338. package/dist/detectors/placeholder-text.js +14 -2
  339. package/dist/detectors/placeholder-text.js.map +1 -1
  340. package/dist/detectors/proper-noun-density.d.ts +13 -0
  341. package/dist/detectors/proper-noun-density.d.ts.map +1 -0
  342. package/dist/detectors/proper-noun-density.js +97 -0
  343. package/dist/detectors/proper-noun-density.js.map +1 -0
  344. package/dist/detectors/quote-without-source.d.ts +6 -2
  345. package/dist/detectors/quote-without-source.d.ts.map +1 -1
  346. package/dist/detectors/quote-without-source.js +33 -8
  347. package/dist/detectors/quote-without-source.js.map +1 -1
  348. package/dist/detectors/quoted-excerpt.d.ts +13 -0
  349. package/dist/detectors/quoted-excerpt.d.ts.map +1 -0
  350. package/dist/detectors/quoted-excerpt.js +53 -0
  351. package/dist/detectors/quoted-excerpt.js.map +1 -0
  352. package/dist/detectors/reference-entry.d.ts +7 -0
  353. package/dist/detectors/reference-entry.d.ts.map +1 -0
  354. package/dist/detectors/reference-entry.js +35 -0
  355. package/dist/detectors/reference-entry.js.map +1 -0
  356. package/dist/detectors/register-neutral-shape.d.ts +5 -2
  357. package/dist/detectors/register-neutral-shape.d.ts.map +1 -1
  358. package/dist/detectors/register-neutral-shape.js +21 -4
  359. package/dist/detectors/register-neutral-shape.js.map +1 -1
  360. package/dist/detectors/register-separate-part.d.ts +7 -0
  361. package/dist/detectors/register-separate-part.d.ts.map +1 -0
  362. package/dist/detectors/register-separate-part.js +32 -0
  363. package/dist/detectors/register-separate-part.js.map +1 -0
  364. package/dist/detectors/register-set-apart.d.ts +24 -0
  365. package/dist/detectors/register-set-apart.d.ts.map +1 -0
  366. package/dist/detectors/register-set-apart.js +102 -0
  367. package/dist/detectors/register-set-apart.js.map +1 -0
  368. package/dist/detectors/register-voice.d.ts +14 -0
  369. package/dist/detectors/register-voice.d.ts.map +1 -0
  370. package/dist/detectors/register-voice.js +47 -0
  371. package/dist/detectors/register-voice.js.map +1 -0
  372. package/dist/detectors/register.d.ts +5 -0
  373. package/dist/detectors/register.d.ts.map +1 -1
  374. package/dist/detectors/register.js +13 -0
  375. package/dist/detectors/register.js.map +1 -1
  376. package/dist/detectors/registry/closing-cliche.d.ts +3 -0
  377. package/dist/detectors/registry/closing-cliche.d.ts.map +1 -0
  378. package/dist/detectors/registry/closing-cliche.js +3 -0
  379. package/dist/detectors/registry/closing-cliche.js.map +1 -0
  380. package/dist/detectors/registry/closing-exhortation.d.ts +3 -0
  381. package/dist/detectors/registry/closing-exhortation.d.ts.map +1 -0
  382. package/dist/detectors/registry/closing-exhortation.js +3 -0
  383. package/dist/detectors/registry/closing-exhortation.js.map +1 -0
  384. package/dist/detectors/registry/cold-open.d.ts +3 -0
  385. package/dist/detectors/registry/cold-open.d.ts.map +1 -0
  386. package/dist/detectors/registry/cold-open.js +3 -0
  387. package/dist/detectors/registry/cold-open.js.map +1 -0
  388. package/dist/detectors/registry/colon-lead-in.js +1 -1
  389. package/dist/detectors/registry/colon-lead-in.js.map +1 -1
  390. package/dist/detectors/registry/concrete-evidence.js +1 -1
  391. package/dist/detectors/registry/concrete-evidence.js.map +1 -1
  392. package/dist/detectors/registry/contraction-mix.js +1 -1
  393. package/dist/detectors/registry/contraction-mix.js.map +1 -1
  394. package/dist/detectors/registry/duplicate-definition.js +1 -1
  395. package/dist/detectors/registry/duplicate-definition.js.map +1 -1
  396. package/dist/detectors/registry/ngram-repetition.js +1 -1
  397. package/dist/detectors/registry/ngram-repetition.js.map +1 -1
  398. package/dist/detectors/registry/proper-noun-density.js +1 -1
  399. package/dist/detectors/registry/proper-noun-density.js.map +1 -1
  400. package/dist/detectors/registry/topic-predicate-distance.js +1 -1
  401. package/dist/detectors/registry/topic-predicate-distance.js.map +1 -1
  402. package/dist/detectors/registry/unprompted-denial.d.ts +3 -0
  403. package/dist/detectors/registry/unprompted-denial.d.ts.map +1 -0
  404. package/dist/detectors/registry/unprompted-denial.js +3 -0
  405. package/dist/detectors/registry/unprompted-denial.js.map +1 -0
  406. package/dist/detectors/reproduced-text.d.ts +5 -0
  407. package/dist/detectors/reproduced-text.d.ts.map +1 -0
  408. package/dist/detectors/reproduced-text.js +19 -0
  409. package/dist/detectors/reproduced-text.js.map +1 -0
  410. package/dist/detectors/request-owner.d.ts +2 -1
  411. package/dist/detectors/request-owner.d.ts.map +1 -1
  412. package/dist/detectors/request-owner.js +31 -7
  413. package/dist/detectors/request-owner.js.map +1 -1
  414. package/dist/detectors/requirement-smell.d.ts.map +1 -1
  415. package/dist/detectors/requirement-smell.js +16 -5
  416. package/dist/detectors/requirement-smell.js.map +1 -1
  417. package/dist/detectors/sentence-counts.d.ts +2 -1
  418. package/dist/detectors/sentence-counts.d.ts.map +1 -1
  419. package/dist/detectors/sentence-counts.js +23 -7
  420. package/dist/detectors/sentence-counts.js.map +1 -1
  421. package/dist/detectors/sentence-ending.d.ts +7 -1
  422. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  423. package/dist/detectors/sentence-ending.js +47 -11
  424. package/dist/detectors/sentence-ending.js.map +1 -1
  425. package/dist/detectors/sentence-length.d.ts.map +1 -1
  426. package/dist/detectors/sentence-length.js +37 -12
  427. package/dist/detectors/sentence-length.js.map +1 -1
  428. package/dist/detectors/sentence-load.d.ts +5 -3
  429. package/dist/detectors/sentence-load.d.ts.map +1 -1
  430. package/dist/detectors/sentence-load.js +3 -5
  431. package/dist/detectors/sentence-load.js.map +1 -1
  432. package/dist/detectors/sentence-parts.d.ts +11 -0
  433. package/dist/detectors/sentence-parts.d.ts.map +1 -0
  434. package/dist/detectors/sentence-parts.js +64 -0
  435. package/dist/detectors/sentence-parts.js.map +1 -0
  436. package/dist/detectors/sentence-title.d.ts +3 -0
  437. package/dist/detectors/sentence-title.d.ts.map +1 -1
  438. package/dist/detectors/sentence-title.js +10 -0
  439. package/dist/detectors/sentence-title.js.map +1 -1
  440. package/dist/detectors/signals.d.ts +0 -2
  441. package/dist/detectors/signals.d.ts.map +1 -1
  442. package/dist/detectors/signals.js +18 -167
  443. package/dist/detectors/signals.js.map +1 -1
  444. package/dist/detectors/spelling-variety.d.ts.map +1 -1
  445. package/dist/detectors/spelling-variety.js +20 -2
  446. package/dist/detectors/spelling-variety.js.map +1 -1
  447. package/dist/detectors/structure-tree.d.ts +2 -1
  448. package/dist/detectors/structure-tree.d.ts.map +1 -1
  449. package/dist/detectors/structure-tree.js +3 -8
  450. package/dist/detectors/structure-tree.js.map +1 -1
  451. package/dist/detectors/structure.d.ts +9 -1
  452. package/dist/detectors/structure.d.ts.map +1 -1
  453. package/dist/detectors/structure.js +43 -16
  454. package/dist/detectors/structure.js.map +1 -1
  455. package/dist/detectors/superlative-clause.d.ts.map +1 -1
  456. package/dist/detectors/superlative-clause.js +19 -2
  457. package/dist/detectors/superlative-clause.js.map +1 -1
  458. package/dist/detectors/superlative-context.d.ts +35 -0
  459. package/dist/detectors/superlative-context.d.ts.map +1 -0
  460. package/dist/detectors/superlative-context.js +71 -0
  461. package/dist/detectors/superlative-context.js.map +1 -0
  462. package/dist/detectors/superlative-scope.d.ts +6 -2
  463. package/dist/detectors/superlative-scope.d.ts.map +1 -1
  464. package/dist/detectors/superlative-scope.js +20 -6
  465. package/dist/detectors/superlative-scope.js.map +1 -1
  466. package/dist/detectors/team.d.ts +0 -1
  467. package/dist/detectors/team.d.ts.map +1 -1
  468. package/dist/detectors/team.js +0 -46
  469. package/dist/detectors/team.js.map +1 -1
  470. package/dist/detectors/titled-code-citation.d.ts +12 -0
  471. package/dist/detectors/titled-code-citation.d.ts.map +1 -0
  472. package/dist/detectors/titled-code-citation.js +11 -0
  473. package/dist/detectors/titled-code-citation.js.map +1 -0
  474. package/dist/detectors/titled-run.d.ts +8 -1
  475. package/dist/detectors/titled-run.d.ts.map +1 -1
  476. package/dist/detectors/titled-run.js +14 -4
  477. package/dist/detectors/titled-run.js.map +1 -1
  478. package/dist/detectors/token-shape.d.ts.map +1 -1
  479. package/dist/detectors/token-shape.js +33 -16
  480. package/dist/detectors/token-shape.js.map +1 -1
  481. package/dist/detectors/topic-predicate-distance.d.ts +4 -0
  482. package/dist/detectors/topic-predicate-distance.d.ts.map +1 -0
  483. package/dist/detectors/topic-predicate-distance.js +22 -0
  484. package/dist/detectors/topic-predicate-distance.js.map +1 -0
  485. package/dist/detectors/undefined-term.d.ts +5 -0
  486. package/dist/detectors/undefined-term.d.ts.map +1 -1
  487. package/dist/detectors/undefined-term.js +22 -1
  488. package/dist/detectors/undefined-term.js.map +1 -1
  489. package/dist/detectors/unfilled-placeholder.d.ts.map +1 -1
  490. package/dist/detectors/unfilled-placeholder.js +15 -1
  491. package/dist/detectors/unfilled-placeholder.js.map +1 -1
  492. package/dist/detectors/unknown-word-context.d.ts +35 -0
  493. package/dist/detectors/unknown-word-context.d.ts.map +1 -0
  494. package/dist/detectors/unknown-word-context.js +100 -0
  495. package/dist/detectors/unknown-word-context.js.map +1 -0
  496. package/dist/detectors/unknown-word.d.ts +0 -5
  497. package/dist/detectors/unknown-word.d.ts.map +1 -1
  498. package/dist/detectors/unknown-word.js +17 -19
  499. package/dist/detectors/unknown-word.js.map +1 -1
  500. package/dist/detectors/unprompted-denial.d.ts +25 -0
  501. package/dist/detectors/unprompted-denial.d.ts.map +1 -0
  502. package/dist/detectors/unprompted-denial.js +100 -0
  503. package/dist/detectors/unprompted-denial.js.map +1 -0
  504. package/dist/document-sections.d.ts.map +1 -1
  505. package/dist/document-sections.js +3 -1
  506. package/dist/document-sections.js.map +1 -1
  507. package/dist/fix-plan/all-signs.d.ts +17 -0
  508. package/dist/fix-plan/all-signs.d.ts.map +1 -0
  509. package/dist/fix-plan/all-signs.js +26 -0
  510. package/dist/fix-plan/all-signs.js.map +1 -0
  511. package/dist/fix-plan/plan.d.ts +31 -0
  512. package/dist/fix-plan/plan.d.ts.map +1 -1
  513. package/dist/fix-plan/plan.js +23 -3
  514. package/dist/fix-plan/plan.js.map +1 -1
  515. package/dist/fix-plan/render.d.ts.map +1 -1
  516. package/dist/fix-plan/render.js +31 -2
  517. package/dist/fix-plan/render.js.map +1 -1
  518. package/dist/fix-plan/risen.d.ts +10 -0
  519. package/dist/fix-plan/risen.d.ts.map +1 -0
  520. package/dist/fix-plan/risen.js +7 -0
  521. package/dist/fix-plan/risen.js.map +1 -0
  522. package/dist/fix-plan/text.d.ts +15 -0
  523. package/dist/fix-plan/text.d.ts.map +1 -1
  524. package/dist/fix-plan/text.js +38 -2
  525. package/dist/fix-plan/text.js.map +1 -1
  526. package/dist/heading-numbering.d.ts +2 -1
  527. package/dist/heading-numbering.d.ts.map +1 -1
  528. package/dist/heading-numbering.js +40 -10
  529. package/dist/heading-numbering.js.map +1 -1
  530. package/dist/html/html-site-chrome.d.ts.map +1 -1
  531. package/dist/html/html-site-chrome.js +7 -2
  532. package/dist/html/html-site-chrome.js.map +1 -1
  533. package/dist/latin-spacing-source.d.ts +12 -0
  534. package/dist/latin-spacing-source.d.ts.map +1 -0
  535. package/dist/latin-spacing-source.js +25 -0
  536. package/dist/latin-spacing-source.js.map +1 -0
  537. package/dist/law-title.d.ts +7 -0
  538. package/dist/law-title.d.ts.map +1 -0
  539. package/dist/law-title.js +29 -0
  540. package/dist/law-title.js.map +1 -0
  541. package/dist/name-ending-run.d.ts +11 -0
  542. package/dist/name-ending-run.d.ts.map +1 -0
  543. package/dist/name-ending-run.js +37 -0
  544. package/dist/name-ending-run.js.map +1 -0
  545. package/dist/name-separator.d.ts.map +1 -1
  546. package/dist/name-separator.js +4 -1
  547. package/dist/name-separator.js.map +1 -1
  548. package/dist/name-title-slip.d.ts +11 -0
  549. package/dist/name-title-slip.d.ts.map +1 -0
  550. package/dist/name-title-slip.js +51 -0
  551. package/dist/name-title-slip.js.map +1 -0
  552. package/dist/name-variant-shapes.d.ts +14 -0
  553. package/dist/name-variant-shapes.d.ts.map +1 -0
  554. package/dist/name-variant-shapes.js +43 -0
  555. package/dist/name-variant-shapes.js.map +1 -0
  556. package/dist/name-word-use.d.ts +5 -0
  557. package/dist/name-word-use.d.ts.map +1 -0
  558. package/dist/name-word-use.js +12 -0
  559. package/dist/name-word-use.js.map +1 -0
  560. package/dist/opening-passage.d.ts +8 -0
  561. package/dist/opening-passage.d.ts.map +1 -0
  562. package/dist/opening-passage.js +24 -0
  563. package/dist/opening-passage.js.map +1 -0
  564. package/dist/paragraph-length.d.ts +14 -0
  565. package/dist/paragraph-length.d.ts.map +1 -1
  566. package/dist/paragraph-length.js +25 -0
  567. package/dist/paragraph-length.js.map +1 -1
  568. package/dist/paragraph-runs.d.ts +2 -2
  569. package/dist/paragraph-runs.d.ts.map +1 -1
  570. package/dist/paragraph-runs.js +65 -14
  571. package/dist/paragraph-runs.js.map +1 -1
  572. package/dist/plugin.d.ts +2 -0
  573. package/dist/plugin.d.ts.map +1 -1
  574. package/dist/quote-echo.d.ts +6 -0
  575. package/dist/quote-echo.d.ts.map +1 -0
  576. package/dist/quote-echo.js +14 -0
  577. package/dist/quote-echo.js.map +1 -0
  578. package/dist/quote-gloss.d.ts +4 -0
  579. package/dist/quote-gloss.d.ts.map +1 -0
  580. package/dist/quote-gloss.js +7 -0
  581. package/dist/quote-gloss.js.map +1 -0
  582. package/dist/quoted-spelling.d.ts +17 -0
  583. package/dist/quoted-spelling.d.ts.map +1 -0
  584. package/dist/quoted-spelling.js +27 -0
  585. package/dist/quoted-spelling.js.map +1 -0
  586. package/dist/render/semantic.d.ts +1 -1
  587. package/dist/render/semantic.d.ts.map +1 -1
  588. package/dist/render/semantic.js +2 -1
  589. package/dist/render/semantic.js.map +1 -1
  590. package/dist/rule-of-three.d.ts +19 -0
  591. package/dist/rule-of-three.d.ts.map +1 -0
  592. package/dist/rule-of-three.js +33 -0
  593. package/dist/rule-of-three.js.map +1 -0
  594. package/dist/run-semantic.d.ts.map +1 -1
  595. package/dist/run-semantic.js +2 -2
  596. package/dist/run-semantic.js.map +1 -1
  597. package/dist/section-levels.d.ts +18 -0
  598. package/dist/section-levels.d.ts.map +1 -0
  599. package/dist/section-levels.js +80 -0
  600. package/dist/section-levels.js.map +1 -0
  601. package/dist/semantic.d.ts +2 -0
  602. package/dist/semantic.d.ts.map +1 -1
  603. package/dist/semantic.js +15 -2
  604. package/dist/semantic.js.map +1 -1
  605. package/dist/sentence-load.d.ts +2 -1
  606. package/dist/sentence-load.d.ts.map +1 -1
  607. package/dist/sentence-load.js +4 -2
  608. package/dist/sentence-load.js.map +1 -1
  609. package/dist/set-phrase-particles.d.ts +4 -0
  610. package/dist/set-phrase-particles.d.ts.map +1 -0
  611. package/dist/set-phrase-particles.js +26 -0
  612. package/dist/set-phrase-particles.js.map +1 -0
  613. package/dist/spelling.d.ts +11 -0
  614. package/dist/spelling.d.ts.map +1 -1
  615. package/dist/spelling.js +19 -5
  616. package/dist/spelling.js.map +1 -1
  617. package/dist/structure/alternative-clause.d.ts +7 -0
  618. package/dist/structure/alternative-clause.d.ts.map +1 -1
  619. package/dist/structure/alternative-clause.js +23 -8
  620. package/dist/structure/alternative-clause.js.map +1 -1
  621. package/dist/structure/cited-document-section.d.ts +2 -0
  622. package/dist/structure/cited-document-section.d.ts.map +1 -1
  623. package/dist/structure/cited-document-section.js +23 -1
  624. package/dist/structure/cited-document-section.js.map +1 -1
  625. package/dist/structure/issues.d.ts +4 -2
  626. package/dist/structure/issues.d.ts.map +1 -1
  627. package/dist/structure/issues.js +17 -9
  628. package/dist/structure/issues.js.map +1 -1
  629. package/dist/structure/numbering.d.ts +10 -1
  630. package/dist/structure/numbering.d.ts.map +1 -1
  631. package/dist/structure/numbering.js +41 -4
  632. package/dist/structure/numbering.js.map +1 -1
  633. package/dist/structure/unread-label.d.ts +13 -0
  634. package/dist/structure/unread-label.d.ts.map +1 -0
  635. package/dist/structure/unread-label.js +70 -0
  636. package/dist/structure/unread-label.js.map +1 -0
  637. package/dist/structure-shape/template-outline.d.ts +11 -0
  638. package/dist/structure-shape/template-outline.d.ts.map +1 -0
  639. package/dist/structure-shape/template-outline.js +25 -0
  640. package/dist/structure-shape/template-outline.js.map +1 -0
  641. package/dist/title-case-name.d.ts +12 -0
  642. package/dist/title-case-name.d.ts.map +1 -0
  643. package/dist/title-case-name.js +37 -0
  644. package/dist/title-case-name.js.map +1 -0
  645. package/dist/topic-clause.d.ts +6 -1
  646. package/dist/topic-clause.d.ts.map +1 -1
  647. package/dist/topic-clause.js +90 -3
  648. package/dist/topic-clause.js.map +1 -1
  649. package/dist/word-use.d.ts +12 -4
  650. package/dist/word-use.d.ts.map +1 -1
  651. package/dist/word-use.js +47 -5
  652. package/dist/word-use.js.map +1 -1
  653. package/package.json +4 -3
  654. package/rules/ai-generated-composite.yaml +12 -3
  655. package/rules/ai-structure.yaml +7 -6
  656. package/rules/ai-tell.yaml +10 -6
  657. package/rules/all-caps-shouting.yaml +2 -2
  658. package/rules/bold-emphasis.yaml +5 -4
  659. package/rules/bold-label-list.yaml +6 -6
  660. package/rules/closing-cliche.yaml +4 -5
  661. package/rules/closing-exhortation.yaml +74 -0
  662. package/rules/cold-open.yaml +95 -0
  663. package/rules/colon-lead-in.yaml +68 -10
  664. package/rules/comparative-without-baseline.yaml +2 -2
  665. package/rules/concrete-evidence-density.yaml +2 -2
  666. package/rules/contraction-consistency.yaml +2 -2
  667. package/rules/contrast-framing.yaml +16 -13
  668. package/rules/dangling-reference.yaml +2 -2
  669. package/rules/date-format-consistency.yaml +2 -2
  670. package/rules/duplicate-definition.yaml +2 -2
  671. package/rules/duplicate-heading.yaml +5 -2
  672. package/rules/email-greeting-closing.yaml +2 -2
  673. package/rules/email-stock-courtesy.yaml +62 -0
  674. package/rules/fullwidth-alnum-consistency.yaml +2 -2
  675. package/rules/generic-opening.yaml +63 -0
  676. package/rules/heading-level-skip.yaml +2 -2
  677. package/rules/heading-numbering-mix.yaml +20 -20
  678. package/rules/honesty-marker.yaml +84 -0
  679. package/rules/hyphen-as-dash.yaml +2 -2
  680. package/rules/kutoten-consistency.yaml +4 -4
  681. package/rules/latin-spacing.yaml +6 -4
  682. package/rules/list-item-form-mix.yaml +2 -2
  683. package/rules/max-kanji-continuous.yaml +7 -3
  684. package/rules/max-paragraph-length.yaml +2 -2
  685. package/rules/max-sentence-length.yaml +6 -2
  686. package/rules/missing-final-period.yaml +2 -2
  687. package/rules/name-variant.yaml +5 -2
  688. package/rules/ngram-repetition.yaml +2 -2
  689. package/rules/no-doubled-joshi.yaml +2 -2
  690. package/rules/no-em-dash.yaml +2 -2
  691. package/rules/no-mixed-desumasu.yaml +16 -3
  692. package/rules/nominalization.yaml +1 -1
  693. package/rules/numbering-gap.yaml +2 -2
  694. package/rules/one-sentence-paragraph-run.yaml +2 -2
  695. package/rules/orthographic-variant.yaml +2 -2
  696. package/rules/over-general-claim.yaml +2 -2
  697. package/rules/oxford-comma-consistency.yaml +15 -3
  698. package/rules/proper-noun-density.yaml +14 -7
  699. package/rules/quote-without-source.yaml +2 -2
  700. package/rules/request-without-deadline.yaml +2 -2
  701. package/rules/requirement-smell.yaml +2 -2
  702. package/rules/rule-of-three.yaml +3 -3
  703. package/rules/section-length-uniformity.yaml +2 -2
  704. package/rules/spelling-consistency.yaml +4 -4
  705. package/rules/teki-overuse.yaml +2 -2
  706. package/rules/topic-predicate-distance.yaml +3 -2
  707. package/rules/undefined-acronym.yaml +9 -2
  708. package/rules/undefined-term.yaml +2 -2
  709. package/rules/unfilled-placeholder.yaml +2 -2
  710. package/rules/unknown-word.yaml +2 -2
  711. package/rules/unprompted-denial.yaml +88 -0
  712. package/rules/unqualified-superlative.yaml +8 -2
  713. package/skills/chaff/SKILL.md +39 -6
  714. package/src/acronym-expansion.ts +57 -0
  715. package/src/ai-score/human-shares.ts +54 -12
  716. package/src/ai-score/of-document.ts +5 -2
  717. package/src/alternative-words.ts +15 -0
  718. package/src/body-section.ts +11 -2
  719. package/src/capitals-with-small.ts +16 -0
  720. package/src/checks.ts +32 -1
  721. package/src/cli-args.ts +1 -1
  722. package/src/cli-text.ts +4 -0
  723. package/src/closing-code.ts +21 -0
  724. package/src/commands/fix-plan.ts +72 -5
  725. package/src/commands/test.ts +18 -2
  726. package/src/date-format.ts +54 -7
  727. package/src/detectors/acronym-context.ts +23 -4
  728. package/src/detectors/acronym-expansion.ts +26 -0
  729. package/src/detectors/acronym-gloss.ts +123 -0
  730. package/src/detectors/acronym-mention.ts +17 -0
  731. package/src/detectors/acronym-name.ts +40 -3
  732. package/src/detectors/acronym-series.ts +27 -0
  733. package/src/detectors/ai-phrasing.ts +18 -17
  734. package/src/detectors/ai-structure.ts +23 -6
  735. package/src/detectors/alnum-number.ts +8 -3
  736. package/src/detectors/bare-comparative.ts +41 -13
  737. package/src/detectors/blank-runs.ts +30 -0
  738. package/src/detectors/bold-emphasis-form.ts +58 -0
  739. package/src/detectors/bold-emphasis.ts +16 -17
  740. package/src/detectors/bold-label.ts +22 -6
  741. package/src/detectors/capitalised-term.ts +36 -9
  742. package/src/detectors/caps-caption.ts +24 -2
  743. package/src/detectors/char-shape.ts +118 -29
  744. package/src/detectors/chat-log-line.ts +17 -0
  745. package/src/detectors/citation-string.ts +93 -0
  746. package/src/detectors/closing-cliche.ts +74 -0
  747. package/src/detectors/closing-exhortation.ts +74 -0
  748. package/src/detectors/cold-open.ts +145 -0
  749. package/src/detectors/comparative-context.ts +74 -0
  750. package/src/detectors/concrete-evidence-density.ts +99 -0
  751. package/src/detectors/concrete-evidence.ts +40 -0
  752. package/src/detectors/contraction-emphasis.ts +46 -0
  753. package/src/detectors/contraction-mention.ts +52 -6
  754. package/src/detectors/contraction-mix.ts +94 -0
  755. package/src/detectors/contrast-frame.ts +65 -7
  756. package/src/detectors/coordinate-adjective.ts +4 -2
  757. package/src/detectors/date-format.ts +18 -2
  758. package/src/detectors/duplicate-definition.ts +21 -0
  759. package/src/detectors/duplicate-heading.ts +44 -15
  760. package/src/detectors/email-frame-words.ts +39 -0
  761. package/src/detectors/email-letter.ts +15 -20
  762. package/src/detectors/final-period-captions.ts +78 -0
  763. package/src/detectors/fullwidth-alnum.ts +24 -4
  764. package/src/detectors/gram-furniture.ts +87 -1
  765. package/src/detectors/gram-openers.ts +71 -0
  766. package/src/detectors/gram-predicate.ts +49 -6
  767. package/src/detectors/gram-repetition.ts +199 -0
  768. package/src/detectors/heading-level-skip.ts +31 -1
  769. package/src/detectors/heading-numbering.ts +2 -2
  770. package/src/detectors/heading-sentences.ts +36 -0
  771. package/src/detectors/hyphen-copied-text.ts +65 -0
  772. package/src/detectors/kanji-name-edge.ts +31 -0
  773. package/src/detectors/kanji-run-pieces.ts +26 -0
  774. package/src/detectors/kutoten-consistency.ts +24 -4
  775. package/src/detectors/lead-in-dash.ts +11 -0
  776. package/src/detectors/letter-joined-name.ts +14 -0
  777. package/src/detectors/lexicon.ts +20 -63
  778. package/src/detectors/list-item.ts +37 -1
  779. package/src/detectors/list-items.ts +4 -1
  780. package/src/detectors/list-joint.ts +44 -0
  781. package/src/detectors/list-layout.ts +39 -0
  782. package/src/detectors/list-lead-in.ts +88 -7
  783. package/src/detectors/list-parallel.ts +119 -13
  784. package/src/detectors/list-run.ts +86 -0
  785. package/src/detectors/list-sentence.ts +11 -0
  786. package/src/detectors/mark-shape.ts +12 -7
  787. package/src/detectors/missing-final-period.ts +9 -1
  788. package/src/detectors/name-run.ts +2 -1
  789. package/src/detectors/name-variant-two-things.ts +136 -0
  790. package/src/detectors/name-variant.ts +14 -19
  791. package/src/detectors/numbering-readings.ts +10 -2
  792. package/src/detectors/open-end-anaphor.ts +31 -0
  793. package/src/detectors/open-end-lead.ts +46 -0
  794. package/src/detectors/open-end-scope.ts +8 -1
  795. package/src/detectors/ordinal-run-gaps.ts +1 -1
  796. package/src/detectors/organisation-run.ts +26 -2
  797. package/src/detectors/orthographic-variant-open.ts +124 -0
  798. package/src/detectors/orthographic-variant.ts +82 -82
  799. package/src/detectors/orthography.ts +20 -7
  800. package/src/detectors/over-general-claim.ts +106 -5
  801. package/src/detectors/oxford-comma.ts +68 -28
  802. package/src/detectors/particle-run-names.ts +17 -0
  803. package/src/detectors/placeholder-text.ts +21 -4
  804. package/src/detectors/proper-noun-density.ts +109 -0
  805. package/src/detectors/quote-without-source.ts +52 -10
  806. package/src/detectors/quoted-excerpt.ts +68 -0
  807. package/src/detectors/reference-entry.ts +42 -0
  808. package/src/detectors/register-neutral-shape.ts +26 -6
  809. package/src/detectors/register-separate-part.ts +42 -0
  810. package/src/detectors/register-set-apart.ts +124 -0
  811. package/src/detectors/register-voice.ts +63 -0
  812. package/src/detectors/register.ts +15 -0
  813. package/src/detectors/registry/closing-cliche.ts +4 -0
  814. package/src/detectors/registry/closing-exhortation.ts +4 -0
  815. package/src/detectors/registry/cold-open.ts +4 -0
  816. package/src/detectors/registry/colon-lead-in.ts +1 -1
  817. package/src/detectors/registry/concrete-evidence.ts +1 -1
  818. package/src/detectors/registry/contraction-mix.ts +1 -1
  819. package/src/detectors/registry/duplicate-definition.ts +1 -1
  820. package/src/detectors/registry/ngram-repetition.ts +1 -1
  821. package/src/detectors/registry/proper-noun-density.ts +1 -1
  822. package/src/detectors/registry/topic-predicate-distance.ts +1 -1
  823. package/src/detectors/registry/unprompted-denial.ts +4 -0
  824. package/src/detectors/reproduced-text.ts +33 -0
  825. package/src/detectors/request-owner.ts +31 -8
  826. package/src/detectors/requirement-smell.ts +21 -5
  827. package/src/detectors/sentence-counts.ts +27 -7
  828. package/src/detectors/sentence-ending.ts +66 -14
  829. package/src/detectors/sentence-length.ts +43 -11
  830. package/src/detectors/sentence-load.ts +3 -6
  831. package/src/detectors/sentence-parts.ts +73 -0
  832. package/src/detectors/sentence-title.ts +14 -0
  833. package/src/detectors/signals.ts +20 -202
  834. package/src/detectors/spelling-variety.ts +26 -2
  835. package/src/detectors/structure-tree.ts +5 -9
  836. package/src/detectors/structure.ts +47 -19
  837. package/src/detectors/superlative-clause.ts +21 -2
  838. package/src/detectors/superlative-context.ts +99 -0
  839. package/src/detectors/superlative-scope.ts +27 -9
  840. package/src/detectors/team.ts +1 -50
  841. package/src/detectors/titled-code-citation.ts +19 -0
  842. package/src/detectors/titled-run.ts +22 -5
  843. package/src/detectors/token-shape.ts +40 -18
  844. package/src/detectors/topic-predicate-distance.ts +25 -0
  845. package/src/detectors/undefined-term.ts +26 -1
  846. package/src/detectors/unfilled-placeholder.ts +20 -2
  847. package/src/detectors/unknown-word-context.ts +129 -0
  848. package/src/detectors/unknown-word.ts +29 -20
  849. package/src/detectors/unprompted-denial.ts +133 -0
  850. package/src/document-sections.ts +3 -1
  851. package/src/fix-plan/all-signs.ts +35 -0
  852. package/src/fix-plan/plan.ts +50 -3
  853. package/src/fix-plan/render.ts +41 -3
  854. package/src/fix-plan/risen.ts +13 -0
  855. package/src/fix-plan/text.ts +56 -2
  856. package/src/heading-numbering.ts +44 -10
  857. package/src/html/html-site-chrome.ts +9 -2
  858. package/src/latin-spacing-source.ts +33 -0
  859. package/src/law-title.ts +38 -0
  860. package/src/name-ending-run.ts +49 -0
  861. package/src/name-separator.ts +4 -1
  862. package/src/name-title-slip.ts +59 -0
  863. package/src/name-variant-shapes.ts +58 -0
  864. package/src/name-word-use.ts +17 -0
  865. package/src/opening-passage.ts +31 -0
  866. package/src/paragraph-length.ts +31 -0
  867. package/src/paragraph-runs.ts +71 -13
  868. package/src/plugin.ts +2 -0
  869. package/src/quote-echo.ts +18 -0
  870. package/src/quote-gloss.ts +11 -0
  871. package/src/quoted-spelling.ts +48 -0
  872. package/src/render/semantic.ts +2 -2
  873. package/src/rule-of-three.ts +50 -0
  874. package/src/run-semantic.ts +2 -2
  875. package/src/section-levels.ts +98 -0
  876. package/src/semantic.ts +16 -3
  877. package/src/sentence-load.ts +5 -3
  878. package/src/set-phrase-particles.ts +32 -0
  879. package/src/spelling.ts +37 -7
  880. package/src/structure/alternative-clause.ts +32 -7
  881. package/src/structure/cited-document-section.ts +24 -1
  882. package/src/structure/issues.ts +29 -10
  883. package/src/structure/numbering.ts +50 -3
  884. package/src/structure/unread-label.ts +74 -0
  885. package/src/structure-shape/template-outline.ts +34 -0
  886. package/src/title-case-name.ts +55 -0
  887. package/src/topic-clause.ts +110 -5
  888. package/src/word-use.ts +57 -6
  889. package/dist/legal-address.d.ts +0 -2
  890. package/dist/legal-address.d.ts.map +0 -1
  891. package/dist/legal-address.js +0 -16
  892. package/dist/legal-address.js.map +0 -1
@@ -0,0 +1,13 @@
1
+ export type LabelSpan = {
2
+ readonly label: string;
3
+ readonly ordinal: number;
4
+ readonly start: number;
5
+ };
6
+ /**
7
+ * Whether the text between two numbered nodes sets out a label of the later one's kind with a number the skip leaves out
8
+ * (between previous's last number and current's), which the tree did not read as a node.
9
+ */
10
+ export declare const labelWrittenBetween: (source: string, previous: LabelSpan & {
11
+ readonly last: number;
12
+ }, current: LabelSpan) => boolean;
13
+ //# sourceMappingURL=unread-label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unread-label.d.ts","sourceRoot":"","sources":["../../src/structure/unread-label.ts"],"names":[],"mappings":"AAuDA,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAErG;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,EAAE,UAAU,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,SAAS,SAAS,KAAG,OAYzH,CAAC"}
@@ -0,0 +1,70 @@
1
+ // A number the tree did not read but the text writes: "(d)" run into the end of the line before "(e)", "6.1" and "6.2"
2
+ // written as plain paragraphs before the "6.3" the tree read, "(11)" joined to the heading of "(10)". A skip across such
3
+ // a label is not a missing number. Pure.
4
+ const LETTERS = "abcdefghijklmnopqrstuvwxyz";
5
+ /** At most this many missing numbers are looked for; a wider skip is not a few labels the tree missed. */
6
+ const MAX_MISSING = 30;
7
+ /** A label in brackets ((11)): in the heading before, a bare number may be any number in its words. */
8
+ const BRACKETED = /^[([]/u;
9
+ /** An HTML comment: text the reader does not see, so a label in it is not written. */
10
+ const HTML_COMMENT = /<!--[\s\S]*?-->/gu;
11
+ const escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
12
+ /** The label written with another number in place of its own: digits for digits, a letter in the same case for a letter. */
13
+ const relabel = (label, ordinal) => {
14
+ const digits = [...label.matchAll(/\d+/gu)].findLast((match) => Number(match[0]) === ordinal);
15
+ if (digits !== undefined)
16
+ return (other) => `${label.slice(0, digits.index)}${other}${label.slice(digits.index + digits[0].length)}`;
17
+ const letter = [...label.matchAll(/(?<![A-Za-z])[A-Za-z](?![A-Za-z])/gu)].findLast((match) => LETTERS.indexOf(match[0].toLowerCase()) + 1 === ordinal);
18
+ if (letter === undefined)
19
+ return undefined;
20
+ const upper = letter[0] !== letter[0].toLowerCase();
21
+ return (other) => {
22
+ const written = LETTERS.charAt(other - 1);
23
+ return `${label.slice(0, letter.index)}${upper ? written.toUpperCase() : written}${label.slice(letter.index + 1)}`;
24
+ };
25
+ };
26
+ /**
27
+ * A label set out as one: at the start of a line behind the same marks as the later label (## for a heading, none for a
28
+ * paragraph), after a run of spaces within a line, or after a space in the heading that opens the node before
29
+ * ("##### (10) … (11) …", a label in brackets). A label in a sentence or in an HTML comment ("under clause (d)") is a reference, and a list item's "3." under
30
+ * headings numbered "## 4." is another numbering.
31
+ */
32
+ const setOutIn = (text, label, lead) => {
33
+ const escaped = escapeRegExp(label);
34
+ const after = String.raw `(?![0-9A-Za-z])`;
35
+ const atLineStart = new RegExp(String.raw `^[ \t]*${escapeRegExp(lead)}[ \t]*${escaped}${after}`, "mu");
36
+ const afterSpaces = new RegExp(String.raw `\S[ \t]{2,}${escaped}${after}`, "u");
37
+ if (atLineStart.test(text) || afterSpaces.test(text))
38
+ return true;
39
+ const firstLine = text.split("\n", 1)[0] ?? "";
40
+ const bracketed = BRACKETED.test(label);
41
+ return bracketed && firstLine.trimStart().startsWith("#") && new RegExp(String.raw `\s${escaped}${after}`, "u").test(firstLine);
42
+ };
43
+ /** The marks before a label on its own line (## of a heading, > of a quotation), spaces left out. */
44
+ const leadOf = (source, start, label) => {
45
+ const lineStart = source.lastIndexOf("\n", start - 1) + 1;
46
+ const lineEnd = source.indexOf("\n", start);
47
+ const line = source.slice(lineStart, lineEnd === -1 ? source.length : lineEnd).normalize("NFKC");
48
+ const at = line.indexOf(label);
49
+ return at === -1 ? "" : line.slice(0, at).trim();
50
+ };
51
+ /**
52
+ * Whether the text between two numbered nodes sets out a label of the later one's kind with a number the skip leaves out
53
+ * (between previous's last number and current's), which the tree did not read as a node.
54
+ */
55
+ export const labelWrittenBetween = (source, previous, current) => {
56
+ const missing = current.ordinal - previous.last - 1;
57
+ if (missing < 1 || missing > MAX_MISSING || current.start <= previous.start)
58
+ return false;
59
+ const label = current.label.normalize("NFKC");
60
+ const written = relabel(label, current.ordinal);
61
+ if (written === undefined)
62
+ return false;
63
+ const lead = leadOf(source, current.start, label);
64
+ const text = source
65
+ .slice(source.lastIndexOf("\n", previous.start - 1) + 1, current.start)
66
+ .replaceAll(HTML_COMMENT, "")
67
+ .normalize("NFKC");
68
+ return Array.from({ length: missing }, (_, index) => written(previous.last + 1 + index)).some((missingLabel) => setOutIn(text, missingLabel, lead));
69
+ };
70
+ //# sourceMappingURL=unread-label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unread-label.js","sourceRoot":"","sources":["../../src/structure/unread-label.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,yHAAyH;AACzH,yCAAyC;AAEzC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AAE7C,0GAA0G;AAC1G,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,uGAAuG;AACvG,MAAM,SAAS,GAAG,QAAQ,CAAC;AA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C;IACxC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,MAAM;SAChB,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC;SACtE,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;SAC5B,SAAS,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;AACtJ,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Lexicon } from "../plugin.ts";
2
+ /** How many of the template's sections an outline needs before it reads as the template: a real proposal has one or two. */
3
+ export declare const TEMPLATE_SECTIONS = 4;
4
+ /**
5
+ * The template sections (the lexicon's groups: summary, background, proposal, benefits…) that the headings stand for,
6
+ * each once, in heading order. `headings` are heading words as headingWords gives them (lower case, numbers dropped).
7
+ */
8
+ export declare const templateSectionsOf: (headings: readonly string[], lexicon: Lexicon) => string[];
9
+ /** Whether the outline is the template: enough of its sections stand as headings. */
10
+ export declare const isTemplateOutline: (sections: readonly string[]) => boolean;
11
+ //# sourceMappingURL=template-outline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-outline.d.ts","sourceRoot":"","sources":["../../src/structure-shape/template-outline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,cAAc,CAAC;AAG1D,4HAA4H;AAC5H,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAoBnC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,SAAS,MAAM,EAAE,EAAE,SAAS,OAAO,KAAG,MAAM,EAExF,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,GAAI,UAAU,SAAS,MAAM,EAAE,KAAG,OAA+C,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { startsWithWord } from "./heading-words.js";
2
+ /** How many of the template's sections an outline needs before it reads as the template: a real proposal has one or two. */
3
+ export const TEMPLATE_SECTIONS = 4;
4
+ /** Kanji or katakana: a compound goes on through them, so 効果 does not open 効果測定 and 提案 does not open 提案者. */
5
+ const COMPOUND = /[\p{Script=Han}\p{Script=Katakana}ー]/u;
6
+ const characterAt = (text, index) => {
7
+ const code = text.codePointAt(index);
8
+ return code === undefined ? "" : String.fromCodePoint(code);
9
+ };
10
+ const continuesCompound = (words, phrase) => COMPOUND.test(phrase.at(-1) ?? "") && COMPOUND.test(characterAt(words, phrase.length));
11
+ const opensWith = (words, phrase) => startsWithWord(words, phrase) && !continuesCompound(words, phrase);
12
+ /** The longest entry the heading opens with, so 提案の背景 is the background and not the proposal. */
13
+ const sectionOf = (words, lexicon) => lexicon
14
+ .filter((entry) => entry.group !== undefined && opensWith(words, entry.pattern.toLowerCase()))
15
+ .toSorted((left, right) => right.pattern.length - left.pattern.length)[0];
16
+ /**
17
+ * The template sections (the lexicon's groups: summary, background, proposal, benefits…) that the headings stand for,
18
+ * each once, in heading order. `headings` are heading words as headingWords gives them (lower case, numbers dropped).
19
+ */
20
+ export const templateSectionsOf = (headings, lexicon) => [
21
+ ...new Set(headings.flatMap((words) => sectionOf(words, lexicon)?.group ?? [])),
22
+ ];
23
+ /** Whether the outline is the template: enough of its sections stand as headings. */
24
+ export const isTemplateOutline = (sections) => sections.length >= TEMPLATE_SECTIONS;
25
+ //# sourceMappingURL=template-outline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-out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MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAA2B,EAAE,OAAgB,EAAY,EAAE,CAAC;IAC7F,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;CAChF,CAAC;AAEF,qFAAqF;AACrF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAA2B,EAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,IAAI,iBAAiB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Span } from "./plugin.ts";
2
+ /**
3
+ * A capitalised run: the whole run (Co-working Space), and the part of it that is surely a name (quoted), if any. The first
4
+ * word of the sentence is left out of the quoted part, since a sentence and a title capitalise their first word whatever it is.
5
+ */
6
+ export type NameRun = {
7
+ readonly name: Span;
8
+ readonly quoted: Span | undefined;
9
+ };
10
+ /** The capitalised runs of two words or more in a sentence, joined by the language's small words (of, and): names. */
11
+ export declare const titleCaseNameRuns: (text: string, joiners: readonly string[]) => NameRun[];
12
+ //# sourceMappingURL=title-case-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"title-case-name.d.ts","sourceRoot":"","sources":["../src/title-case-name.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAiCxC;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,CAAA;CAAE,CAAC;AAEjF,sHAAsH;AACtH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,SAAS,SAAS,MAAM,EAAE,KAAG,OAAO,EAWnF,CAAC"}
@@ -0,0 +1,37 @@
1
+ // A name written as a run of capitalised words inside a sentence (the Interagency Group, the Twenty-Nine Palms Band of Mission
2
+ // Indians, Radical Uncertainty: Decision-Making Beyond the Numbers). Pure.
3
+ const LATIN_WORD = /\p{Script=Latin}[\p{Script=Latin}\d'’]*(?:-[\p{Script=Latin}\d]+)*/gu;
4
+ /** A capitalised word, with small letters after its capital, its hyphenated parts too (Twenty-Nine, Co-working, Interagency). */
5
+ const CAPITALISED = /^\p{Lu}[\p{Ll}\d'’]*(?:-[\p{L}\d][\p{Ll}\d]*)*$/u;
6
+ const SPACE_ONLY = /^ $/u;
7
+ const MIN_NAME_WORDS = 2;
8
+ const isCapitalised = (word) => CAPITALISED.test(word.text);
9
+ /** Whether `word` carries on the run that ended at `last`: one space between, and capitalised or a joiner (of, and). */
10
+ const continues = (text, last, word, joiners) => last !== undefined && SPACE_ONLY.test(text.slice(last.end, word.start)) && (isCapitalised(word) || joiners.has(word.text));
11
+ /** A run without the joiners it ends on (the Office of): a name ends on a capitalised word. */
12
+ const trimmed = (run) => run.slice(0, run.findLastIndex(isCapitalised) + 1);
13
+ const runsOf = (text, words, joiners) => words.reduce((runs, word) => {
14
+ const current = runs.at(-1);
15
+ if (current !== undefined && continues(text, current.at(-1), word, joiners))
16
+ return [...runs.slice(0, -1), [...current, word]];
17
+ return isCapitalised(word) ? [...runs, [word]] : runs;
18
+ }, []);
19
+ const isName = (run) => run.filter(isCapitalised).length >= MIN_NAME_WORDS;
20
+ const spanOf = (run) => {
21
+ const [head, last] = [run[0], run.at(-1)];
22
+ return head === undefined || last === undefined ? undefined : { start: head.start, end: last.end };
23
+ };
24
+ /** The capitalised runs of two words or more in a sentence, joined by the language's small words (of, and): names. */
25
+ export const titleCaseNameRuns = (text, joiners) => {
26
+ const words = [...text.matchAll(LATIN_WORD)].map((match) => ({ text: match[0], start: match.index, end: match.index + match[0].length }));
27
+ const first = words[0];
28
+ return runsOf(text, words, new Set(joiners))
29
+ .map(trimmed)
30
+ .filter(isName)
31
+ .flatMap((run) => {
32
+ const name = spanOf(run);
33
+ const named = trimmed(run[0] === first ? run.slice(1) : run);
34
+ return name === undefined ? [] : [{ name, quoted: isName(named) ? spanOf(named) : undefined }];
35
+ });
36
+ };
37
+ //# sourceMappingURL=title-case-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"title-case-name.js","sourceRoot":"","sources":["../src/title-case-name.ts"],"names":[],"mappings":"AAAA,+HAA+H;AAC/H,2EAA2E;AAI3E,MAAM,UAAU,GAAG,sEAAsE,CAAC;AAC1F,iIAAiI;AACjI,MAAM,WAAW,GAAG,kDAAkD,CAAC;AACvE,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,cAAc,GAAG,CAAC,CAAC;AAIzB,MAAM,aAAa,GAAG,CAAC,IAAU,EAAW,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE3E,wHAAwH;AACxH,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,IAAsB,EAAE,IAAU,EAAE,OAA4B,EAAW,EAAE,CAC5G,IAAI,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAE7H,+FAA+F;AAC/F,MAAM,OAAO,GAAG,CAAC,GAAoB,EAAU,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAErG,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,KAAsB,EAAE,OAA4B,EAAY,EAAE,CAC9F,KAAK,CAAC,MAAM,CAAW,CAAC,IAAI,EAAE,IAAI,EA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EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC1I,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;SACzC,GAAG,CAAC,OAAO,CAAC;SACZ,MAAM,CAAC,MAAM,CAAC;SACd,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACzB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IACjG,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
@@ -1,7 +1,12 @@
1
1
  import type { Token } from "./plugin.ts";
2
+ /** The words a document's language gives for the shapes below (lang-ja's lexicons). Without them, only the shapes that need none. */
3
+ export type TopicClauseWords = {
4
+ /** Words that end a clause right after its predicate (ことから, つつ, としても): the topic-clause-close lexicon. */
5
+ readonly closers: readonly string[];
6
+ };
2
7
  /**
3
8
  * The index of the word that ends the topic's own clause, between the topic and the sentence's last word, or undefined when the
4
9
  * topic's predicate is the one the sentence ends on.
5
10
  */
6
- export declare const topicClauseEnd: (tokens: readonly Token[], topic: number, last: number) => number | undefined;
11
+ export declare const topicClauseEnd: (tokens: readonly Token[], topic: number, last: number, words?: TopicClauseWords) => number | undefined;
7
12
  //# sourceMappingURL=topic-clause.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"topic-clause.d.ts","sourceRoot":"","sources":["../src/topic-clause.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAmHzC;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,KAAK,EAAE,EAAE,OAAO,MAAM,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,SAM/F,CAAC"}
1
+ {"version":3,"file":"topic-clause.d.ts","sourceRoot":"","sources":["../src/topic-clause.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA8HzC,qIAAqI;AACrI,MAAM,MAAM,gBAAgB,GAAG;IAC7B,0GAA0G;IAC1G,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;AAqFF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,KAAK,EAAE,EAAE,OAAO,MAAM,EAAE,MAAM,MAAM,EAAE,QAAO,gBAA2B,KAAG,MAAM,GAAG,SAWnI,CAAC"}
@@ -24,6 +24,15 @@ const isComma = (token) => COMMA.has(token?.surface ?? "");
24
24
  /** A noun of its own, not a nominaliser (こと, の, ところ) that only turns the clause before it into a noun. */
25
25
  const isOwnNoun = (token) => NOMINAL.has(token?.pos ?? "") && token?.features?.["NounType"] !== "Dependent";
26
26
  const isParticle = (token, surface) => token.surface === surface && token.pos === "ADP";
27
+ /** A word that stands as a noun only after の: ほとんど and 多く in これらの処理のほとんどは are a part of what the の phrase names. */
28
+ const isNarrowedPart = (tokens, at) => (tokens[at]?.pos === "ADV" || tokens[at]?.features?.["Adverbial"] === "Yes") && tokens[at - 1]?.surface === "の" && tokens[at - 1]?.pos === "ADP";
29
+ /** The word before at heads a subject of its own: a noun (法律は), or a part a の phrase narrows (処理のほとんどは). */
30
+ const headsSubject = (tokens, at) => isOwnNoun(tokens[at - 1]) || isNarrowedPart(tokens, at - 1);
31
+ /** A subject of its own at at: は on its head anywhere, or が on its head when lastComma is before it (-1 to take every が). */
32
+ const isOwnSubjectAt = (tokens, at, lastComma) => {
33
+ const token = tokens[at];
34
+ return token !== undefined && headsSubject(tokens, at) && (isParticle(token, "は") || (isParticle(token, "が") && at > lastComma));
35
+ };
27
36
  /**
28
37
  * The last place a subject of its own stands before the sentence's last word: a new topic (法律はありませんが) anywhere, or a
29
38
  * noun with が that the final predicate takes (no comma after it: 動きが見られ始めている). A noun with が inside a condition
@@ -31,7 +40,7 @@ const isParticle = (token, surface) => token.surface === surface && token.pos ==
31
40
  */
32
41
  const lastOwnSubject = (tokens, last) => {
33
42
  const lastComma = tokens.findLastIndex((token, at) => at < last && isComma(token));
34
- return tokens.findLastIndex((token, at) => at < last && isOwnNoun(tokens[at - 1]) && (isParticle(token, "は") || (isParticle(token, "が") && at > lastComma)));
43
+ return tokens.findLastIndex((_, at) => at < last && isOwnSubjectAt(tokens, at, lastComma));
35
44
  };
36
45
  /** The words of the clause after a comma at from, up to the next clause stopped by a comma, or the sentence's last word. */
37
46
  const nextClause = (tokens, from, last) => {
@@ -88,13 +97,91 @@ const closesIfNewSubject = (tokens, at) => {
88
97
  return true;
89
98
  return token?.pos === "VERB" && token.lemma === "おる" && token.features?.["Bound"] === "Yes";
90
99
  };
100
+ const NO_WORDS = { closers: [] };
101
+ /** The first of the words that spell text when they end at at (こと + から for ことから), or -1 when no run of words does. */
102
+ const wordsStart = (tokens, at, text, spelled = "") => {
103
+ const token = tokens[at];
104
+ if (token === undefined)
105
+ return -1;
106
+ const joined = token.surface + spelled;
107
+ if (joined === text)
108
+ return at;
109
+ return joined.length < text.length && text.endsWith(joined) ? wordsStart(tokens, at - 1, text, joined) : -1;
110
+ };
111
+ /** Whether another subject (が or は on a noun, or on a clause made a noun: 行うことは) stands between from and to. */
112
+ const subjectBetween = (tokens, from, to) => tokens.some((token, at) => at > from && at < to && (isParticle(token, "は") || isParticle(token, "が")) && (NOMINAL.has(tokens[at - 1]?.pos ?? "") || headsSubject(tokens, at)));
113
+ const isPoliteMasu = (token) => token?.pos === "AUX" && token.lemma === "ます";
114
+ /** 〜ておりますが / 〜しましたが: a polite predicate and the contrastive が. */
115
+ const isPoliteGa = (tokens, at) => {
116
+ if (tokens[at]?.surface !== "が" || tokens[at]?.pos !== "SCONJ")
117
+ return false;
118
+ const before = tokens[at - 1];
119
+ return isPoliteMasu(before) || (before?.pos === "AUX" && before.surface === "た" && isPoliteMasu(tokens[at - 2]));
120
+ };
121
+ const ownGaSubjectBetween = (tokens, from, to) => tokens.some((token, at) => at > from && at < to && isParticle(token, "が") && headsSubject(tokens, at));
122
+ /** A word of a name (赤澤, 大臣), not a noun that sets the time or the case (今後, 当日). */
123
+ const isNameWord = (token) => NOMINAL.has(token.pos) && token.features?.["Adverbial"] !== "Yes";
124
+ /**
125
+ * 石破総理大臣は…明らかにしましたが、赤澤大臣は…どう考えているか: a name and は straight after the comma is a topic of its own
126
+ * that the rest of the sentence is said of, when no subject of its own (が) follows it. A phrase before は (〜した行為は) is not one.
127
+ */
128
+ const newNameTopicRunsToEnd = (tokens, comma, last) => {
129
+ const topic = tokens.findIndex((token, index) => index > comma && !isNameWord(token));
130
+ const wa = tokens[topic];
131
+ return topic > comma + 1 && wa !== undefined && isParticle(wa, "は") && lastOwnSubject(tokens, last) <= topic;
132
+ };
133
+ /**
134
+ * 当社は…を営んでおりますが、…の重要性が乏しいため、…の記載は行っておりません: after 〜ますが、 the words up to the next comma
135
+ * say something of a subject of their own (が) and a new topic takes what comes after, so the predicate before が was the
136
+ * topic's, when no other subject stands between the topic and it (需要の停滞がありましたが is not). A clause with no subject of
137
+ * its own there is read to the end, unless a name stands as a new topic straight after the comma (〜ましたが、B大臣は…).
138
+ */
139
+ const closesWithPoliteGa = (tokens, topic, at, last) => {
140
+ if (!isPoliteGa(tokens, at) || !isComma(tokens[at + 1]) || subjectBetween(tokens, topic, at))
141
+ return false;
142
+ if (newNameTopicRunsToEnd(tokens, at + 1, last))
143
+ return true;
144
+ const comma = tokens.findIndex((token, index) => index > at + 1 && index < last && isComma(token));
145
+ const clauseEnd = comma === -1 ? last : comma;
146
+ return ownGaSubjectBetween(tokens, at + 1, clauseEnd) && newTopicAfter(tokens, clauseEnd, last);
147
+ };
148
+ /**
149
+ * 学校は地域の核となることから、…: a closer after a predicate, then a comma, with no subject of its own
150
+ * between the topic and it. That predicate is the topic's; what follows is said of something else, or by the writer. A topic set
151
+ * off by a comma (AISIは、…連携しつつ、…行っていく) usually runs to the end, so then only a copula's closer counts (〜であることから、).
152
+ */
153
+ const closesAfterPredicate = (tokens, topic, at, words) => {
154
+ if (!isComma(tokens[at + 1]))
155
+ return false;
156
+ return words.closers.some((connective) => {
157
+ const start = wordsStart(tokens, at, connective);
158
+ if (start <= topic + 1 || !PREDICATE.has(tokens[start - 1]?.pos ?? "") || subjectBetween(tokens, topic, start))
159
+ return false;
160
+ return copulaBefore(tokens, start) || !tokens.slice(topic + 1, start).some(isComma);
161
+ });
162
+ };
163
+ /** A mark that opens with a circled number (③): an item of a list the source ran into one line. */
164
+ const CIRCLED = /^[①-⒇❶-❿]/u;
165
+ const isBlank = (token) => token.surface.trim() === "";
166
+ /** 〜を向上させる ③ 次の項目: an item mark right after a predicate (spaces between are not read) ends the item before it. */
167
+ const closesWithItemMark = (tokens, at) => {
168
+ if (!PREDICATE.has(tokens[at]?.pos ?? ""))
169
+ return false;
170
+ const next = tokens.findIndex((token, index) => index > at && !isBlank(token));
171
+ return next !== -1 && CIRCLED.test(tokens[next]?.surface ?? "");
172
+ };
91
173
  /**
92
174
  * The index of the word that ends the topic's own clause, between the topic and the sentence's last word, or undefined when the
93
175
  * topic's predicate is the one the sentence ends on.
94
176
  */
95
- export const topicClauseEnd = (tokens, topic, last) => {
177
+ export const topicClauseEnd = (tokens, topic, last, words = NO_WORDS) => {
96
178
  const subject = lastOwnSubject(tokens, last);
97
- const closes = (at) => closesSurely(tokens, at, last) || (closesIfNewSubject(tokens, at) && subject > at) || closesFirstClauseWithNoun(tokens, topic, at, last);
179
+ const closes = (at) => closesSurely(tokens, at, last) ||
180
+ (closesIfNewSubject(tokens, at) && subject > at) ||
181
+ closesFirstClauseWithNoun(tokens, topic, at, last) ||
182
+ closesWithPoliteGa(tokens, topic, at, last) ||
183
+ closesAfterPredicate(tokens, topic, at, words) ||
184
+ closesWithItemMark(tokens, at);
98
185
  const end = tokens.findIndex((_, at) => at > topic && at < last && closes(at));
99
186
  return end === -1 ? undefined : end;
100
187
  };
@@ -1 +1 @@
1
- {"version":3,"file":"topic-clause.js","sourceRoot":"","sources":["../src/topic-clause.ts"],"names":[],"mappings":"AAIA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAClC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACnD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAC3D,gEAAgE;AAChE,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AACxD,qGAAqG;AACrG,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,QAAQ,GAAG,CAAC,KAAwB,EAAW,EAAE,CACrD,KAAK,EAAE,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAA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,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,CAAC,EAAU,EAAW,EAAE,CACrC,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC;QAC9B,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,OAAO,GAAG,EAAE,CAAC;QAChD,yBAAyB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC;QAClD,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC;QAC3C,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC;QAC9C,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,EAAE,GAAG,IAAI,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/E,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;AACtC,CAAC,CAAC"}
@@ -9,25 +9,33 @@ export type InContext = {
9
9
  export declare const isTouching: (left: Token | undefined, right: Token) => boolean;
10
10
  export declare const HIRAGANA_ONLY: RegExp;
11
11
  /**
12
- * The lexicons that set a word's use apart: idioms (気をつける), conjunctions (あわせて、), judging (〜とみられる) and katakana
13
- * spellings that name a sense of their own (モノ for goods).
12
+ * The lexicons that set a word's use apart: idioms (気をつける), conjunctions (あわせて、), judging (〜とみられる), katakana
13
+ * spellings that name a sense of their own (モノ for goods), 以て (〜でもって) and light verbs (〜といたします).
14
14
  */
15
15
  export type Uses = {
16
16
  readonly idioms: ReadonlySet<string>;
17
17
  readonly conjunctions: ReadonlySet<string>;
18
18
  readonly judging: ReadonlySet<string>;
19
19
  readonly senses: ReadonlySet<string>;
20
+ readonly means: ReadonlySet<string>;
21
+ readonly lightVerbs: ReadonlySet<string>;
20
22
  };
21
23
  /**
22
24
  * A helper verb or a dependent noun (見て下さい, その事) is written kana by many guides while the full word keeps its kanji (資料を下さい).
23
25
  * The two uses are compared apart, so a document that follows that convention is consistent. A suffix (業務用, 全員ぶん) is a third use:
24
26
  * it is not the dependent noun of the same reading (このように). The verb of an idiom (気をつける) is a fourth, and a
25
27
  * conjunction (あわせて、, さらに、) a fifth, a verb of judging (〜とみられる) a sixth, a katakana spelling with a sense of its own (モノ)
26
- * a seventh and the head of a compound verb (出来上る) an eighth.
28
+ * a seventh, the head of a compound verb (出来上る) an eighth, its tail (貼り付ける) a ninth and 以て (〜でもって) a tenth. A light verb
29
+ * after と (議題といたします) is a helper.
27
30
  */
28
- export declare const useOf: (word: InContext, { idioms, conjunctions, judging, senses }: Uses) => string;
31
+ export declare const useOf: (word: InContext, { idioms, conjunctions, judging, senses, means, lightVerbs }: Uses) => string;
29
32
  /** A piece the tokenizer cut out of a katakana run (ミスっ read as ミ and スる): not a word of its own. */
30
33
  export declare const isCutFromKatakana: ({ token, previous }: InContext) => boolean;
34
+ /**
35
+ * A katakana word the tokenizer cut out of a longer katakana run (カイ of ラオカイ): a piece of a foreign name, whose sound
36
+ * meets a kanji word of the same reading (峡) by chance.
37
+ */
38
+ export declare const isPieceOfKatakanaRun: ({ token, previous, following }: InContext) => boolean;
31
39
  /**
32
40
  * で read as the verb 出る right after a word with no particle between (JSON でない): the copula's で, which the tokenizer
33
41
  * misreads after a space or a name. 出る after a particle (結果がでない) or at the head of a sentence (でない音) is the verb.
@@ -1 +1 @@
1
- {"version":3,"file":"word-use.d.ts","sourceRoot":"","sources":["../src/word-use.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKzC,6EAA6E;AAC7E,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,KA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eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,KAAG,OAAiD,CAAC"}
package/dist/word-use.js CHANGED
@@ -54,21 +54,51 @@ const OBSERVED_SUBJECT = new Set(["が", "は", "も"]);
54
54
  const isObserved = (previous, following) => previous?.pos === "ADP" && OBSERVED_SUBJECT.has(previous.surface) && PASSIVE.has(following?.[0]?.lemma ?? "");
55
55
  /** A listed verb after the quotative と (〜とみる) or observing with られる (増加がみられる): judging what is seen, not looking. */
56
56
  const isJudgingUse = ({ token, previous, before, following }, judging) => token.pos === "VERB" && judging.has(token.lemma ?? "") && (followsQuotative(previous, before) || isObserved(previous, following));
57
+ /** The particle 以て follows where 持つ never does: 〜でもって. */
58
+ const MEANS_PARTICLE = "で";
59
+ const VERB_LIKE = new Set(["VERB", "AUX"]);
60
+ /**
61
+ * A listed verb's て-form after で with no verb after it (電子でもって申請する): 以て, "by means of", which 持つ never is after
62
+ * で (手で持って運ぶ has its verb after it). After を the two read alike (決意をもって, 信念を持って), and are compared as one word.
63
+ */
64
+ const isMeansUse = ({ token, previous, following }, means) => token.pos === "VERB" &&
65
+ means.has(token.lemma ?? "") &&
66
+ previous?.pos === "ADP" &&
67
+ previous.surface === MEANS_PARTICLE &&
68
+ TE.has(following?.[0]?.surface ?? "") &&
69
+ following?.[1] !== undefined &&
70
+ !VERB_LIKE.has(following[1].pos);
71
+ /**
72
+ * A listed light verb after the quotative と (議題といたします): the humble する, as it is written onto a noun (開会いたします),
73
+ * where the tokenizer marks it bound. The full verb takes を (思いを致す).
74
+ */
75
+ const isLightVerbAfterQuotative = ({ token, previous }, lightVerbs) => token.pos === "VERB" && lightVerbs.has(token.lemma ?? "") && previous?.pos === "ADP" && previous.surface === QUOTATIVE;
57
76
  /** A verb written straight onto the verb after it (出来上る, 書き込む): the head of a compound verb, which keeps the compound's spelling. */
58
77
  const isCompoundVerbHead = ({ token, following }) => {
59
78
  const next = following?.[0];
60
79
  return token.pos === "VERB" && next?.pos === "VERB" && isTouching(token, next);
61
80
  };
81
+ /** A verb written straight onto the verb before it (貼り付ける, 書き込む): the tail of a compound verb, not the verb alone (番号をつける). */
82
+ const isCompoundVerbTail = ({ token, previous }) => token.pos === "VERB" && previous?.pos === "VERB" && isTouching(previous, token);
83
+ /** A word used freely, or as a helper: a bound noun after a word is a suffix, and anything else bound a helper. */
84
+ const helperUseOf = (word, lightVerbs) => {
85
+ if (!isHelper(word) && !isLightVerbAfterQuotative(word, lightVerbs))
86
+ return "free";
87
+ return word.token.pos === "NOUN" && word.token.features?.["NounType"] !== "Dependent" ? "suffix" : "bound";
88
+ };
62
89
  /**
63
90
  * A helper verb or a dependent noun (見て下さい, その事) is written kana by many guides while the full word keeps its kanji (資料を下さい).
64
91
  * The two uses are compared apart, so a document that follows that convention is consistent. A suffix (業務用, 全員ぶん) is a third use:
65
92
  * it is not the dependent noun of the same reading (このように). The verb of an idiom (気をつける) is a fourth, and a
66
93
  * conjunction (あわせて、, さらに、) a fifth, a verb of judging (〜とみられる) a sixth, a katakana spelling with a sense of its own (モノ)
67
- * a seventh and the head of a compound verb (出来上る) an eighth.
94
+ * a seventh, the head of a compound verb (出来上る) an eighth, its tail (貼り付ける) a ninth and 以て (〜でもって) a tenth. A light verb
95
+ * after と (議題といたします) is a helper.
68
96
  */
69
- export const useOf = (word, { idioms, conjunctions, judging, senses }) => {
97
+ export const useOf = (word, { idioms, conjunctions, judging, senses, means, lightVerbs }) => {
70
98
  if (isIdiomVerb(word, idioms))
71
99
  return "idiom";
100
+ if (isMeansUse(word, means))
101
+ return "means";
72
102
  if (isConjunctionUse(word, conjunctions))
73
103
  return "conjunction";
74
104
  if (isJudgingUse(word, judging))
@@ -77,17 +107,29 @@ export const useOf = (word, { idioms, conjunctions, judging, senses }) => {
77
107
  return "sense";
78
108
  if (isCompoundVerbHead(word))
79
109
  return "compound-verb";
110
+ if (isCompoundVerbTail(word))
111
+ return "compound-tail";
80
112
  if (isKanaSuffix(word))
81
113
  return "suffix";
82
- if (!isHelper(word))
83
- return "free";
84
- return word.token.pos === "NOUN" && word.token.features?.["NounType"] !== "Dependent" ? "suffix" : "bound";
114
+ return helperUseOf(word, lightVerbs);
85
115
  };
86
116
  /** One katakana and then kana that is not katakana (スる): no verb stem is one katakana long, as サボる and ググる are two. */
87
117
  const ONE_KATAKANA_HEAD = /^\p{Script=Katakana}(?!\p{Script=Katakana})/u;
88
118
  const KATAKANA_END = /\p{Script=Katakana}$/u;
89
119
  /** A piece the tokenizer cut out of a katakana run (ミスっ read as ミ and スる): not a word of its own. */
90
120
  export const isCutFromKatakana = ({ token, previous }) => ONE_KATAKANA_HEAD.test(token.surface) && token.surface.length > 1 && isTouching(previous, token) && KATAKANA_END.test(previous?.surface ?? "");
121
+ const KATAKANA_ONLY = /^[\p{Script=Katakana}ー]+$/u;
122
+ const isKatakanaToken = (token) => token !== undefined && KATAKANA_ONLY.test(token.surface);
123
+ /**
124
+ * A katakana word the tokenizer cut out of a longer katakana run (カイ of ラオカイ): a piece of a foreign name, whose sound
125
+ * meets a kanji word of the same reading (峡) by chance.
126
+ */
127
+ export const isPieceOfKatakanaRun = ({ token, previous, following }) => {
128
+ const next = following?.[0];
129
+ if (!isKatakanaToken(token))
130
+ return false;
131
+ return (isKatakanaToken(previous) && isTouching(previous, token)) || (next !== undefined && isKatakanaToken(next) && isTouching(token, next));
132
+ };
91
133
  /**
92
134
  * で read as the verb 出る right after a word with no particle between (JSON でない): the copula's で, which the tokenizer
93
135
  * misreads after a space or a name. 出る after a particle (結果がでない) or at the head of a sentence (でない音) is the verb.
@@ -1 +1 @@
1
- {"version":3,"file":"word-use.js","sourceRoot":"","sources":["../src/word-use.ts"],"names":[],"mappings":"AAaA,qJAAqJ;AACrJ,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAEtD,2HAA2H;AAC3H,MAAM,aAAa,GAAG,CAAC,QAA2B,EAAW,EAAE,CAC7D,CAAC,QAAQ,EAAE,GAAG,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,KAAK,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I,KAAK,CAAC,OAAO,KAAK,GAAG,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,GAAG,KAAK,KAAK,CAAC;AAEpG,MAAM,YAAY,GAAG,UAAU,CAAC;AAChC,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACvC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAa,EAAW,EAAE,CAC3E,KAAK,CAAC,GAAG,KAAK,MAAM;IACpB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IACjC,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC;IAC3B,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtH,sFAAsF;AACtF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAY,EAAW,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,KAAK,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaffjs",
3
- "version": "0.38.0",
3
+ "version": "0.40.0",
4
4
  "description": "Prose validation harness. Finds what is hard to read, and never rewrites it for you.",
5
5
  "keywords": [
6
6
  "chaff",
@@ -69,6 +69,7 @@
69
69
  "README.md",
70
70
  "README.ja.md",
71
71
  "bin",
72
+ "checks",
72
73
  "dist",
73
74
  "genres.yaml",
74
75
  "profiles",
@@ -88,8 +89,8 @@
88
89
  },
89
90
  "dependencies": {
90
91
  "@anthropic-ai/sdk": "^0.125.0",
91
- "@chaffjs/lang-en": "0.35.0",
92
- "@chaffjs/lang-ja": "0.37.0",
92
+ "@chaffjs/lang-en": "0.37.0",
93
+ "@chaffjs/lang-ja": "0.39.0",
93
94
  "character-entities": "^2.0.2",
94
95
  "mdast-util-from-markdown": "^2.0.3",
95
96
  "mdast-util-frontmatter": "^2.0.1",