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
@@ -77,3 +77,34 @@ export const leadingOrdinal = (tokens: readonly Token[], start: number, name: st
77
77
  const end = start + surface.length;
78
78
  return tokens.some((token) => token.span.end === end) ? { surface, span: { start, end } } : undefined;
79
79
  };
80
+
81
+ /** 漢数字で書いた月と日までの日付(令和七年六月二十三日、十一月二十五日)。 */
82
+ const KANJI_DATE = /^(?:(?:明治|大正|昭和|平成|令和)?[〇一二三四五六七八九十百千元]+年)?[一二三四五六七八九十]+月[一二三十]*[一二三四五六七八九十]日/u;
83
+ /** 元号の付いた年(令和元年)。度が続けば(令和七年度)語の一部。元号の無い年だけ(十年)は数の語の一部にもなるので読まない。 */
84
+ const ERA_YEAR = /^(?:明治|大正|昭和|平成|令和)[〇一二三四五六七八九十百千元]+年(?!度)/u;
85
+ /** 〇(漢字の連なりの外の字)で割れた年の後半(二〇二七年の「二七年」)。度が続けば語の一部。 */
86
+ const YEAR_AFTER_ZERO = /^[〇一二三四五六七八九十]*年(?!度)/u;
87
+ const ZERO = "〇";
88
+
89
+ /**
90
+ * 連なり(文書全体の座標で start から始まる)の頭の、漢数字で書いた日付(大正三年十一月二十五日学習院輔仁会の「大正三年十一月二十五日」、
91
+ * 令和元年東日本台風の「令和元年」)。連なりのすぐ前が〇なら、〇で割れた年の後半(二〇二七年国際園芸博覧会の「二七年」)も。
92
+ * 算用数字の日付(7月1日)が連なりを切るのと同じく、日付は後ろの名前の一部ではない。連なりがまるごと日付(署名の日付の行)でもよい。
93
+ * 日付が解析の語の切れ目で終わるときだけ。
94
+ */
95
+ export const leadingDate = (tokens: readonly Token[], start: number, name: string, before = ""): Edge | undefined => {
96
+ const surface = before.endsWith(ZERO) ? YEAR_AFTER_ZERO.exec(name)?.[0] : (KANJI_DATE.exec(name)?.[0] ?? ERA_YEAR.exec(name)?.[0]);
97
+ if (surface === undefined) return undefined;
98
+ const end = start + surface.length;
99
+ return tokens.some((token) => token.span.end === end) ? { surface, span: { start, end } } : undefined;
100
+ };
101
+
102
+ /**
103
+ * 連なり(文書全体の座標で end に終わる)の尻が、仮名へ続く接続の語の漢字(方針及び基本構想の「及」、又は、並びに)なら、その字。
104
+ * 解析が接続の語と読み、語が連なりの中で始まって連なりの外まで続くときだけ。字は後ろの語とつなぐ語で、名前の一部ではない。
105
+ */
106
+ export const trailingConjunction = (tokens: readonly Token[], start: number, end: number, run: string): { surface: string; start: number } | undefined => {
107
+ const token = tokens.find((candidate) => candidate.span.start < end && end < candidate.span.end);
108
+ if (token === undefined || token.pos !== "CCONJ" || token.span.start <= start) return undefined;
109
+ return { surface: run.slice(run.length - (end - token.span.start)), start: token.span.start };
110
+ };
@@ -1,3 +1,6 @@
1
+ import type { Span, Token } from "../plugin.ts";
2
+ import { isFullName } from "./name-run.ts";
3
+
1
4
  /**
2
5
  * 漢字の連なりを、読み手がもう知っている語(組織の名前、文書がほかで単独で使う組織の名前、決まった語)で割った残り。
3
6
  * 知っている語は、連なりの中でも語の切れ目を見せる。残りのそれぞれが、読み手が切れ目を探す長さ。
@@ -58,3 +61,26 @@ export const standaloneNames = (runs: readonly string[], min: number, max: numbe
58
61
  return length >= min && length <= max && units.some((unit) => run.endsWith(unit) && length - [...unit].length >= MIN_BODY_LENGTH);
59
62
  }),
60
63
  );
64
+
65
+ /** words の [from, to) が決まった語(内閣総理大臣)か。 */
66
+ const isKnownWordAt = (words: readonly string[], from: number, to: number, knownWords: ReadonlySet<string>): boolean =>
67
+ from >= 0 && to <= words.length && knownWords.has(words.slice(from, to).join(""));
68
+
69
+ /**
70
+ * 連なりの語(runTokens、その字が words)の piece が、決まった職名(knownWords: 内閣総理大臣)のすぐ前かすぐ後ろに立つ人の姓と名
71
+ * (小泉純一郎内閣総理大臣、内閣総理大臣石破茂)か。職名は maxWords 語まで。人の名前と職名の組は、読み手が切れ目を知っている。
72
+ * 職名の無い名前の並び(田中一郎山田花子)は割らない。
73
+ */
74
+ export const isTitledPerson = (
75
+ runTokens: readonly Token[],
76
+ words: readonly string[],
77
+ piece: Span,
78
+ knownWords: ReadonlySet<string>,
79
+ maxWords: number,
80
+ ): boolean => {
81
+ if (!isFullName(runTokens.slice(piece.start, piece.end))) return false;
82
+ const lengths = Array.from({ length: maxWords }, (_, offset) => offset + 1);
83
+ return lengths.some(
84
+ (length) => isKnownWordAt(words, piece.end, piece.end + length, knownWords) || isKnownWordAt(words, piece.start - length, piece.start, knownWords),
85
+ );
86
+ };
@@ -11,7 +11,8 @@ const KINDS: readonly Kind[] = [
11
11
  { id: "period", usual: "。", western: "." },
12
12
  ];
