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
@@ -1 +1 @@
1
- {"version":3,"file":"titled-run.d.ts","sourceRoot":"","sources":["../../src/detectors/titled-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1C,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAgBjE;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,SAAS,KAAK,EAAE,EAAE,OAAO,UAAU,KAAG,OAInE,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,KAAK,MAAM,KAAG,OAK1E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,QAAQ,SAAS,MAAM,EAAE,KAAG,OAAqD,CAAC;AAK7H,sEAAsE;AACtE,eAAO,MAAM,YAAY,GAAI,MAAM,SAAS,MAAM,EAAE,KAAG,GAAG,CAAC,MAAM,CAGhE,CAAC"}
1
+ {"version":3,"file":"titled-run.d.ts","sourceRoot":"","sources":["../../src/detectors/titled-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGhD,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAgBjE;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,SAAS,KAAK,EAAE,EAAE,OAAO,UAAU,KAAG,OAA8C,CAAC;AAEtH,sEAAsE;AACtE,eAAO,MAAM,SAAS,GAAI,KAAK,SAAS,KAAK,EAAE,EAAE,OAAO,UAAU,KAAG,MAAM,GAAG,SAM7E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,KAAK,MAAM,KAAG,OAK1E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,QAAQ,SAAS,MAAM,EAAE,KAAG,OAAqD,CAAC;AAK7H,sEAAsE;AACtE,eAAO,MAAM,YAAY,GAAI,MAAM,SAAS,MAAM,EAAE,KAAG,GAAG,CAAC,MAAM,CAGhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,KAAK,EAAE,EAAE,UAAU,SAAS,IAAI,EAAE,EAAE,WAAW,UAAU,KAAG,OAMzG,CAAC"}
@@ -15,10 +15,15 @@ const surfaceOf = (tokens) => tokens.map((token) => token.surface).join("");
15
15
  * 連なりの語(run: 隙間なく並ぶ語)が、題の名前を閉じる語で終わるか。閉じる語は語の切れ目で始まる
16
16
  * (地方自治法の「法」は語、解決方法の「法」は方法の一部)。閉じる語の前に 2 字以上の語が要る。
17
17
  */
18
- export const endsInTitle = (run, words) => run.some((_, at) => {
19
- const tail = surfaceOf(run.slice(at));
20
- return words.endings.includes(tail) && [...surfaceOf(run.slice(0, at))].length >= MIN_BODY_LENGTH;
21
- });
18
+ export const endsInTitle = (run, words) => titleBody(run, words) !== undefined;
19
+ /** endsInTitle のときの、閉じる語の前の字(愛玩動物看護師法の「愛玩動物看護師」)。閉じなければ undefined。 */
20
+ export const titleBody = (run, words) => {
21
+ const at = run.findIndex((_, index) => {
22
+ const tail = surfaceOf(run.slice(index));
23
+ return words.endings.includes(tail) && [...surfaceOf(run.slice(0, index))].length >= MIN_BODY_LENGTH;
24
+ });
25
+ return at < 0 ? undefined : surfaceOf(run.slice(0, at));
26
+ };
22
27
  /**
23
28
  * 文(text)の start から end までの連なりが、題の名前の置き方をしているか。
24
29
  * 括弧の中身の終わりで閉じる(「令和8年度高度統計人材育成強化拠点形成事業」)、すぐ後ろに補いの括弧が付く
@@ -43,4 +48,9 @@ export const repeatedRuns = (runs) => {
43
48
  const counts = runs.reduce((seen, run) => seen.set(run, (seen.get(run) ?? 0) + 1), new Map());
44
49
  return new Set([...counts].flatMap(([run, count]) => (count >= MIN_REPEATS ? [run] : [])));
45
50
  };
51
+ /**
52
+ * 連なりを含む括弧(brackets: 中身の範囲、文書全体の座標)のどれかが、法令の題(「〜に関する法律」、(〜法))か。
53
+ * 中身の語(tokens のうち括弧の中のもの)が法令の名前を閉じる語(fixedName)で終われば題。題は、中の語ごと変えられない名前。
54
+ */
55
+ export const inStatuteTitle = (tokens, brackets, fixedName) => brackets.some((bracket) => endsInTitle(tokens.filter((token) => bracket.start <= token.span.start && token.span.end <= bracket.end), fixedName));
46
56
  //# sourceMappingURL=titled-run.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"titled-run.js","sourceRoot":"","sources":["../../src/detectors/titled-run.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD,qCAAqC;AACrC,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACrD;;;;GAIG;AACH,MAAM,SAAS,GAAG,gDAAgD,CAAC;AACnE,2CAA2C;AAC3C,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,KAAK,GAAG,QAAQ,CAAC;AAEvB,MAAM,SAAS,GAAG,CAAC,MAAwB,EAAU,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK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AAE,CACxB,WAAW,CACT,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,EAC5F,SAAS,CACV,CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"token-shape.d.ts","sourceRoot":"","sources":["../../src/detectors/token-shape.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAwB,MAAM,cAAc,CAAC;AAiBnE,eAAO,MAAM,UAAU,EAAE,QAqBxB,CAAC;AAqDF,eAAO,MAAM,eAAe,EAAE,QAkB7B,CAAC"}
1
+ {"version":3,"file":"token-shape.d.ts","sourceRoot":"","sources":["../../src/detectors/token-shape.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAwB,MAAM,cAAc,CAAC;AAmBnE,eAAO,MAAM,UAAU,EAAE,QAqBxB,CAAC;AAiEF,eAAO,MAAM,eAAe,EAAE,QA0B7B,CAAC"}
@@ -4,7 +4,9 @@ import { chronologyRows } from "../chronology-rows.js";
4
4
  import { externalLinkTitleSpans } from "../link-title.js";
5
5
  import { countedTokens, uncountedWordsOf } from "../uncounted-particles.js";
6
6
  import { honorificGroupParticles } from "../honorific-group.js";
7
+ import { setPhraseParticles } from "../set-phrase-particles.js";
7
8
  import { noteSentences } from "../note-paragraphs.js";
9
+ import { documentNameSpans } from "./particle-run-names.js";
8
10
  /**
9
11
  * 文末が名詞で終わる(体言止め)。箇条書きでは普通だが、本文では文が途中で切れて読める。
10
12
  * 実文書で測ったら、指摘の 9 割が箇条書きの項目だった。箇条書きは除く。年表の行(1950年4月 設立。)も名詞で止める書き方なので除く。
@@ -48,6 +50,9 @@ const extend = (runs, token) => {
48
50
  };
49
51
  const PARTICLE = new Set(["ADP", "SCONJ", "PART", "CCONJ"]);
50
52
  const BREAK = { surface: "", tokens: [] };
53
+ /** 括弧だけの語。解析器が括弧の続き(「分析】(1)経営成績」の「】(」)を名詞と読んでも、句読点と同じく句を閉じる。%や半角の・は句を閉じない。 */
54
+ const BRACKETS_ONLY = /^[\p{Ps}\p{Pe}]+$/u;
55
+ const breaksRun = (token, breaks) => token.pos === "PUNCT" || PARTICLE.has(token.pos) || breaks.includes(token.surface) || BRACKETS_ONLY.test(token.surface);
51
56
  /**
52
57
  * 名詞は連なりの中身なので飛ばす。読点と、語彙表に無い助詞は連なりを切る。
53
58
  * 「弊社のAはBの」を 2 回続いたと数えないため。「は」でいちど句が閉じている。
@@ -61,7 +66,7 @@ const runsOf = (tokens, nesting, breaks, quoted) => tokens.reduce((acc, token) =
61
66
  return acc;
62
67
  if (nesting.includes(token.surface))
63
68
  return extend(acc, token);
64
- if (token.pos === "PUNCT" || PARTICLE.has(token.pos) || breaks.includes(token.surface))
69
+ if (breaksRun(token, breaks))
65
70
  acc.push(BREAK);
66
71
  return acc;
67
72
  }, []);
@@ -69,27 +74,39 @@ const runsOf = (tokens, nesting, breaks, quoted) => tokens.reduce((acc, token) =
69
74
  const RUN_BREAK_LEXICON = "particle-run-break";
70
75
  /** 人の集まりを敬って呼ぶ語(国民の皆様の「皆様」)。直前の助詞は呼び方の一部で、入れ子の輪に数えない。 */
71
76
  const HONORIFIC_GROUP_LEXICON = "honorific-group";
72
- /** 数えない助詞(番号をつなぐ「の」と、敬って呼ぶ語の前の「の」)を除いた語。 */
73
- const chainTokens = (tokens, numbering, groups) => {
74
- const honorific = honorificGroupParticles(tokens, numbering.particles, groups);
77
+ /** 助詞を挟んで一語のように読む決まった言い回し(おそれのある)。中の助詞は入れ子の輪に数えない。 */
78
+ const SET_PHRASE_LEXICON = "particle-run-set-phrase";
79
+ /** 数えない助詞(番号をつなぐ「の」、敬って呼ぶ語の前の「の」、決まった言い回しの中の「の」)を除いた語。 */
80
+ const chainTokens = (tokens, numbering, { groups, setPhrases }) => {
81
+ const uncounted = new Set([...honorificGroupParticles(tokens, numbering.particles, groups), ...setPhraseParticles(tokens, numbering.particles, setPhrases)]);
75
82
  const counted = countedTokens(tokens, numbering);
76
- return honorific.size === 0 ? counted : counted.filter((token) => !honorific.has(token));
83
+ return uncounted.size === 0 ? counted : counted.filter((token) => !uncounted.has(token));
77
84
  };
78
85
  export const doubledParticle = (doc, options) => {
79
86
  const nesting = (options.lexicon ?? []).map((entry) => entry.pattern);
80
87
  const titles = externalLinkTitleSpans(doc.source, doc.links);
81
88
  const breaks = (doc.lexicons[RUN_BREAK_LEXICON] ?? []).map((entry) => entry.pattern);
82
89
  const numbering = uncountedWordsOf(doc.lexicons, nesting);
83
- const groups = (doc.lexicons[HONORIFIC_GROUP_LEXICON] ?? []).map((entry) => entry.pattern);
84
- return doc.sentences.flatMap((sentence) => runsOf(chainTokens(sentence.tokens ?? [], numbering, groups), nesting, breaks, [...quotedIn(sentence), ...titles])
85
- .filter((run) => run.tokens.length > options.limit)
86
- .map((run) => ({
87
- rule: "no-doubled-joshi",
88
- severity: "warning",
89
- line: 0,
90
- column: 0,
91
- quote: sentence.text.trim(),
92
- values: { word: run.surface, count: run.tokens.length, limit: options.limit, offset: run.tokens[0]?.span.start ?? sentence.span.start },
93
- })));
90
+ const phrases = {
91
+ groups: (doc.lexicons[HONORIFIC_GROUP_LEXICON] ?? []).map((entry) => entry.pattern),
92
+ setPhrases: (doc.lexicons[SET_PHRASE_LEXICON] ?? []).map((entry) => entry.pattern),
93
+ };
94
+ const prose = doc.prose ?? doc.source;
95
+ return doc.sentences.flatMap((sentence) => {
96
+ const tokens = chainTokens(sentence.tokens ?? [], numbering, phrases);
97
+ const quoted = [...quotedIn(sentence), ...titles];
98
+ const longRuns = (skipped) => runsOf(tokens, nesting, breaks, skipped).filter((run) => run.tokens.length > options.limit);
99
+ const found = longRuns(quoted);
100
+ // 文書の名前を読むのは長い連なりのある文だけ。名前は位置ごとに読むので、全部の文で読むと遅い。
101
+ const runs = found.length === 0 ? found : longRuns([...quoted, ...documentNameSpans(prose, sentence.span, doc.namedDocument)]);
102
+ return runs.map((run) => ({
103
+ rule: "no-doubled-joshi",
104
+ severity: "warning",
105
+ line: 0,
106
+ column: 0,
107
+ quote: sentence.text.trim(),
108
+ values: { word: run.surface, count: run.tokens.length, limit: options.limit, offset: run.tokens[0]?.span.start ?? sentence.span.start },
109
+ }));
110
+ });
94
111
  };
95
112
  //# sourceMappingURL=token-shape.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-shape.js","sourceRoot":"","sources":["../../src/detectors/token-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAuB,MAAM,2BAA2B,CAAC;AACjG,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE3C,8CAA8C;AAC9C,MAAM,WAAW,GAAG,CAAC,KAAY,EAAW,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,KAAK,WAAW,CAAC;AAE5F,MAAM,MAAM,GAAG,CAAC,IAAU,EAAE,KAAsB,EAAW,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;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QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/B,iDAAiD;QACjD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC/H,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACxB,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,SAAkB;YAC5B,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE;YAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE;SACxI,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Detector } from "../plugin.ts";
2
+ /** The distance from the sentence's topic (〜は) to the end, where its predicate is. Needs the language's tokens. */
3
+ export declare const topicPredicateDistance: Detector;
4
+ //# sourceMappingURL=topic-predicate-distance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topic-predicate-distance.d.ts","sourceRoot":"","sources":["../../src/detectors/topic-predicate-distance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA2B,MAAM,cAAc,CAAC;AAmBtE,mHAAmH;AACnH,eAAO,MAAM,sBAAsB,EAAE,QAIpC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { topicDistance } from "../sentence-load.js";
2
+ import { isIn } from "../lexicon-genres.js";
3
+ import { overLimit, ownTokens } from "./sentence-load.js";
4
+ const CLOSER_LEXICON = "topic-clause-close";
5
+ const ARTICLE_LEXICON = "statute-article-opener";
6
+ /**
7
+ * Whether the sentence is an article of a statute quoted in another kind of document (第7条 … in a manual): the law's wording,
8
+ * which the writer cannot change. In a statute or a contract (its genre, or a profile chaff reads it by) the articles are its own.
9
+ */
10
+ const quotesArticle = (doc, genre) => {
11
+ if (doc.profile !== undefined || genre === undefined || isIn(genre, "legal"))
12
+ return () => false;
13
+ const openers = (doc.lexicons[ARTICLE_LEXICON] ?? []).map((entry) => new RegExp(entry.pattern, "u"));
14
+ return (sentence) => openers.some((opener) => opener.test(sentence.text.trimStart()));
15
+ };
16
+ /** The distance from the sentence's topic (〜は) to the end, where its predicate is. Needs the language's tokens. */
17
+ export const topicPredicateDistance = (doc, options) => {
18
+ const words = { closers: (doc.lexicons[CLOSER_LEXICON] ?? []).map((entry) => entry.pattern) };
19
+ const quoted = quotesArticle(doc, options.genre);
20
+ return overLimit((sentence) => (sentence.tokens === undefined || quoted(sentence) ? undefined : topicDistance(ownTokens(sentence), words)))(doc, options);
21
+ };
22
+ //# sourceMappingURL=topic-predicate-distance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topic-predicate-distance.js","sourceRoot":"","sources":["../../src/detectors/topic-predicate-distance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAC5C,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAEjD;;;GAGG;AACH,MAAM,aAAa,GAAG,CAAC,GAAkB,EAAE,KAAyB,EAAqC,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15
  readonly named: readonly string[];
16
16
  /** What turns a term into another one (本報告書等 after 本報告書): a group the document has to define on its own. */
17
17
  readonly groupSuffixes: readonly string[];
18
+ /** The document takes the definitions of another one (本共同研究開発契約において定義した用語…同契約内の定義に従う). */
19
+ readonly inheritsDefinitions?: boolean;
18
20
  };
19
21
  /** The prefixed terms the source names in quotes or alone on a list item, which the structure does not read as definitions. */
20
22
  export declare const namedTerms: (source: string, prefixes: readonly string[]) => string[];
@@ -22,6 +24,9 @@ export declare const namedTerms: (source: string, prefixes: readonly string[]) =
22
24
  * The first use of each term written with the document's prefix and defined nowhere, when the document defines at
23
25
  * least one term with that prefix (else the prefix is not its way of naming terms). A use that starts with a known
24
26
  * form (本サービス上 where 本サービス is defined) is that term, unless the rest is a group's mark (本サービス等).
27
+ * A name of a document (本共同開発契約) is left like the document's name for itself, unless it is a slip for a defined term
28
+ * (本共同研究開発契約). A document that takes the definitions of another one has terms defined there: only a slip for
29
+ * another of its terms (本学習モデル beside 本学習済みモデル) is reported then.
25
30
  */
26
31
  export declare const undefinedTerms: (source: string, sentences: readonly (readonly Token[])[], defined: readonly string[], words: TermWords) => UndefinedTerm[];
27
32
  export declare const undefinedTerm: Detector;
@@ -1 +1 @@
1
- {"version":3,"file":"undefined-term.d.ts","sourceRoot":"","sources":["../../src/detectors/undefined-term.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAA0B,KAAK,EAAE,MAAM,cAAc,CAAC;AAE5E,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AA4B/E,oEAAoE;AACpE,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;IACtD,4GAA4G;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CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,0HAA0H;IAC1H,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,4GAA4G;IAC5G,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,0FAA0F;IAC1F,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAiBF,+HAA+H;AAC/H,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,EAAE,UAAU,SAAS,MAAM,EAAE,KAAG,MAAM,EAK9E,CAAC;AA2BF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,EAAE,WAAW,SAAS,CAAC,SAAS,KAAK,EAAE,CAAC,EAAE,EAAE,SAAS,SAAS,MAAM,EAAE,EAAE,OAAO,SAAS,KAAG,aAAa,EAyBpJ,CAAC;AA2CF,eAAO,MAAM,aAAa,EAAE,QAiB3B,CAAC"}
@@ -54,18 +54,36 @@ const knownForms = (defined, groups) => [
54
54
  ...defined,
55
55
  ...defined.flatMap((term) => prefixVariants(term, groups)),
56
56
  ];
57
+ /** Every character of the shorter one, in order, in the longer one (本学習モデル in 本学習済みモデル). */
58
+ const isSubsequence = (shorter, longer) => {
59
+ const chars = Array.from(longer);
60
+ let at = 0;
61
+ return Array.from(shorter).every((char) => {
62
+ const found = chars.indexOf(char, at);
63
+ at = found + 1;
64
+ return found !== -1;
65
+ });
66
+ };
67
+ /** A slip for another term: the same prefix, its characters a part of the other's, and not the other's start (本学習モデル for 本学習済みモデル). */
68
+ const isSlipOf = (term, other, prefix) => other.startsWith(prefix) && other.length > term.length && !other.startsWith(term) && isSubsequence(term, other);
57
69
  /**
58
70
  * The first use of each term written with the document's prefix and defined nowhere, when the document defines at
59
71
  * least one term with that prefix (else the prefix is not its way of naming terms). A use that starts with a known
60
72
  * form (本サービス上 where 本サービス is defined) is that term, unless the rest is a group's mark (本サービス等).
73
+ * A name of a document (本共同開発契約) is left like the document's name for itself, unless it is a slip for a defined term
74
+ * (本共同研究開発契約). A document that takes the definitions of another one has terms defined there: only a slip for
75
+ * another of its terms (本学習モデル beside 本学習済みモデル) is reported then.
61
76
  */
62
77
  export const undefinedTerms = (source, sentences, defined, words) => {
63
78
  const prefixes = words.prefixes.filter((prefix) => prefix !== "");
64
79
  if (!defined.some((term) => hasPrefix(term, prefixes)))
65
80
  return [];
81
+ const selfNouns = words.selfNouns.filter((noun) => noun !== "");
66
82
  const isSelf = (term, prefix) => {
67
83
  const rest = term.slice(prefix.length);
68
- return words.selfNouns.some((noun) => noun !== "" && (rest.startsWith(noun) || rest.endsWith(noun)));
84
+ if (!selfNouns.some((noun) => rest.startsWith(noun) || rest.endsWith(noun)))
85
+ return false;
86
+ return selfNouns.includes(rest) || !defined.some((other) => isSlipOf(term, other, prefix));
69
87
  };
70
88
  const runs = sentences.flatMap((tokens) => tokens.flatMap((token, index) => {
71
89
  if (!prefixes.includes(token.surface) || !isNoun(tokens[index + 1]) || continuesWord(tokens[index - 1], token))
@@ -76,8 +94,10 @@ export const undefinedTerms = (source, sentences, defined, words) => {
76
94
  // A name that does not start a run of nouns (② 本研究の具体的な遂行方法) is an item of a list, not a term.
77
95
  const named = words.named.filter((term) => runs.some((run) => run.term.startsWith(term)));
78
96
  const known = knownForms([...defined, ...named], words.prefixGroups);
97
+ const terms = [...defined, ...runs.map((run) => run.term)];
79
98
  const uses = runs
80
99
  .filter((run) => !isSelf(run.term, run.prefix) && !words.isQuoted(run.term) && !isKnownUse(run.term, known, words.groupSuffixes))
100
+ .filter((run) => words.inheritsDefinitions !== true || terms.some((other) => isSlipOf(run.term, other, run.prefix)))
81
101
  .map((run) => ({ offset: run.offset, term: run.term }));
82
102
  return uses.filter((use, index) => uses.findIndex((other) => other.term === use.term) === index);
83
103
  };
@@ -131,6 +151,7 @@ export const undefinedTerm = (doc) => {
131
151
  isQuoted: (term) => QUOTE_PAIRS.some(([open, close]) => doc.source.includes(`${open}${term}${close}`)),
132
152
  named: namedTerms(doc.source, prefixes),
133
153
  groupSuffixes: patternsOf(doc, "defined-term-group-suffix"),
154
+ inheritsDefinitions: patternsOf(doc, "definitions-inherited").some((phrase) => phrase !== "" && doc.source.includes(phrase)),
134
155
  });
135
156
  return [...prefixed, ...capitalisedUses(doc, sentences, definitions)].map((use) => findingOf(doc, use));
136
157
  };
@@ -1 +1 @@
1
- {"version":3,"file":"undefined-term.js","sourceRoot":"","sources":["../../src/detectors/undefined-term.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,iHAAiH;AACjH,mHAAmH;AACnH,mHAAmH;AACnH,wFAAwF;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAgB,MAAM,uBAAuB,CAAC;AAKhH,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACzC,MAAM,WAAW,GAAG;IAClB,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;CACF,CAAC;AAEX,MAAM,MAAM,GAAG,CAAC,KAAwB,EAAkB,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAEzG,kIAAkI;AAClI,MAAM,QAAQ,GAAG,CAAC,CAAC;AAEnB,iFAAiF;AACjF,MAAM,aAAa,GAAG,CAAC,MAAyB,EAAE,KAAY,EAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAA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U,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QAC3F,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC,CAAC;QACtG,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC;QACvC,aAAa,EAAE,UAAU,CAAC,GAAG,EAAE,2BAA2B,CAAC;QAC3D,mBAAmB,EAAE,UAAU,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC7H,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAC1G,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"unfilled-placeholder.d.ts","sourceRoot":"","sources":["../../src/detectors/unfilled-placeholder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAK7C;;;GAGG;AACH,eAAO,MAAM,mCAAmC,EAAE,QAKjD,CAAC"}
1
+ {"version":3,"file":"unfilled-placeholder.d.ts","sourceRoot":"","sources":["../../src/detectors/unfilled-placeholder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAmC,MAAM,cAAc,CAAC;AAqB9E;;;GAGG;AACH,eAAO,MAAM,mCAAmC,EAAE,QAOjD,CAAC"}
@@ -1,6 +1,18 @@
1
1
  import { entriesForGenre } from "../lexicon-genres.js";
2
2
  import { unfilledPlaceholder } from "./ai-phrasing.js";
3
+ import { placeholderSpans } from "./placeholder-text.js";
3
4
  import { TEMPLATE, isInside, templateSections } from "./template-sections.js";
5
+ import { tableBodyCells } from "../facts/table-facts.js";
6
+ import { proseAndTablesOf } from "../table-text.js";
7
+ /** The prose covers tables, so a blank left in a cell (| Owner | [Name] |) is read from the cells themselves. */
8
+ const cellBlanks = (doc, lexicon) => tableBodyCells(proseAndTablesOf(doc)).flatMap((cell) => placeholderSpans(cell.text, lexicon).map((span) => ({
9
+ rule: "",
10
+ severity: "info",
11
+ line: 0,
12
+ column: 0,
13
+ quote: cell.text.trim(),
14
+ values: { matched: cell.text.slice(span.start, span.end), offset: cell.start + span.start },
15
+ })));
4
16
  /**
5
17
  * A blank under a heading that names a template (Template, 雛形) is what the template is for, so it is not reported.
6
18
  * Words that hold in some genres only (〇〇様 in a letter) count in those genres.
@@ -9,6 +21,8 @@ export const unfilledPlaceholderOutsideTemplates = (doc, options) => {
9
21
  const lexicon = entriesForGenre(options.lexicon ?? [], options.genre);
10
22
  const words = lexicon.filter((word) => word.group === TEMPLATE);
11
23
  const templates = templateSections(doc.markup?.headings ?? [], doc.source.length, words);
12
- return unfilledPlaceholder(doc, { ...options, lexicon }).filter((finding) => !isInside(templates, Number(finding.values["offset"])));
24
+ return [...unfilledPlaceholder(doc, { ...options, lexicon }), ...cellBlanks(doc, lexicon)]
25
+ .filter((finding) => !isInside(templates, Number(finding.values["offset"])))
26
+ .toSorted((left, right) => Number(left.values["offset"]) - Number(right.values["offset"]));
13
27
  };
14
28
  //# sourceMappingURL=unfilled-placeholder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unfilled-placeholder.js","sourceRoot":"","sources":["../../src/detectors/unfilled-placeholder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mB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AC,GAAG,EAAE,OAAO,CAAC,CAAC;SACvF,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;SAC3E,QAAQ,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC/F,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { type CheckedWord, type Speller } from "../spelling.ts";
2
+ /**
3
+ * Two dictionary words of four letters or more written as one (crowdwork, crowdworkers): a closed compound, not a slip. The
4
+ * head is a word as listed and the tail takes only an inflection: a prefix or a derived ending on a half (misre + presenation)
5
+ * reads too many slips as words.
6
+ */
7
+ export declare const isClosedCompound: (word: string, speller: Speller) => boolean;
8
+ /** A drug's international name, read by its stem (paroxetine by -oxetine, as fluoxetine): stems from the drug-stem lexicon. */
9
+ export declare const hasDrugStem: (word: string, stems: readonly string[]) => boolean;
10
+ /** The word alone between quotes or brackets ("mailto", (jchaplin)): a word the writer names as such, or an account handle. */
11
+ export declare const isMention: (source: string, offset: number, word: string) => boolean;
12
+ /**
13
+ * A search stem with a wildcard in a list of terms (ukrain*, vaccin*): the word ends in a * that closes no emphasis
14
+ * (nothing opens one before the word), and a separator or the line's end follows it, not a word as after a footnote's *.
15
+ */
16
+ export declare const isSearchStem: (source: string, offset: number, word: string) => boolean;
17
+ /** The word stands in a line with a search stem (president, maga, biden, democrat*): every item of that list is a term. */
18
+ export declare const inSearchTermList: (source: string, offset: number) => boolean;
19
+ /** The word stands beside a word of another language written in Latin letters (bête noire): it belongs to that phrase. */
20
+ export declare const besideForeignWord: (source: string, offset: number, word: string) => boolean;
21
+ /** The letters of every URL and email address in the source, lower-cased: a word also in an address names what it points at. */
22
+ export declare const addressWordsOf: (source: string) => Set<string>;
23
+ /**
24
+ * Words the document uses once, counting a word's other forms as uses (rightsize, rightsized, rightsizing): a word used
25
+ * twice or more, in any form, is more often the document's own term than a slip.
26
+ */
27
+ export declare const usedOnce: (words: readonly CheckedWord[], speller: Speller) => CheckedWord[];
28
+ /** The word names what a release number follows (golang 1.21.5): a product or a tool, written as its makers write it. */
29
+ export declare const beforeVersion: (source: string, offset: number, word: string) => boolean;
30
+ /**
31
+ * Another word of the document, itself not in the dictionary, one letter from this one (pthread and bthread): a family of
32
+ * names built on one scheme. A slip is one letter from a word the dictionary knows, and two slips seldom make such a pair.
33
+ */
34
+ export declare const hasSiblingName: (word: string, unknownWords: ReadonlySet<string>) => boolean;
35
+ //# sourceMappingURL=unknown-word-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unknown-word-context.d.ts","sourceRoot":"","sources":["../../src/detectors/unknown-word-context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmC,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAKjG;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,SAAS,OAAO,KAAG,OAMjE,CAAC;AAKF,+HAA+H;AAC/H,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,KAAG,OACoB,CAAC;AAO1F,+HAA+H;AAC/H,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,EAAE,MAAM,MAAM,KAAG,OAGxE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,EAAE,MAAM,MAAM,KAAG,OAG3E,CAAC;AAUF,2HAA2H;AAC3H,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,KAAG,OAQjE,CAAC;AAaF,0HAA0H;AAC1H,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,EAAE,MAAM,MAAM,KAAG,OAKhF,CAAC;AAEF,gIAAgI;AAChI,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,GAAG,CAAC,MAAM,CACgE,CAAC;AAe3H;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,WAAW,EAAE,EAAE,SAAS,OAAO,KAAG,WAAW,EAKrF,CAAC;AAKF,yHAAyH;AACzH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,EAAE,MAAM,MAAM,KAAG,OAAiE,CAAC;AAM/I;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,cAAc,WAAW,CAAC,MAAM,CAAC,KAAG,OACC,CAAC"}
@@ -0,0 +1,100 @@
1
+ // Where a word stands, for unknown-word: places in a document where a word not in the dictionary is a name or a term the
2
+ // writer means as written, not a slip. Pure functions over the Markdown source and an offset into it.
3
+ import { isAddress, isKnownWord, stemsOf } from "../spelling.js";
4
+ /** Each half of a closed compound keeps this many letters: a shorter half (open + end, pip + line) is more often a slip at the joint. */
5
+ const MIN_COMPOUND_PART = 4;
6
+ /**
7
+ * Two dictionary words of four letters or more written as one (crowdwork, crowdworkers): a closed compound, not a slip. The
8
+ * head is a word as listed and the tail takes only an inflection: a prefix or a derived ending on a half (misre + presenation)
9
+ * reads too many slips as words.
10
+ */
11
+ export const isClosedCompound = (word, speller) => {
12
+ const listed = { ...speller, suffixes: [], prefixes: [] };
13
+ const inflected = { ...listed, suffixes: speller.suffixes.filter(({ inflection }) => inflection === true) };
14
+ return [...Array(Math.max(0, word.length - 2 * MIN_COMPOUND_PART + 1)).keys()]
15
+ .map((index) => index + MIN_COMPOUND_PART)
16
+ .some((split) => isKnownWord(word.slice(0, split), listed) && isKnownWord(word.slice(split), inflected));
17
+ };
18
+ /** Letters a name keeps before its drug stem: fewer, and the word is too short to be read as a drug by its ending alone. */
19
+ const MIN_DRUG_HEAD = 3;
20
+ /** A drug's international name, read by its stem (paroxetine by -oxetine, as fluoxetine): stems from the drug-stem lexicon. */
21
+ export const hasDrugStem = (word, stems) => stems.some((stem) => word.endsWith(stem) && word.length >= stem.length + MIN_DRUG_HEAD);
22
+ /** How far back or ahead to look for a neighbouring word or a search stem. */
23
+ const NEIGHBOUR_REACH = 40;
24
+ const CLOSER = { '"': '"', "“": "”", "(": ")" };
25
+ /** The word alone between quotes or brackets ("mailto", (jchaplin)): a word the writer names as such, or an account handle. */
26
+ export const isMention = (source, offset, word) => {
27
+ const closer = CLOSER[source.charAt(offset - 1)];
28
+ return closer !== undefined && source.charAt(offset + word.length) === closer;
29
+ };
30
+ /**
31
+ * A search stem with a wildcard in a list of terms (ukrain*, vaccin*): the word ends in a * that closes no emphasis
32
+ * (nothing opens one before the word), and a separator or the line's end follows it, not a word as after a footnote's *.
33
+ */
34
+ export const isSearchStem = (source, offset, word) => {
35
+ const end = offset + word.length;
36
+ return source[end] === "*" && source[offset - 1] !== "*" && /^[ \t]*(?:[,;|)\]]|\r?\n|$)/u.test(source.slice(end + 1));
37
+ };
38
+ const LETTER = /\p{L}/u;
39
+ /** The stem a * at index of source closes: the letters right before it, or "" when none come before. */
40
+ const stemBefore = (source, index) => {
41
+ const head = Array.from(source.slice(Math.max(0, index - NEIGHBOUR_REACH), index));
42
+ return head.slice(head.findLastIndex((character) => !LETTER.test(character)) + 1).join("");
43
+ };
44
+ /** The word stands in a line with a search stem (president, maga, biden, democrat*): every item of that list is a term. */
45
+ export const inSearchTermList = (source, offset) => {
46
+ const start = source.lastIndexOf("\n", offset - 1) + 1;
47
+ const end = source.indexOf("\n", offset);
48
+ const line = source.slice(start, end === -1 ? source.length : end);
49
+ return [...line.matchAll(/\*/gu)].some((star) => {
50
+ const stem = stemBefore(source, start + star.index);
51
+ return stem !== "" && isSearchStem(source, start + star.index - stem.length, stem);
52
+ });
53
+ };
54
+ /** A Latin letter outside English's a–z (ê, é, ñ, ß): a word of another language. */
55
+ const isForeignWord = (token) => [...token].some((letter) => letter > "\u007f" && /\p{Script=Latin}/u.test(letter));
56
+ const SPACE = /\s/u;
57
+ /** The last space-separated token of text when a space ends it ("old bête " gives "bête"), or "". */
58
+ const lastToken = (text) => (SPACE.test(text.at(-1) ?? "") ? (text.trimEnd().split(SPACE).at(-1) ?? "") : "");
59
+ /** The first space-separated token of text when a space starts it (" noire for" gives "noire"), or "". */
60
+ const firstToken = (text) => (SPACE.test(text.charAt(0)) ? (text.trimStart().split(SPACE)[0] ?? "") : "");
61
+ /** The word stands beside a word of another language written in Latin letters (bête noire): it belongs to that phrase. */
62
+ export const besideForeignWord = (source, offset, word) => {
63
+ const end = offset + word.length;
64
+ return (isForeignWord(lastToken(source.slice(Math.max(0, offset - NEIGHBOUR_REACH), offset))) || isForeignWord(firstToken(source.slice(end, end + NEIGHBOUR_REACH))));
65
+ };
66
+ /** The letters of every URL and email address in the source, lower-cased: a word also in an address names what it points at. */
67
+ export const addressWordsOf = (source) => new Set((source.match(/\S+/gu) ?? []).filter(isAddress).flatMap((chunk) => chunk.toLowerCase().match(/\p{L}+/gu) ?? []));
68
+ const countsOf = (keys) => {
69
+ const counts = new Map();
70
+ keys.forEach((key) => counts.set(key, (counts.get(key) ?? 0) + 1));
71
+ return counts;
72
+ };
73
+ /**
74
+ * The word and its stems, the forms another word of its family shares (rightsized and rightsizing share rightsize), for a
75
+ * word the dictionary does not know. A known word is in no such family: "refactored" does not make "refactore" a form of
76
+ * it, nor "tools" "toolss".
77
+ */
78
+ const familyOf = (word, speller) => (isKnownWord(word, speller) ? [] : [...new Set([word, ...stemsOf(word, speller)])]);
79
+ /**
80
+ * Words the document uses once, counting a word's other forms as uses (rightsize, rightsized, rightsizing): a word used
81
+ * twice or more, in any form, is more often the document's own term than a slip.
82
+ */
83
+ export const usedOnce = (words, speller) => {
84
+ const uses = countsOf(words.map(({ word }) => word));
85
+ const families = new Map([...uses.keys()].map((word) => [word, familyOf(word, speller)]));
86
+ const shared = countsOf([...families.values()].flat());
87
+ return words.filter(({ word }) => uses.get(word) === 1 && (families.get(word) ?? []).every((key) => shared.get(key) === 1));
88
+ };
89
+ /** A release number of three parts or more (1.21.5, v2.0.1), after spaces. */
90
+ const VERSION_AFTER = /^[ \t]+v?\d+\.\d+\.\d+/u;
91
+ /** The word names what a release number follows (golang 1.21.5): a product or a tool, written as its makers write it. */
92
+ export const beforeVersion = (source, offset, word) => VERSION_AFTER.test(source.slice(offset + word.length));
93
+ /** Two words of one length that differ in one letter only. */
94
+ const oneLetterApart = (left, right) => left.length === right.length && [...left].filter((letter, index) => letter !== right.charAt(index)).length === 1;
95
+ /**
96
+ * Another word of the document, itself not in the dictionary, one letter from this one (pthread and bthread): a family of
97
+ * names built on one scheme. A slip is one letter from a word the dictionary knows, and two slips seldom make such a pair.
98
+ */
99
+ export const hasSiblingName = (word, unknownWords) => [...unknownWords].some((other) => other !== word && oneLetterApart(word, other));
100
+ //# sourceMappingURL=unknown-word-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unknown-word-context.js","sourceRoot":"","sources":["../../src/detectors/unknown-word-context.ts"],"names":[],"mappings":"AAAA,yHAAyH;AACzH,sGAAsG;AACtG,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAkC,MAAM,gBAAgB,CAAC;AAEjG,yIAAyI;AACzI,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,OAAgB,EAAW,EAAE;IAC1E,MAAM,MAAM,GAAY,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IACnE,MAAM,SAAS,GAAY,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,EAA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AAa,GAAG,yBAAyB,CAAC;AAEhD,yHAAyH;AACzH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,IAAY,EAAW,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAE/I,8DAA8D;AAC9D,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,KAAa,EAAW,EAAE,CAC9D,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AAEnH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,YAAiC,EAAW,EAAE,CACzF,CAAC,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC"}
@@ -4,11 +4,6 @@ import { type Speller } from "../spelling.ts";
4
4
  export declare const spellerOf: (doc: ProseDocument, dictionary: ReadonlySet<string>) => Speller;
5
5
  /** 文書がコード(コードの区画と `…`)に書いた語。コードに書いた名前(`tidyq check` の tidyq)は、地の文でも打ち間違いではない。 */
6
6
  export declare const codeWordsOf: (source: string) => Set<string>;
7
- /**
8
- * A search stem with a wildcard in a list of terms (ukrain*, vaccin*): the word ends in a * that closes no emphasis
9
- * (nothing opens one before the word), and a separator or the line's end follows it, not a word as after a footnote's *.
10
- */
11
- export declare const isSearchStem: (source: string, offset: number, word: string) => boolean;
12
7
  /**
13
8
  * 辞書に無い英語の語で、一字違いの辞書の語があるもの(recieve → receive)。辞書は adapter が持ち、無い言語では動かない。
14
9
  * 大文字を含む語(固有名詞・略語)、コード・URL の中、頭の字を分けた語の残り、二度以上使う語、言い直しの無い語、
@@ -1 +1 @@
1
- {"version":3,"file":"unknown-word.d.ts","sourceRoot":"","sources":["../../src/detectors/unknown-word.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,aAAa,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAA2E,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAavH,iFAAiF;AACjF,eAAO,MAAM,SAAS,GAAI,KAAK,aAAa,EAAE,YAAY,WAAW,CAAC,MAAM,CAAC,KAAG,OAI9E,CAAC;AAWH,iFAAiF;AACjF,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,KAAG,GAAG,CAAC,MAAM,CAUtD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,EAAE,MAAM,MAAM,KAAG,OAG3E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,QAYzB,CAAC"}
1
+ {"version":3,"file":"unknown-word.d.ts","sourceRoot":"","sources":["../../src/detectors/unknown-word.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,aAAa,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAwE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAwBpH,iFAAiF;AACjF,eAAO,MAAM,SAAS,GAAI,KAAK,aAAa,EAAE,YAAY,WAAW,CAAC,MAAM,CAAC,KAAG,OAS9E,CAAC;AAIH,iFAAiF;AACjF,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,KAAG,GAAG,CAAC,MAAM,CAUtD,CAAC;AASF;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,QAczB,CAAC"}