13
13
 
14
- const MARKS = /[、,。.]/gu;
14
+ /** 日本語の語と語の間の半角の「,」(自家用自動車,社用車)も、読点を「,」の側で書いたものと数える。 */
15
+ const MARKS = /[、,。.]|(?<=[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}ー]),(?=[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}ー])/gu;
15
16
 
16
17
  const DIGIT = /[\d0-9]/u;
17
18
 
@@ -95,6 +96,25 @@ const isItemReference = ({ text, at }: Place): boolean => DIGIT.test(text.charAt
95
96
 
96
97
  const isInsideNumber = (text: string, at: number): boolean => DIGIT.test(text.charAt(at - 1)) && DIGIT.test(text.charAt(at + 1));
97
98
 
99
+ /**
100
+ * 符号(特許の図の符号や記号)。数字に一、二文字の英字を添えたもの(30a、11e、S1)か、一、二文字の英字だけ(a、b)。
101
+ * 「Word,Excel」のような語は符号ではない。
102
+ */
103
+ const SIGN = /^(?:[A-Za-zA-Za-z]{0,2}[\d0-9]{1,4}[A-Za-zA-Za-z]{0,2}|[A-Za-zA-Za-z]{1,2})$/u;
104
+ const SIGN_BEFORE = /(?:^|[^\dA-Za-z0-9A-Za-z])([\dA-Za-z0-9A-Za-z]+)(?:[((][^()()]{0,20}[))])?$/u;
105
+ const SIGN_AFTER = /^([\dA-Za-z0-9A-Za-z]+)(?![\dA-Za-z0-9A-Za-z])/u;
106
+ const SIGN_REACH = 32;
107
+
108
+ /**
109
+ * 符号を並べる「,」(側壁9c,9c間、a,b,c、端部11c(引き出し口側),11d)。特許の公報は本文を「、」で書き、
110
+ * 符号の並びだけを「,」で区切る。前の符号の後ろに括弧の添え書きがあってもよい。
111
+ */
112
+ const isBetweenSigns = (text: string, at: number): boolean => {
113
+ const before = SIGN_BEFORE.exec(text.slice(Math.max(0, at - SIGN_REACH), at))?.[1];
114
+ const after = SIGN_AFTER.exec(text.slice(at + 1, at + 1 + SIGN_REACH))?.[1];
115
+ return before !== undefined && after !== undefined && SIGN.test(before) && SIGN.test(after);
116
+ };
117
+
98
118
  const isLabelPeriod = (place: Place, kana: ReadonlySet<string>): boolean => {
99
119
  const { text, at } = place;
100
120
  const beforeNumber = text.slice(Math.max(0, at - LIST_NUMBER_REACH), at);
@@ -116,7 +136,7 @@ const isLabelPeriod = (place: Place, kana: ReadonlySet<string>): boolean => {
116
136
  */
117
137
  const isNotPunctuation = (place: Place, mark: string, kana: ReadonlySet<string>): boolean => {
118
138
  if (mark === ".") return isInsideNumber(place.text, place.at) || isLabelPeriod(place, kana);
119
- if (mark === ",") return isInsideNumber(place.text, place.at);
139
+ if (mark === ",") return isInsideNumber(place.text, place.at) || isBetweenSigns(place.text, place.at);
120
140
  return false;
121
141
  };
122
142
 
@@ -135,8 +155,8 @@ export const marksIn = (sentence: Sentence, source: string, exceptions: MarkExce
135
155
  })
136
156
  .filter((match) => !isWithinAny(skipped, { start: match.index, end: match.index }))
137
157
  .map((match) => {
138
- const western = match[0] === "," || match[0] === ".";
139
- const kind = match[0] === "、" || match[0] === "," ? "comma" : "period";
158
+ const western = match[0] !== "、" && match[0] !== "。";
159
+ const kind = match[0] === "、" || match[0] === "," || match[0] === "," ? "comma" : "period";
140
160
  return { kind, western, mark: match[0], offset: sentence.span.start + match.index };
141
161
  });
142
162
  };
@@ -41,3 +41,14 @@ export const introducesList = (source: string, offset: number): boolean => {
41
41
  const next = nextWrittenLine(source, end + 1);
42
42
  return next !== undefined && isListItem(next);
43
43
  };
44
+
45
+ const LINE_OPENING = /^[ \t\u3000—―–]*$/u;
46
+
47
+ /**
48
+ * "――今後の目標を教えてください。" (an interviewer's turn), "— Nina" (a sign-off) and "――――" (a rule across the page):
49
+ * a dash with only blanks and dashes before it on its line marks who speaks or where a block ends. It sets off no words.
50
+ */
51
+ export const opensLine = (source: string, offset: number): boolean => {
52
+ const start = source.lastIndexOf("\n", offset - 1) + 1;
53
+ return LINE_OPENING.test(source.slice(start, offset));
54
+ };
@@ -13,3 +13,17 @@ const LETTER_JOINED_NAME = new RegExp(String.raw`(?<![${SPACED_WORD_CHAR}.-])[A-
13
13
  /** 文の中の、一文字を - で語の前に繋いだ名前の範囲。 */
14
14
  export const letterJoinedNameSpans = (text: string): Span[] =>
15
15
  [...text.matchAll(LETTER_JOINED_NAME)].map((match) => ({ start: match.index, end: match.index + match[0].length }));
16
+
17
+ /**
18
+ * 大文字の語を - で頭だけ大文字の語に繋いだ名前(NITE SAFE-Lite)。後ろの語が名前を作るので、前の大文字は展開を待つ略語ではない。
19
+ * 後ろに大文字で始まる語が続けば、見出しの語の頭を大文字にした書き方(NASA-Funded Research)で、前の大文字は略語のまま数える。
20
+ * 小文字の語に繋いだもの(API-driven)と、大文字どうし(RT-PCR)も略語のまま。
21
+ */
22
+ const CAPITAL_JOINED_NAME = new RegExp(
23
+ String.raw`(?<![${SPACED_WORD_CHAR}.-])[A-Z]{2,6}-\p{Lu}\p{Ll}{2,}(?![${SPACED_WORD_CHAR}-]|\.[A-Za-z0-9]|[ \t]+\p{Lu})`,
24
+ "gu",
25
+ );
26
+
27
+ /** 文の中の、大文字の語を頭だけ大文字の語に繋いだ名前の範囲。 */
28
+ export const capitalJoinedNameSpans = (text: string): Span[] =>
29
+ [...text.matchAll(CAPITAL_JOINED_NAME)].map((match) => ({ start: match.index, end: match.index + match[0].length }));
@@ -1,10 +1,8 @@
1
1
  import { joinWords } from "./word-list.ts";
2
- import { pairMinority } from "./contraction-minority.ts";
3
- import { withoutMentions } from "./contraction-mention.ts";
4
- import { straightApostrophes } from "../orthography.ts";
5
2
  import { wordsOf } from "./structure.ts";
6
3
  import type { Detector, Finding, Lexicon, LexiconEntry, ProseDocument, Sentence, Span, Token } from "../plugin.ts";
7
4
  import { entryIn, entryOpens, entryRanges, type TokenRange } from "./lexicon-match.ts";
5
+ import { sentencesWithHeadings } from "./heading-sentences.ts";
8
6
  import { scoped, scopeMarkersOf, type ScopeMarkers } from "./superlative-scope.ts";
9
7
  import { makesWord, namesQuantity } from "./superlative-name.ts";
10
8
  import { namesAmount } from "./superlative-amount.ts";
@@ -12,6 +10,7 @@ import { restricted, type Restrictors } from "./superlative-clause.ts";
12
10
  import { stackedHedges, type StackedHedge } from "./stacked-hedge.ts";
13
11
  import { comparisonMarkersOf, counterpartBefore, onlyQuoted, quotedRange, type ComparisonMarkers } from "./superlative-comparison.ts";
14
12
  import { inPhrase, ownedBefore } from "./superlative-phrase.ts";
13
+ import { asked, contextOf, pointsAtReferent, ranksParts, sought, viewpointBefore, type Context } from "./superlative-context.ts";
15
14
 
16
15
  const PER = 1000;
17
16
 
@@ -128,11 +127,12 @@ type Qualifiers = {
128
127
  readonly restrictors: Restrictors;
129
128
  readonly phrases: Lexicon;
130
129
  readonly owners: Lexicon;
130
+ readonly context: Context;
131
131
  };
132
132
 
133
133
  const qualifiersOf = (doc: ProseDocument): Qualifiers => ({
134
134
  comparison: comparisonMarkersOf(doc.lexicons["comparison-marker"] ?? []),
135
- scope: scopeMarkersOf(doc.lexicons["superlative-scope"] ?? []),
135
+ scope: scopeMarkersOf(doc.lexicons["superlative-scope"] ?? [], doc.lexicons["superlative-purpose"], doc.lexicons["superlative-realm"]),
136
136
  quantityNouns: doc.lexicons["quantity-noun"] ?? [],
137
137
  suffixes: doc.lexicons["superlative-suffix"] ?? [],
138
138
  amounts: doc.lexicons["superlative-amount"] ?? [],
@@ -143,6 +143,7 @@ const qualifiersOf = (doc: ProseDocument): Qualifiers => ({
143
143
  },
144
144
  phrases: doc.lexicons["superlative-phrase"] ?? [],
145
145
  owners: doc.lexicons["superlative-owner"] ?? [],
146
+ context: contextOf(doc.lexicons),
146
147
  });
147
148
 
148
149
  /** 範囲・持ち主・節・分詞・形容詞・すぐ前の相手のどれかが最上級を限っているか、最上級が量か名前を言っているか。 */
@@ -150,6 +151,9 @@ const qualifiedAt = (tokens: readonly Token[], range: TokenRange, qualifiers: Qu
150
151
  counterpartBefore(tokens, range, qualifiers.comparison.before) ||
151
152
  scoped(tokens, range, qualifiers.scope) ||
152
153
  ownedBefore(tokens, range, qualifiers.owners) ||
154
+ viewpointBefore(tokens, range, qualifiers.context.viewpoints) ||
155
+ pointsAtReferent(tokens, range, qualifiers.context.referents) ||
156
+ ranksParts(tokens, range, qualifiers.context.parts) ||
153
157
  restricted(tokens, range, qualifiers.restrictors) ||
154
158
  namesQuantity(tokens, range, qualifiers.quantityNouns) ||
155
159
  makesWord(tokens, range, qualifiers.suffixes) ||
@@ -161,12 +165,19 @@ const everyQualified = (sentence: Sentence, entry: LexiconEntry, qualifiers: Qua
161
165
  const ranges = entryRanges(sentence, entry);
162
166
  return (
163
167
  ranges.length > 0 &&
164
- ranges.every((range) => quotedRange(sentence, range) || inPhrase(tokens, range, qualifiers.phrases) || qualifiedAt(tokens, range, qualifiers))
168
+ ranges.every(
169
+ (range) =>
170
+ quotedRange(sentence, range) ||
171
+ inPhrase(tokens, range, qualifiers.phrases) ||
172
+ sought(sentence, range, qualifiers.context.goals) ||
173
+ qualifiedAt(tokens, range, qualifiers),
174
+ )
165
175
  );
166
176
  };
167
177
 
168
178
  const qualified = (sentence: Sentence, entry: LexiconEntry, qualifiers: Qualifiers): boolean =>
169
179
  DIGIT.test(sentence.text) ||
180
+ asked(sentence) ||
170
181
  onlyQuoted(sentence, entry) ||
171
182
  qualifiers.comparison.anywhere.some((marker) => entryIn(sentence, marker)) ||
172
183
  everyQualified(sentence, entry, qualifiers);
@@ -244,14 +255,15 @@ const writtenIn = (sentence: Sentence, entry: LexiconEntry): boolean =>
244
255
  : entryRanges(sentence, entry).some((range) => !quotedRange(sentence, range));
245
256
 
246
257
  /**
247
- * AI 生成の signal。1 つでは何も言えないので、重みを足し合わせて文書の点にする。
258
+ * AI 生成の signal。1 つでは何も言えないので、重みを足し合わせて文書の点にする。見出しも読む(「〜をわかりやすく解説」のような題)。
248
259
  * 単独で断じない。§20.2 の複合シグナルの入口で、これだけで「AI が書いた」とは言わない。
249
260
  */
250
261
  export const aiTell: Detector = (doc, options): Finding[] => {
251
262
  const entries = [...new Map((options.lexicon ?? []).map((entry) => [entry.pattern.toLowerCase(), entry])).values()];
252
- const found = entries.filter((entry) => doc.sentences.some((sentence) => writtenIn(sentence, entry)));
263
+ const sentences = sentencesWithHeadings(doc);
264
+ const found = entries.filter((entry) => sentences.some((sentence) => writtenIn(sentence, entry)));
253
265
  const score = Math.round(found.reduce((sum, entry) => sum + (entry.weight ?? 1), 0) * 10);
254
- const first = doc.sentences.find((sentence) => found.some((entry) => writtenIn(sentence, entry)));
266
+ const first = sentences.find((sentence) => found.some((entry) => writtenIn(sentence, entry)));
255
267
  if (first === undefined || score <= options.limit) return [];
256
268
  return [
257
269
  {
@@ -273,58 +285,3 @@ export const aiTell: Detector = (doc, options): Finding[] => {
273
285
  },
274
286
  ];
275
287
  };
276
-
277
- /**
278
- * 同じことを言う 2 つの書きかたが、1 つの文書で混ざっているか。
279
- *
280
- * **どちらが正しいかは決めない。** 短縮形を使うかどうかは文体の選択で、
281
- * 立場を取ると方針の違う書き手に rule ごと無視される。spec §12.3。
282
- *
283
- * 語彙表は対を持つ(`pattern` と `instead_of`)。比べるのは対の中だけで、別の語どうしは比べない。
284
- * GOV.UK の文体は「you're」を使い否定は「do not」と書く。語ごとに決めた書きかたで、混在ではない。
285
- * 否定と代名詞+動詞の族にもまとめない。「don't」と「does not」を書き分ける文書もある。
286
- */
287
- /**
288
- * 語の境界で照合する。部分一致だと「it isn't」が「it is」を含んでしまい、
289
- * 短縮形を使っている文が「使っていない」側に数えられる。
290
- */
291
- const wordUses = (text: string, word: string): number => [...text.matchAll(new RegExp(`\\b${word.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&")}\\b`, "gu"))].length;
292
-
293
- const containsWord = (text: string, word: string): boolean => wordUses(text, word) > 0;
294
-
295
- /**
296
- * アポストロフィの形(don’t と don't)は短縮形かどうかを変えない。違うのは印刷の形で、文体ではない。
297
- * 折り返した行(「do」で改行して「not」)も、空白 1 つと同じに読む。
298
- */
299
- const comparableText = (sentence: Sentence): string => withoutMentions(straightApostrophes(sentence.text)).replace(/\s+/gu, " ").toLowerCase();
300
-
301
- type MixedPair = { readonly minority: string; readonly majority: string; readonly count: number };
302
-
303
- const mixedPair = (body: string, short: string, long: string): MixedPair | undefined => {
304
- const uses = { short: wordUses(body, short), long: wordUses(body, long) };
305
- const side = pairMinority(uses);
306
- if (side === undefined) return undefined;
307
- return side === "short" ? { minority: short, majority: long, count: uses.short } : { minority: long, majority: short, count: uses.long };
308
- };
309
-
310
- export const contractionMix: Detector = (doc, options): Finding[] => {
311
- // 文は改行でつなぐ。空白でつなぐと、箇条書きの「What we do」と次の項目「not every…」が「do not」と数えられる。
312
- const body = doc.sentences.map(comparableText).join("\n");
313
- const mixed = (options.lexicon ?? []).flatMap((entry) => {
314
- const pair = entry.instead_of === undefined ? undefined : mixedPair(body, entry.pattern.toLowerCase(), entry.instead_of.toLowerCase());
315
- return pair === undefined || pair.count > options.limit ? [] : [pair];
316
- });
317
- const hits = doc.sentences.flatMap((sentence) => {
318
- const text = comparableText(sentence);
319
- const pair = mixed.find((candidate) => containsWord(text, candidate.minority));
320
- return pair === undefined ? [] : [{ sentence, pair }];
321
- });
322
- return hits.map(({ sentence, pair }) => ({
323
- rule: "contraction-consistency",
324
- severity: "info",
325
- line: 0,
326
- column: 0,
327
- quote: sentence.text.trim(),
328
- values: { matched: pair.minority, majority: pair.majority, count: pair.count, limit: options.limit, offset: sentence.span.start },
329
- }));
330
- };
@@ -26,7 +26,7 @@ export const firstContent = (scope: ItemScope, item: TokenRange): Token | undefi
26
26
 
27
27
  export const lastContent = (scope: ItemScope, item: TokenRange): Token | undefined => last(scope, "content", item);
28
28
 
29
- const shapeOfHead = (head: Token | undefined): string | undefined => {
29
+ export const shapeOfHead = (head: Token | undefined): string | undefined => {
30
30
  if (head === undefined) return undefined;
31
31
  return NOMINAL.has(head.pos) ? "NOMINAL" : head.pos;
32
32
  };
@@ -92,6 +92,42 @@ export const isModifiedNoun = (scope: ItemScope, item: TokenRange): boolean => {
92
92
  return MODIFIER.has(tokenAt(scope, headAt)?.pos ?? "") && nounPhrase && APPOSITIVE_ANCHOR.has(last(scope, "open", tail)?.pos ?? "");
93
93
  };
94
94
 
95
+ /** and / or の直前が読点か。Oxford comma を打った並び。 */
96
+ export const commaBefore = (scope: ItemScope, at: number): boolean => scope.sentence.tokens[at - 1]?.surface === ",";
97
+
98
+ export const lastAt = (scope: ItemScope, name: ColumnName, item: TokenRange): number => lastIn(scope.sentence.column[name], item, scope.level);
99
+
100
+ /** 目的語を待つ語。前置詞と、解析器が小辞と読む to(related to / not limited to)。 */
101
+ const AWAITS_OBJECT: ReadonlySet<string> = new Set(["ADP", "PART"]);
102
+
103
+ /** 前置詞で終わる項目(conditions upon / necessary for / but not limited to)。目的語は読点の後ろにあり、項目はまだ閉じていない。 */
104
+ export const endsWithPreposition = (scope: ItemScope, item: TokenRange): boolean => AWAITS_OBJECT.has(last(scope, "open", item)?.pos ?? "");
105
+
106
+ /** 前置詞だけの項目(on or before Jan 23 の on)。and / or は 2 つの前置詞を結び、目的語を共有する。 */
107
+ export const isBarePreposition = (scope: ItemScope, item: TokenRange): boolean => {
108
+ const words = count(scope, "open", item);
109
+ return words > 0 && words === count(scope, "adposition", item);
110
+ };
111
+
112
+ /** 形容詞と名詞だけの句(issues / use cases)。前置詞や動詞を連れていない。 */
113
+ export const isBareNounPhrase = (scope: ItemScope, item: TokenRange): boolean => {
114
+ const words = count(scope, "open", item);
115
+ return words > 0 && words === count(scope, "nounPhraseTail", item);
116
+ };
117
+
118
+ /** 副詞でない中身の語がある項目。not だけ、quickly だけの切れ端は項目にならない。 */
119
+ export const hasNonAdverbContent = (scope: ItemScope, item: TokenRange): boolean => count(scope, "contentNotAdverb", item) > 0;
120
+
121
+ /** 不定冠詞と形容詞だけの項目(a simple / a flexible)。名詞がまだ来ていないので、次の項目の名詞にかかる語。 */
122
+ export const isBareIndefiniteModifier = (scope: ItemScope, item: TokenRange): boolean => {
123
+ const at = firstAt(scope, "open", item);
124
+ const article = tokenAt(scope, at);
125
+ if (article === undefined || !(scope.sentence.words.indefinite?.has(article.surface.toLowerCase()) ?? false)) return false;
126
+ const rest = { start: at + 1, end: item.end };
127
+ const words = count(scope, "open", rest);
128
+ return words > 0 && words === count(scope, "adjective", rest);
129
+ };
130
+
95
131
  export const isPluralNounPhrase = (scope: ItemScope, item: TokenRange): boolean =>
96
132
  count(scope, "content", item) === count(scope, "nounPhraseTail", item) && lastContent(scope, item)?.features?.["Number"] === "Plur";
97
133
 
@@ -18,12 +18,14 @@ import { lowerBound, type TokenRange } from "./token-column.ts";
18
18
  // に答えるための表を足していく。and / or のたびに作るのは、まだ閉じていない最後の 1、2 項目だけ。
19
19
 
20
20
  /** 項目ごとに一度だけ答えを覚えておく問い。 */
21
- export type Flag = "closed" | "example" | "participle" | "verbalShape" | "hasVerb" | "isClause" | "prepositionalTail" | "notNounHead" | "notProperNounHead";
21
+ export type Flag =
22
+ "closed" | "turn" | "example" | "participle" | "verbalShape" | "hasVerb" | "isClause" | "prepositionalTail" | "notNounHead" | "notProperNounHead";
22
23
 
23
24
  type FlagTest = (scope: ItemScope, item: TokenRange) => boolean;
24
25
 
25
26
  export const FLAG_TESTS: Readonly<Record<Flag, FlagTest>> = {
26
27
  closed: (scope, item) => isListConjunction(openingOf(scope, item)),
28
+ turn: (scope, item) => scope.sentence.words.clauseConjunction?.has(openingOf(scope, item)?.surface.toLowerCase() ?? "") ?? false,
27
29
  example: (scope, item) => exampleEnd(scope, item) !== -1,
28
30
  participle: (scope, item) => participleOpening(scope, item) !== undefined,
29
31
  verbalShape: (scope, item) => VERBAL.has(shapeOf(scope, item) ?? ""),
@@ -40,6 +42,7 @@ type PerFlag<T> = Record<Flag, T>;
40
42
 
41
43
  const perFlag = <T>(make: () => T): PerFlag<T> => ({
42
44
  closed: make(),
45
+ turn: make(),
43
46
  example: make(),
44
47
  participle: make(),
45
48
  verbalShape: make(),
@@ -0,0 +1,44 @@
1
+ // An and / or that joins words inside the last item rather than the list's last two items: an item not finished yet
2
+ // ("on or before", "a flexible and lightweight grid") or a run that repeats the conjunction without commas. Pure.
3
+ import { commaBefore, firstAt, firstContent, isBareIndefiniteModifier, isBareNounPhrase, isBarePreposition, lastAt } from "./list-item.ts";
4
+ import type { ItemScope } from "./list-sentence.ts";
5
+ import { lastOf, type View } from "./list-view.ts";
6
+ import type { TokenRange } from "./token-column.ts";
7
+
8
+ /**
9
+ * 最後の項目がまだ閉じていない語だけなら、and / or はその語と後ろの語を結び、後ろの名詞や目的語を共有する。前置詞だけ
10
+ * (on or before Jan 23/58)か、不定冠詞と形容詞だけ(Neat, a flexible and lightweight Sass grid)。and / or の後ろが前置詞だけでも、
11
+ * 2 つの小辞を結んでいる(drive in and out)。
12
+ */
13
+ export const joinsUnfinished = (scope: ItemScope, at: number, view: View, afterItem: TokenRange): boolean => {
14
+ const last = lastOf(view);
15
+ if (last === undefined || commaBefore(scope, at)) return false;
16
+ return isBarePreposition(scope, last.item) || isBareIndefiniteModifier(scope, last.item) || isBarePreposition(scope, afterItem);
17
+ };
18
+
19
+ /** 項目の最初(fromEnd なら最後)の接続詞が、and / or と同じ深さの同じ語ならその位置。でなければ -1。 */
20
+ const sameConjunctionIn = (scope: ItemScope, item: TokenRange, word: string, fromEnd: boolean): number => {
21
+ const at = fromEnd ? lastAt(scope, "conjunction", item) : firstAt(scope, "conjunction", item);
22
+ const sameDepth = scope.sentence.depths[at] === scope.level;
23
+ return sameDepth && scope.sentence.tokens[at]?.surface.toLowerCase() === word ? at : -1;
24
+ };
25
+
26
+ /**
27
+ * 読点を打たずに同じ接続詞を重ねた並び(questions and issues and use cases)。読点を打たない書き方なので、最後の and の前に
28
+ * 読点を打つかの選択を見せない。最後の項目か and の後ろの項目に同じ接続詞があり、2 つの接続詞のあいだが形容詞と名詞だけで、
29
+ * 接続詞の後ろの頭の語どうしが同じ品詞のとき。品詞が違えば、並びのあとに述語や節をつないでいる(apples, pears and plums and ship
30
+ * them daily / engineers and they shipped)。あいだに前置詞や動詞があれば、後ろの接続詞は項目の中のもの(clean water and other
31
+ * attributes important to our physical and mental health)。
32
+ */
33
+ export const repeatsConjunction = (scope: ItemScope, at: number, view: View, afterItem: TokenRange): boolean => {
34
+ const last = lastOf(view);
35
+ const word = scope.sentence.tokens[at]?.surface.toLowerCase() ?? "";
36
+ if (last === undefined || commaBefore(scope, at)) return false;
37
+ const kind = firstContent(scope, afterItem)?.pos;
38
+ const before = sameConjunctionIn(scope, last.item, word, true);
39
+ const later = sameConjunctionIn(scope, afterItem, word, false);
40
+ const bareBefore = before !== -1 && isBareNounPhrase(scope, { start: before + 1, end: at });
41
+ const bareLater = later !== -1 && isBareNounPhrase(scope, { start: at + 1, end: later });
42
+ const startsLike = (conjunction: number, end: number): boolean => firstContent(scope, { start: conjunction + 1, end })?.pos === kind;
43
+ return kind !== undefined && ((bareBefore && startsLike(before, at)) || (bareLater && startsLike(later, afterItem.end)));
44
+ };
@@ -0,0 +1,39 @@
1
+ // How the items of one bulleted list stand on the page: which items have a blank line after them. Pure; reads the
2
+ // source between the items' spans. list-item-form-mix reads from this which items to compare with which.
3
+ import type { Span } from "../plugin.ts";
4
+
5
+ /** Whether the text before the next item ends in a blank line: "item\n\n" or "item\n\n " but not "item\n". */
6
+ const endsInBlankLine = (text: string): boolean => text.split("\n").at(-2)?.trim() === "";
7
+
8
+ /** Whether a blank line stands between each item and the next. */
9
+ const blankAfter = (source: string, spans: readonly Span[]): readonly boolean[] =>
10
+ spans.slice(1).map((next, index) => endsInBlankLine(source.slice(spans[index]?.start ?? next.start, next.start)));
11
+
12
+ /** Lone items that label a run: one is a lead-in like any other item's, two or more make groups. */
13
+ const MIN_GROUP_LABELS = 2;
14
+
15
+ /** How a list's items stand: the groups to compare within, and the lone items that head a run. */
16
+ export type ItemLayout = { readonly groups: readonly (readonly Span[])[]; readonly heads: readonly Span[] };
17
+
18
+ /**
19
+ * Items standing alone between blank lines before a run of items without them are a nested list a converter flattened
20
+ * (- 家具からの転落, then its steps). With two or more lone items right before a run, each run is a list of its own and the
21
+ * lone items are compared with none; with fewer, the list is one group. heads: every lone item before a run, with only
22
+ * lone items between.
23
+ */
24
+ export const itemLayout = (source: string, spans: readonly Span[]): ItemLayout => {
25
+ const blank = blankAfter(source, spans);
26
+ const alone = (index: number): boolean => (index === 0 || blank[index - 1] === true) && blank[index] === true;
27
+ const runAfter = (index: number): readonly Span[] => {
28
+ const end = blank.findIndex((isBlank, gap) => gap > index && isBlank);
29
+ return spans.slice(index + 1, end === -1 ? spans.length : end + 1);
30
+ };
31
+ const runStart = (index: number): number => blank.findIndex((isBlank, gap) => gap > index && !isBlank);
32
+ const headsRun = (index: number): boolean => {
33
+ const start = runStart(index);
34
+ return alone(index) && start !== -1 && spans.slice(index + 1, start).every((_, offset) => alone(index + 1 + offset));
35
+ };
36
+ const labels = spans.flatMap((_, index) => (alone(index) && blank[index + 1] === false ? [index] : []));
37
+ const heads = spans.filter((_, index) => headsRun(index));
38
+ return { groups: labels.length < MIN_GROUP_LABELS ? [spans] : labels.map(runAfter), heads };
39
+ };
@@ -1,5 +1,7 @@
1
- import type { BulletList, Sentence, Span } from "../plugin.ts";
1
+ import type { BulletList, Detector, DetectorOptions, Finding, ProseDocument, Sentence, Span } from "../plugin.ts";
2
+ import { densityFindings } from "./ai-phrasing.ts";
2
3
  import { endsWithColon } from "./lead-in.ts";
4
+ import { isMarkdownPath } from "../structure/markdown-path.ts";
3
5
 
4
6
  /** Between a lead-in and its list: only blank space. A thematic break (`***`) separates them; bold marks sit inside the sentence. */
5
7
  const ONLY_BLANKS = /^\s*$/u;
@@ -36,26 +38,105 @@ const labelWords = (text: string): string => {
36
38
  /** A noun with no kana inflection (参考, 注意点): a name, not a sentence (以下の通りです) and not a lone symbol (⚠️). */
37
39
  const NOUN_LABEL = /^(?=.*\p{L})[^\p{Script=Hiragana}]+$/u;
38
40
 
41
+ /** A label of a word or three is a name (See also, Pros) whatever its parts of speech. */
42
+ const MAX_LABEL_WORDS = 3;
43
+
44
+ /** A verb or a pronoun makes a clause: Here's what you need is a sentence, Community changes, past quarter a name. */
45
+ const CLAUSE_POS: ReadonlySet<string> = new Set(["VERB", "AUX", "PRON", "SCONJ"]);
46
+ const NAME_POS: ReadonlySet<string> = new Set(["NOUN", "PROPN"]);
47
+
48
+ /** A noun phrase of any length, read from the adapter's parts of speech. Without them, only the short label counts. */
49
+ const isNounPhrase = (sentence: Sentence): boolean => {
50
+ const tokens = sentence.tokens ?? [];
51
+ return tokens.some((token) => NAME_POS.has(token.pos)) && !tokens.some((token) => CLAUSE_POS.has(token.pos));
52
+ };
53
+
54
+ const isNounLabel = (words: string, sentence: Sentence): boolean =>
55
+ NOUN_LABEL.test(words) && (words.split(/\s+/u).length <= MAX_LABEL_WORDS || isNounPhrase(sentence));
56
+
39
57
  /**
40
58
  * A field of an entry's template: the same noun label before the list of each entry (**参考:** before each entry's link).
41
59
  * It names the field the way a table's column does; it does not lead into anything.
42
60
  */
43
61
  const fieldLabels = (leadIns: readonly Sentence[]): ReadonlySet<string> => {
44
- const counts = leadIns
45
- .map((sentence) => labelWords(sentence.text))
46
- .reduce((tally, words) => tally.set(words, (tally.get(words) ?? 0) + 1), new Map<string, number>());
47
- return new Set([...counts].filter(([words, count]) => count > 1 && NOUN_LABEL.test(words)).map(([words]) => words));
62
+ const usesByLabel = leadIns.reduce((tally, sentence) => {
63
+ const words = labelWords(sentence.text);
64
+ return tally.set(words, [...(tally.get(words) ?? []), sentence]);
65
+ }, new Map<string, readonly Sentence[]>());
66
+ const isField = (words: string, [first, ...rest]: readonly Sentence[]): boolean => first !== undefined && rest.length > 0 && isNounLabel(words, first);
67
+ return new Set([...usesByLabel].filter(([words, uses]) => isField(words, uses)).map(([words]) => words));
68
+ };
69
+
70
+ /** A line that is only a bold label (**Pros:**, **参考**:), and the label inside the bold marks. */
71
+ const BOLD_LINE = /^(?:\*\*|__)(?<label>[^*_\n]+)(?:\*\*|__)[::]?$/u;
72
+
73
+ const lineAround = (source: string, sentence: Sentence): string => {
74
+ const end = source.indexOf("\n", sentence.span.end);
75
+ return source.slice(source.lastIndexOf("\n", sentence.span.start - 1) + 1, end === -1 ? source.length : end);
76
+ };
77
+
78
+ /** A bold noun label on a line of its own names the list under it, as a heading does (**Pros:** then **Cons:**). */
79
+ const isBoldNounLabel = (sentence: Sentence, source: string): boolean => {
80
+ const label = BOLD_LINE.exec(lineAround(source, sentence).trim())?.groups?.["label"];
81
+ return label !== undefined && isNounLabel(labelWords(label), sentence);
48
82
  };
49
83
 
84
+ /** Plain text cannot write bold, so there a noun label alone on its line is the heading of its list (Releases:, New Features:). */
85
+ const isPlainNounLabel = (sentence: Sentence, source: string): boolean =>
86
+ lineAround(source, sentence).trim() === sentence.text.trim() && isNounLabel(labelWords(sentence.text), sentence);
87
+
88
+ /** An item's list marker and any emphasis before its first word (- **, 1. ). */
89
+ const ITEM_HEAD = /^\s*(?:[-*+]|\d+[.)])\s+(?:\*\*|__|\*|_)?/u;
90
+
91
+ const opensWithCode = (source: string, item: Span): boolean => source.slice(item.start, item.end).replace(ITEM_HEAD, "").startsWith("`");
92
+
93
+ /** A list whose every item opens with a code span names values, options or members (`omit`: never send …): a parts list, which can stay. */
94
+ const isValueList = (list: BulletList, source: string): boolean => list.itemSpans.length > 1 && list.itemSpans.every((item) => opensWithCode(source, item));
95
+
50
96
  /**
51
97
  * Prose sentences ending in a colon that hand the reader straight to a list (「以下の通りです:」, "Here's what you need:").
52
98
  * An item of a list is not prose: 「例: `code`」 ends in a colon once its code is masked, and it leads nowhere.
53
99
  */
54
- export const colonLeadIns = (sentences: readonly Sentence[], lists: readonly BulletList[], listSpans: readonly Span[], source: string): Sentence[] => {
100
+ export const colonLeadIns = (
101
+ sentences: readonly Sentence[],
102
+ lists: readonly BulletList[],
103
+ listSpans: readonly Span[],
104
+ source: string,
105
+ markdown = true,
106
+ ): Sentence[] => {
55
107
  const leadIns = lists.flatMap((list) => {
108
+ if (isValueList(list, source)) return [];
56
109
  const before = sentenceRightBefore(sentences, list, source);
57
110
  return before !== undefined && endsWithColon(before.text) && !insideAny(listSpans, before.span.start) ? [before] : [];
58
111
  });
59
112
  const fields = fieldLabels(leadIns);
60
- return leadIns.filter((sentence) => !fields.has(labelWords(sentence.text)));
113
+ const namesItsList = (sentence: Sentence): boolean => (markdown ? isBoldNounLabel(sentence, source) : isPlainNounLabel(sentence, source));
114
+ return leadIns.filter((sentence) => !fields.has(labelWords(sentence.text)) && !namesItsList(sentence));
115
+ };
116
+
117
+ /** Lead-ins in one or two sections are a how-to's procedure or a pair of lists; the rule's why is section after section. */
118
+ const DEFAULT_MIN_SECTIONS = 3;
119
+
120
+ const minSections = (options: DetectorOptions): number => {
121
+ const value = options.settings?.["min_sections"];
122
+ return typeof value === "number" ? value : DEFAULT_MIN_SECTIONS;
123
+ };
124
+
125
+ /** How many sections hold a lead-in. A document without headings cannot be split, so each lead-in counts as its own. */
126
+ const sectionsHolding = (doc: ProseDocument, leadIns: readonly Sentence[]): number => {
127
+ if (!doc.sections.some((section) => section.depth > 0)) return leadIns.length;
128
+ const sectionOf = (sentence: Sentence): number => doc.sections.findLastIndex((section) => section.span.start <= sentence.span.start);
129
+ return new Set(leadIns.map(sectionOf)).size;
130
+ };
131
+
132
+ /**
133
+ * コロンで箇条書きへ渡す文(以下の通りです:)。1 つなら案内だが、節ごとに続くと説明が箇条書きの前置きだけになる。
134
+ * 数えるのは文書の言語の文だけ。和文の中の英文(Examples include:)は、英語ではふつうの書き方なので数えない。
135
+ */
136
+ export const colonLeadIn: Detector = (doc, options): Finding[] => {
137
+ const inDocumentLanguage = doc.sentences.filter((sentence) => sentence.embeddedLanguage === undefined);
138
+ const leadIns = colonLeadIns(inDocumentLanguage, doc.lists, doc.listSpans, doc.source, isMarkdownPath(doc.path));
139
+ if (sectionsHolding(doc, leadIns) < minSections(options)) return [];
140
+ const hits = leadIns.map((sentence) => ({ sentence, matched: sentence.text.trim() }));
141
+ return densityFindings(doc, hits, options.limit);
61
142
  };