chaffjs 0.38.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (892) hide show
  1. package/README.ja.md +21 -4
  2. package/README.md +20 -2
  3. package/checks/ai-tells.yaml +153 -0
  4. package/dist/acronym-expansion.d.ts +4 -0
  5. package/dist/acronym-expansion.d.ts.map +1 -0
  6. package/dist/acronym-expansion.js +46 -0
  7. package/dist/acronym-expansion.js.map +1 -0
  8. package/dist/ai-score/human-shares.d.ts.map +1 -1
  9. package/dist/ai-score/human-shares.js +54 -12
  10. package/dist/ai-score/human-shares.js.map +1 -1
  11. package/dist/ai-score/of-document.d.ts.map +1 -1
  12. package/dist/ai-score/of-document.js +4 -2
  13. package/dist/ai-score/of-document.js.map +1 -1
  14. package/dist/alternative-words.d.ts +6 -0
  15. package/dist/alternative-words.d.ts.map +1 -1
  16. package/dist/alternative-words.js +10 -0
  17. package/dist/alternative-words.js.map +1 -1
  18. package/dist/body-section.d.ts +3 -1
  19. package/dist/body-section.d.ts.map +1 -1
  20. package/dist/body-section.js +9 -2
  21. package/dist/body-section.js.map +1 -1
  22. package/dist/capitals-with-small.d.ts +5 -0
  23. package/dist/capitals-with-small.d.ts.map +1 -1
  24. package/dist/capitals-with-small.js +15 -0
  25. package/dist/capitals-with-small.js.map +1 -1
  26. package/dist/checks.d.ts +11 -0
  27. package/dist/checks.d.ts.map +1 -1
  28. package/dist/checks.js +27 -1
  29. package/dist/checks.js.map +1 -1
  30. package/dist/cli-args.js +1 -1
  31. package/dist/cli-args.js.map +1 -1
  32. package/dist/cli-text.d.ts.map +1 -1
  33. package/dist/cli-text.js +4 -0
  34. package/dist/cli-text.js.map +1 -1
  35. package/dist/closing-code.d.ts +8 -0
  36. package/dist/closing-code.d.ts.map +1 -0
  37. package/dist/closing-code.js +18 -0
  38. package/dist/closing-code.js.map +1 -0
  39. package/dist/commands/fix-plan.d.ts.map +1 -1
  40. package/dist/commands/fix-plan.js +64 -4
  41. package/dist/commands/fix-plan.js.map +1 -1
  42. package/dist/commands/test.d.ts.map +1 -1
  43. package/dist/commands/test.js +16 -2
  44. package/dist/commands/test.js.map +1 -1
  45. package/dist/date-format.d.ts +19 -1
  46. package/dist/date-format.d.ts.map +1 -1
  47. package/dist/date-format.js +41 -5
  48. package/dist/date-format.js.map +1 -1
  49. package/dist/detectors/acronym-context.d.ts +5 -2
  50. package/dist/detectors/acronym-context.d.ts.map +1 -1
  51. package/dist/detectors/acronym-context.js +19 -4
  52. package/dist/detectors/acronym-context.js.map +1 -1
  53. package/dist/detectors/acronym-expansion.d.ts.map +1 -1
  54. package/dist/detectors/acronym-expansion.js +25 -0
  55. package/dist/detectors/acronym-expansion.js.map +1 -1
  56. package/dist/detectors/acronym-gloss.d.ts +19 -0
  57. package/dist/detectors/acronym-gloss.d.ts.map +1 -1
  58. package/dist/detectors/acronym-gloss.js +115 -0
  59. package/dist/detectors/acronym-gloss.js.map +1 -1
  60. package/dist/detectors/acronym-mention.d.ts +5 -0
  61. package/dist/detectors/acronym-mention.d.ts.map +1 -1
  62. package/dist/detectors/acronym-mention.js +16 -0
  63. package/dist/detectors/acronym-mention.js.map +1 -1
  64. package/dist/detectors/acronym-name.d.ts +14 -2
  65. package/dist/detectors/acronym-name.d.ts.map +1 -1
  66. package/dist/detectors/acronym-name.js +28 -3
  67. package/dist/detectors/acronym-name.js.map +1 -1
  68. package/dist/detectors/acronym-series.d.ts +7 -0
  69. package/dist/detectors/acronym-series.d.ts.map +1 -0
  70. package/dist/detectors/acronym-series.js +25 -0
  71. package/dist/detectors/acronym-series.js.map +1 -0
  72. package/dist/detectors/ai-phrasing.d.ts +3 -6
  73. package/dist/detectors/ai-phrasing.d.ts.map +1 -1
  74. package/dist/detectors/ai-phrasing.js +17 -16
  75. package/dist/detectors/ai-phrasing.js.map +1 -1
  76. package/dist/detectors/ai-structure.d.ts +1 -0
  77. package/dist/detectors/ai-structure.d.ts.map +1 -1
  78. package/dist/detectors/ai-structure.js +15 -4
  79. package/dist/detectors/ai-structure.js.map +1 -1
  80. package/dist/detectors/alnum-number.d.ts +1 -0
  81. package/dist/detectors/alnum-number.d.ts.map +1 -1
  82. package/dist/detectors/alnum-number.js +7 -3
  83. package/dist/detectors/alnum-number.js.map +1 -1
  84. package/dist/detectors/bare-comparative.d.ts +6 -0
  85. package/dist/detectors/bare-comparative.d.ts.map +1 -1
  86. package/dist/detectors/bare-comparative.js +31 -12
  87. package/dist/detectors/bare-comparative.js.map +1 -1
  88. package/dist/detectors/blank-runs.d.ts +12 -0
  89. package/dist/detectors/blank-runs.d.ts.map +1 -0
  90. package/dist/detectors/blank-runs.js +27 -0
  91. package/dist/detectors/blank-runs.js.map +1 -0
  92. package/dist/detectors/bold-emphasis-form.d.ts +8 -0
  93. package/dist/detectors/bold-emphasis-form.d.ts.map +1 -0
  94. package/dist/detectors/bold-emphasis-form.js +40 -0
  95. package/dist/detectors/bold-emphasis-form.js.map +1 -0
  96. package/dist/detectors/bold-emphasis.d.ts +0 -1
  97. package/dist/detectors/bold-emphasis.d.ts.map +1 -1
  98. package/dist/detectors/bold-emphasis.js +14 -12
  99. package/dist/detectors/bold-emphasis.js.map +1 -1
  100. package/dist/detectors/bold-label.d.ts +3 -1
  101. package/dist/detectors/bold-label.d.ts.map +1 -1
  102. package/dist/detectors/bold-label.js +16 -6
  103. package/dist/detectors/bold-label.js.map +1 -1
  104. package/dist/detectors/capitalised-term.d.ts.map +1 -1
  105. package/dist/detectors/capitalised-term.js +28 -9
  106. package/dist/detectors/capitalised-term.js.map +1 -1
  107. package/dist/detectors/caps-caption.d.ts +5 -0
  108. package/dist/detectors/caps-caption.d.ts.map +1 -1
  109. package/dist/detectors/caps-caption.js +20 -2
  110. package/dist/detectors/caps-caption.js.map +1 -1
  111. package/dist/detectors/char-shape.d.ts.map +1 -1
  112. package/dist/detectors/char-shape.js +86 -27
  113. package/dist/detectors/char-shape.js.map +1 -1
  114. package/dist/detectors/chat-log-line.d.ts +8 -0
  115. package/dist/detectors/chat-log-line.d.ts.map +1 -0
  116. package/dist/detectors/chat-log-line.js +13 -0
  117. package/dist/detectors/chat-log-line.js.map +1 -0
  118. package/dist/detectors/citation-string.d.ts +9 -0
  119. package/dist/detectors/citation-string.d.ts.map +1 -0
  120. package/dist/detectors/citation-string.js +86 -0
  121. package/dist/detectors/citation-string.js.map +1 -0
  122. package/dist/detectors/closing-cliche.d.ts +18 -0
  123. package/dist/detectors/closing-cliche.d.ts.map +1 -0
  124. package/dist/detectors/closing-cliche.js +58 -0
  125. package/dist/detectors/closing-cliche.js.map +1 -0
  126. package/dist/detectors/closing-exhortation.d.ts +18 -0
  127. package/dist/detectors/closing-exhortation.d.ts.map +1 -0
  128. package/dist/detectors/closing-exhortation.js +55 -0
  129. package/dist/detectors/closing-exhortation.js.map +1 -0
  130. package/dist/detectors/cold-open.d.ts +25 -0
  131. package/dist/detectors/cold-open.d.ts.map +1 -0
  132. package/dist/detectors/cold-open.js +121 -0
  133. package/dist/detectors/cold-open.js.map +1 -0
  134. package/dist/detectors/comparative-context.d.ts +21 -0
  135. package/dist/detectors/comparative-context.d.ts.map +1 -0
  136. package/dist/detectors/comparative-context.js +57 -0
  137. package/dist/detectors/comparative-context.js.map +1 -0
  138. package/dist/detectors/concrete-evidence-density.d.ts +3 -0
  139. package/dist/detectors/concrete-evidence-density.d.ts.map +1 -0
  140. package/dist/detectors/concrete-evidence-density.js +75 -0
  141. package/dist/detectors/concrete-evidence-density.js.map +1 -0
  142. package/dist/detectors/concrete-evidence.d.ts +14 -0
  143. package/dist/detectors/concrete-evidence.d.ts.map +1 -1
  144. package/dist/detectors/concrete-evidence.js +24 -0
  145. package/dist/detectors/concrete-evidence.js.map +1 -1
  146. package/dist/detectors/contraction-emphasis.d.ts +3 -0
  147. package/dist/detectors/contraction-emphasis.d.ts.map +1 -0
  148. package/dist/detectors/contraction-emphasis.js +24 -0
  149. package/dist/detectors/contraction-emphasis.js.map +1 -0
  150. package/dist/detectors/contraction-mention.d.ts +12 -1
  151. package/dist/detectors/contraction-mention.d.ts.map +1 -1
  152. package/dist/detectors/contraction-mention.js +39 -6
  153. package/dist/detectors/contraction-mention.js.map +1 -1
  154. package/dist/detectors/contraction-mix.d.ts +3 -0
  155. package/dist/detectors/contraction-mix.d.ts.map +1 -0
  156. package/dist/detectors/contraction-mix.js +69 -0
  157. package/dist/detectors/contraction-mix.js.map +1 -0
  158. package/dist/detectors/contrast-frame.d.ts +5 -0
  159. package/dist/detectors/contrast-frame.d.ts.map +1 -1
  160. package/dist/detectors/contrast-frame.js +53 -6
  161. package/dist/detectors/contrast-frame.js.map +1 -1
  162. package/dist/detectors/coordinate-adjective.d.ts +2 -1
  163. package/dist/detectors/coordinate-adjective.d.ts.map +1 -1
  164. package/dist/detectors/coordinate-adjective.js +4 -2
  165. package/dist/detectors/coordinate-adjective.js.map +1 -1
  166. package/dist/detectors/date-format.d.ts.map +1 -1
  167. package/dist/detectors/date-format.js +13 -1
  168. package/dist/detectors/date-format.js.map +1 -1
  169. package/dist/detectors/duplicate-definition.d.ts +3 -0
  170. package/dist/detectors/duplicate-definition.d.ts.map +1 -0
  171. package/dist/detectors/duplicate-definition.js +16 -0
  172. package/dist/detectors/duplicate-definition.js.map +1 -0
  173. package/dist/detectors/duplicate-heading.d.ts +4 -2
  174. package/dist/detectors/duplicate-heading.d.ts.map +1 -1
  175. package/dist/detectors/duplicate-heading.js +35 -11
  176. package/dist/detectors/duplicate-heading.js.map +1 -1
  177. package/dist/detectors/email-frame-words.d.ts +10 -0
  178. package/dist/detectors/email-frame-words.d.ts.map +1 -0
  179. package/dist/detectors/email-frame-words.js +34 -0
  180. package/dist/detectors/email-frame-words.js.map +1 -0
  181. package/dist/detectors/email-letter.d.ts +3 -7
  182. package/dist/detectors/email-letter.d.ts.map +1 -1
  183. package/dist/detectors/email-letter.js +13 -21
  184. package/dist/detectors/email-letter.js.map +1 -1
  185. package/dist/detectors/final-period-captions.d.ts +15 -0
  186. package/dist/detectors/final-period-captions.d.ts.map +1 -0
  187. package/dist/detectors/final-period-captions.js +61 -0
  188. package/dist/detectors/final-period-captions.js.map +1 -0
  189. package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
  190. package/dist/detectors/fullwidth-alnum.js +20 -4
  191. package/dist/detectors/fullwidth-alnum.js.map +1 -1
  192. package/dist/detectors/gram-furniture.d.ts +18 -1
  193. package/dist/detectors/gram-furniture.d.ts.map +1 -1
  194. package/dist/detectors/gram-furniture.js +71 -0
  195. package/dist/detectors/gram-furniture.js.map +1 -1
  196. package/dist/detectors/gram-openers.d.ts +16 -0
  197. package/dist/detectors/gram-openers.d.ts.map +1 -1
  198. package/dist/detectors/gram-openers.js +52 -0
  199. package/dist/detectors/gram-openers.js.map +1 -1
  200. package/dist/detectors/gram-predicate.d.ts.map +1 -1
  201. package/dist/detectors/gram-predicate.js +40 -7
  202. package/dist/detectors/gram-predicate.js.map +1 -1
  203. package/dist/detectors/gram-repetition.d.ts +3 -0
  204. package/dist/detectors/gram-repetition.d.ts.map +1 -0
  205. package/dist/detectors/gram-repetition.js +158 -0
  206. package/dist/detectors/gram-repetition.js.map +1 -0
  207. package/dist/detectors/heading-level-skip.d.ts +6 -0
  208. package/dist/detectors/heading-level-skip.d.ts.map +1 -1
  209. package/dist/detectors/heading-level-skip.js +24 -1
  210. package/dist/detectors/heading-level-skip.js.map +1 -1
  211. package/dist/detectors/heading-numbering.js +2 -2
  212. package/dist/detectors/heading-numbering.js.map +1 -1
  213. package/dist/detectors/heading-sentences.d.ts +10 -0
  214. package/dist/detectors/heading-sentences.d.ts.map +1 -0
  215. package/dist/detectors/heading-sentences.js +32 -0
  216. package/dist/detectors/heading-sentences.js.map +1 -0
  217. package/dist/detectors/hyphen-copied-text.d.ts +3 -0
  218. package/dist/detectors/hyphen-copied-text.d.ts.map +1 -0
  219. package/dist/detectors/hyphen-copied-text.js +49 -0
  220. package/dist/detectors/hyphen-copied-text.js.map +1 -0
  221. package/dist/detectors/kanji-name-edge.d.ts +15 -0
  222. package/dist/detectors/kanji-name-edge.d.ts.map +1 -1
  223. package/dist/detectors/kanji-name-edge.js +30 -0
  224. package/dist/detectors/kanji-name-edge.js.map +1 -1
  225. package/dist/detectors/kanji-run-pieces.d.ts +7 -0
  226. package/dist/detectors/kanji-run-pieces.d.ts.map +1 -1
  227. package/dist/detectors/kanji-run-pieces.js +14 -4
  228. package/dist/detectors/kanji-run-pieces.js.map +1 -1
  229. package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
  230. package/dist/detectors/kutoten-consistency.js +22 -4
  231. package/dist/detectors/kutoten-consistency.js.map +1 -1
  232. package/dist/detectors/lead-in-dash.d.ts +5 -0
  233. package/dist/detectors/lead-in-dash.d.ts.map +1 -1
  234. package/dist/detectors/lead-in-dash.js +9 -0
  235. package/dist/detectors/lead-in-dash.js.map +1 -1
  236. package/dist/detectors/letter-joined-name.d.ts +2 -0
  237. package/dist/detectors/letter-joined-name.d.ts.map +1 -1
  238. package/dist/detectors/letter-joined-name.js +8 -0
  239. package/dist/detectors/letter-joined-name.js.map +1 -1
  240. package/dist/detectors/lexicon.d.ts +1 -2
  241. package/dist/detectors/lexicon.d.ts.map +1 -1
  242. package/dist/detectors/lexicon.js +16 -57
  243. package/dist/detectors/lexicon.js.map +1 -1
  244. package/dist/detectors/list-item.d.ts +14 -0
  245. package/dist/detectors/list-item.d.ts.map +1 -1
  246. package/dist/detectors/list-item.js +30 -1
  247. package/dist/detectors/list-item.js.map +1 -1
  248. package/dist/detectors/list-items.d.ts +1 -1
  249. package/dist/detectors/list-items.d.ts.map +1 -1
  250. package/dist/detectors/list-items.js +2 -0
  251. package/dist/detectors/list-items.js.map +1 -1
  252. package/dist/detectors/list-joint.d.ts +18 -0
  253. package/dist/detectors/list-joint.d.ts.map +1 -0
  254. package/dist/detectors/list-joint.js +42 -0
  255. package/dist/detectors/list-joint.js.map +1 -0
  256. package/dist/detectors/list-layout.d.ts +14 -0
  257. package/dist/detectors/list-layout.d.ts.map +1 -0
  258. package/dist/detectors/list-layout.js +29 -0
  259. package/dist/detectors/list-layout.js.map +1 -0
  260. package/dist/detectors/list-lead-in.d.ts +7 -2
  261. package/dist/detectors/list-lead-in.d.ts.map +1 -1
  262. package/dist/detectors/list-lead-in.js +67 -6
  263. package/dist/detectors/list-lead-in.js.map +1 -1
  264. package/dist/detectors/list-parallel.d.ts +6 -0
  265. package/dist/detectors/list-parallel.d.ts.map +1 -1
  266. package/dist/detectors/list-parallel.js +106 -13
  267. package/dist/detectors/list-parallel.js.map +1 -1
  268. package/dist/detectors/list-run.d.ts +13 -0
  269. package/dist/detectors/list-run.d.ts.map +1 -0
  270. package/dist/detectors/list-run.js +80 -0
  271. package/dist/detectors/list-run.js.map +1 -0
  272. package/dist/detectors/list-sentence.d.ts +11 -0
  273. package/dist/detectors/list-sentence.d.ts.map +1 -1
  274. package/dist/detectors/list-sentence.js +1 -0
  275. package/dist/detectors/list-sentence.js.map +1 -1
  276. package/dist/detectors/mark-shape.d.ts +2 -1
  277. package/dist/detectors/mark-shape.d.ts.map +1 -1
  278. package/dist/detectors/mark-shape.js +10 -6
  279. package/dist/detectors/mark-shape.js.map +1 -1
  280. package/dist/detectors/missing-final-period.d.ts.map +1 -1
  281. package/dist/detectors/missing-final-period.js +3 -1
  282. package/dist/detectors/missing-final-period.js.map +1 -1
  283. package/dist/detectors/name-run.d.ts +2 -0
  284. package/dist/detectors/name-run.d.ts.map +1 -1
  285. package/dist/detectors/name-run.js +1 -1
  286. package/dist/detectors/name-run.js.map +1 -1
  287. package/dist/detectors/name-variant-two-things.d.ts +18 -0
  288. package/dist/detectors/name-variant-two-things.d.ts.map +1 -0
  289. package/dist/detectors/name-variant-two-things.js +84 -0
  290. package/dist/detectors/name-variant-two-things.js.map +1 -0
  291. package/dist/detectors/name-variant.d.ts.map +1 -1
  292. package/dist/detectors/name-variant.js +14 -15
  293. package/dist/detectors/name-variant.js.map +1 -1
  294. package/dist/detectors/numbering-readings.d.ts +2 -2
  295. package/dist/detectors/numbering-readings.d.ts.map +1 -1
  296. package/dist/detectors/numbering-readings.js +7 -0
  297. package/dist/detectors/numbering-readings.js.map +1 -1
  298. package/dist/detectors/open-end-anaphor.d.ts +8 -0
  299. package/dist/detectors/open-end-anaphor.d.ts.map +1 -0
  300. package/dist/detectors/open-end-anaphor.js +22 -0
  301. package/dist/detectors/open-end-anaphor.js.map +1 -0
  302. package/dist/detectors/open-end-lead.d.ts +4 -0
  303. package/dist/detectors/open-end-lead.d.ts.map +1 -0
  304. package/dist/detectors/open-end-lead.js +34 -0
  305. package/dist/detectors/open-end-lead.js.map +1 -0
  306. package/dist/detectors/open-end-scope.d.ts.map +1 -1
  307. package/dist/detectors/open-end-scope.js +7 -1
  308. package/dist/detectors/open-end-scope.js.map +1 -1
  309. package/dist/detectors/ordinal-run-gaps.d.ts +1 -0
  310. package/dist/detectors/ordinal-run-gaps.d.ts.map +1 -1
  311. package/dist/detectors/ordinal-run-gaps.js +1 -1
  312. package/dist/detectors/ordinal-run-gaps.js.map +1 -1
  313. package/dist/detectors/organisation-run.d.ts +6 -0
  314. package/dist/detectors/organisation-run.d.ts.map +1 -1
  315. package/dist/detectors/organisation-run.js +26 -2
  316. package/dist/detectors/organisation-run.js.map +1 -1
  317. package/dist/detectors/orthographic-variant-open.d.ts +37 -0
  318. package/dist/detectors/orthographic-variant-open.d.ts.map +1 -0
  319. package/dist/detectors/orthographic-variant-open.js +81 -0
  320. package/dist/detectors/orthographic-variant-open.js.map +1 -0
  321. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  322. package/dist/detectors/orthographic-variant.js +55 -59
  323. package/dist/detectors/orthographic-variant.js.map +1 -1
  324. package/dist/detectors/orthography.d.ts.map +1 -1
  325. package/dist/detectors/orthography.js +14 -5
  326. package/dist/detectors/orthography.js.map +1 -1
  327. package/dist/detectors/over-general-claim.d.ts.map +1 -1
  328. package/dist/detectors/over-general-claim.js +82 -4
  329. package/dist/detectors/over-general-claim.js.map +1 -1
  330. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  331. package/dist/detectors/oxford-comma.js +61 -27
  332. package/dist/detectors/oxford-comma.js.map +1 -1
  333. package/dist/detectors/particle-run-names.d.ts +8 -0
  334. package/dist/detectors/particle-run-names.d.ts.map +1 -0
  335. package/dist/detectors/particle-run-names.js +17 -0
  336. package/dist/detectors/particle-run-names.js.map +1 -0
  337. package/dist/detectors/placeholder-text.d.ts.map +1 -1
  338. package/dist/detectors/placeholder-text.js +14 -2
  339. package/dist/detectors/placeholder-text.js.map +1 -1
  340. package/dist/detectors/proper-noun-density.d.ts +13 -0
  341. package/dist/detectors/proper-noun-density.d.ts.map +1 -0
  342. package/dist/detectors/proper-noun-density.js +97 -0
  343. package/dist/detectors/proper-noun-density.js.map +1 -0
  344. package/dist/detectors/quote-without-source.d.ts +6 -2
  345. package/dist/detectors/quote-without-source.d.ts.map +1 -1
  346. package/dist/detectors/quote-without-source.js +33 -8
  347. package/dist/detectors/quote-without-source.js.map +1 -1
  348. package/dist/detectors/quoted-excerpt.d.ts +13 -0
  349. package/dist/detectors/quoted-excerpt.d.ts.map +1 -0
  350. package/dist/detectors/quoted-excerpt.js +53 -0
  351. package/dist/detectors/quoted-excerpt.js.map +1 -0
  352. package/dist/detectors/reference-entry.d.ts +7 -0
  353. package/dist/detectors/reference-entry.d.ts.map +1 -0
  354. package/dist/detectors/reference-entry.js +35 -0
  355. package/dist/detectors/reference-entry.js.map +1 -0
  356. package/dist/detectors/register-neutral-shape.d.ts +5 -2
  357. package/dist/detectors/register-neutral-shape.d.ts.map +1 -1
  358. package/dist/detectors/register-neutral-shape.js +21 -4
  359. package/dist/detectors/register-neutral-shape.js.map +1 -1
  360. package/dist/detectors/register-separate-part.d.ts +7 -0
  361. package/dist/detectors/register-separate-part.d.ts.map +1 -0
  362. package/dist/detectors/register-separate-part.js +32 -0
  363. package/dist/detectors/register-separate-part.js.map +1 -0
  364. package/dist/detectors/register-set-apart.d.ts +24 -0
  365. package/dist/detectors/register-set-apart.d.ts.map +1 -0
  366. package/dist/detectors/register-set-apart.js +102 -0
  367. package/dist/detectors/register-set-apart.js.map +1 -0
  368. package/dist/detectors/register-voice.d.ts +14 -0
  369. package/dist/detectors/register-voice.d.ts.map +1 -0
  370. package/dist/detectors/register-voice.js +47 -0
  371. package/dist/detectors/register-voice.js.map +1 -0
  372. package/dist/detectors/register.d.ts +5 -0
  373. package/dist/detectors/register.d.ts.map +1 -1
  374. package/dist/detectors/register.js +13 -0
  375. package/dist/detectors/register.js.map +1 -1
  376. package/dist/detectors/registry/closing-cliche.d.ts +3 -0
  377. package/dist/detectors/registry/closing-cliche.d.ts.map +1 -0
  378. package/dist/detectors/registry/closing-cliche.js +3 -0
  379. package/dist/detectors/registry/closing-cliche.js.map +1 -0
  380. package/dist/detectors/registry/closing-exhortation.d.ts +3 -0
  381. package/dist/detectors/registry/closing-exhortation.d.ts.map +1 -0
  382. package/dist/detectors/registry/closing-exhortation.js +3 -0
  383. package/dist/detectors/registry/closing-exhortation.js.map +1 -0
  384. package/dist/detectors/registry/cold-open.d.ts +3 -0
  385. package/dist/detectors/registry/cold-open.d.ts.map +1 -0
  386. package/dist/detectors/registry/cold-open.js +3 -0
  387. package/dist/detectors/registry/cold-open.js.map +1 -0
  388. package/dist/detectors/registry/colon-lead-in.js +1 -1
  389. package/dist/detectors/registry/colon-lead-in.js.map +1 -1
  390. package/dist/detectors/registry/concrete-evidence.js +1 -1
  391. package/dist/detectors/registry/concrete-evidence.js.map +1 -1
  392. package/dist/detectors/registry/contraction-mix.js +1 -1
  393. package/dist/detectors/registry/contraction-mix.js.map +1 -1
  394. package/dist/detectors/registry/duplicate-definition.js +1 -1
  395. package/dist/detectors/registry/duplicate-definition.js.map +1 -1
  396. package/dist/detectors/registry/ngram-repetition.js +1 -1
  397. package/dist/detectors/registry/ngram-repetition.js.map +1 -1
  398. package/dist/detectors/registry/proper-noun-density.js +1 -1
  399. package/dist/detectors/registry/proper-noun-density.js.map +1 -1
  400. package/dist/detectors/registry/topic-predicate-distance.js +1 -1
  401. package/dist/detectors/registry/topic-predicate-distance.js.map +1 -1
  402. package/dist/detectors/registry/unprompted-denial.d.ts +3 -0
  403. package/dist/detectors/registry/unprompted-denial.d.ts.map +1 -0
  404. package/dist/detectors/registry/unprompted-denial.js +3 -0
  405. package/dist/detectors/registry/unprompted-denial.js.map +1 -0
  406. package/dist/detectors/reproduced-text.d.ts +5 -0
  407. package/dist/detectors/reproduced-text.d.ts.map +1 -0
  408. package/dist/detectors/reproduced-text.js +19 -0
  409. package/dist/detectors/reproduced-text.js.map +1 -0
  410. package/dist/detectors/request-owner.d.ts +2 -1
  411. package/dist/detectors/request-owner.d.ts.map +1 -1
  412. package/dist/detectors/request-owner.js +31 -7
  413. package/dist/detectors/request-owner.js.map +1 -1
  414. package/dist/detectors/requirement-smell.d.ts.map +1 -1
  415. package/dist/detectors/requirement-smell.js +16 -5
  416. package/dist/detectors/requirement-smell.js.map +1 -1
  417. package/dist/detectors/sentence-counts.d.ts +2 -1
  418. package/dist/detectors/sentence-counts.d.ts.map +1 -1
  419. package/dist/detectors/sentence-counts.js +23 -7
  420. package/dist/detectors/sentence-counts.js.map +1 -1
  421. package/dist/detectors/sentence-ending.d.ts +7 -1
  422. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  423. package/dist/detectors/sentence-ending.js +47 -11
  424. package/dist/detectors/sentence-ending.js.map +1 -1
  425. package/dist/detectors/sentence-length.d.ts.map +1 -1
  426. package/dist/detectors/sentence-length.js +37 -12
  427. package/dist/detectors/sentence-length.js.map +1 -1
  428. package/dist/detectors/sentence-load.d.ts +5 -3
  429. package/dist/detectors/sentence-load.d.ts.map +1 -1
  430. package/dist/detectors/sentence-load.js +3 -5
  431. package/dist/detectors/sentence-load.js.map +1 -1
  432. package/dist/detectors/sentence-parts.d.ts +11 -0
  433. package/dist/detectors/sentence-parts.d.ts.map +1 -0
  434. package/dist/detectors/sentence-parts.js +64 -0
  435. package/dist/detectors/sentence-parts.js.map +1 -0
  436. package/dist/detectors/sentence-title.d.ts +3 -0
  437. package/dist/detectors/sentence-title.d.ts.map +1 -1
  438. package/dist/detectors/sentence-title.js +10 -0
  439. package/dist/detectors/sentence-title.js.map +1 -1
  440. package/dist/detectors/signals.d.ts +0 -2
  441. package/dist/detectors/signals.d.ts.map +1 -1
  442. package/dist/detectors/signals.js +18 -167
  443. package/dist/detectors/signals.js.map +1 -1
  444. package/dist/detectors/spelling-variety.d.ts.map +1 -1
  445. package/dist/detectors/spelling-variety.js +20 -2
  446. package/dist/detectors/spelling-variety.js.map +1 -1
  447. package/dist/detectors/structure-tree.d.ts +2 -1
  448. package/dist/detectors/structure-tree.d.ts.map +1 -1
  449. package/dist/detectors/structure-tree.js +3 -8
  450. package/dist/detectors/structure-tree.js.map +1 -1
  451. package/dist/detectors/structure.d.ts +9 -1
  452. package/dist/detectors/structure.d.ts.map +1 -1
  453. package/dist/detectors/structure.js +43 -16
  454. package/dist/detectors/structure.js.map +1 -1
  455. package/dist/detectors/superlative-clause.d.ts.map +1 -1
  456. package/dist/detectors/superlative-clause.js +19 -2
  457. package/dist/detectors/superlative-clause.js.map +1 -1
  458. package/dist/detectors/superlative-context.d.ts +35 -0
  459. package/dist/detectors/superlative-context.d.ts.map +1 -0
  460. package/dist/detectors/superlative-context.js +71 -0
  461. package/dist/detectors/superlative-context.js.map +1 -0
  462. package/dist/detectors/superlative-scope.d.ts +6 -2
  463. package/dist/detectors/superlative-scope.d.ts.map +1 -1
  464. package/dist/detectors/superlative-scope.js +20 -6
  465. package/dist/detectors/superlative-scope.js.map +1 -1
  466. package/dist/detectors/team.d.ts +0 -1
  467. package/dist/detectors/team.d.ts.map +1 -1
  468. package/dist/detectors/team.js +0 -46
  469. package/dist/detectors/team.js.map +1 -1
  470. package/dist/detectors/titled-code-citation.d.ts +12 -0
  471. package/dist/detectors/titled-code-citation.d.ts.map +1 -0
  472. package/dist/detectors/titled-code-citation.js +11 -0
  473. package/dist/detectors/titled-code-citation.js.map +1 -0
  474. package/dist/detectors/titled-run.d.ts +8 -1
  475. package/dist/detectors/titled-run.d.ts.map +1 -1
  476. package/dist/detectors/titled-run.js +14 -4
  477. package/dist/detectors/titled-run.js.map +1 -1
  478. package/dist/detectors/token-shape.d.ts.map +1 -1
  479. package/dist/detectors/token-shape.js +33 -16
  480. package/dist/detectors/token-shape.js.map +1 -1
  481. package/dist/detectors/topic-predicate-distance.d.ts +4 -0
  482. package/dist/detectors/topic-predicate-distance.d.ts.map +1 -0
  483. package/dist/detectors/topic-predicate-distance.js +22 -0
  484. package/dist/detectors/topic-predicate-distance.js.map +1 -0
  485. package/dist/detectors/undefined-term.d.ts +5 -0
  486. package/dist/detectors/undefined-term.d.ts.map +1 -1
  487. package/dist/detectors/undefined-term.js +22 -1
  488. package/dist/detectors/undefined-term.js.map +1 -1
  489. package/dist/detectors/unfilled-placeholder.d.ts.map +1 -1
  490. package/dist/detectors/unfilled-placeholder.js +15 -1
  491. package/dist/detectors/unfilled-placeholder.js.map +1 -1
  492. package/dist/detectors/unknown-word-context.d.ts +35 -0
  493. package/dist/detectors/unknown-word-context.d.ts.map +1 -0
  494. package/dist/detectors/unknown-word-context.js +100 -0
  495. package/dist/detectors/unknown-word-context.js.map +1 -0
  496. package/dist/detectors/unknown-word.d.ts +0 -5
  497. package/dist/detectors/unknown-word.d.ts.map +1 -1
  498. package/dist/detectors/unknown-word.js +17 -19
  499. package/dist/detectors/unknown-word.js.map +1 -1
  500. package/dist/detectors/unprompted-denial.d.ts +25 -0
  501. package/dist/detectors/unprompted-denial.d.ts.map +1 -0
  502. package/dist/detectors/unprompted-denial.js +100 -0
  503. package/dist/detectors/unprompted-denial.js.map +1 -0
  504. package/dist/document-sections.d.ts.map +1 -1
  505. package/dist/document-sections.js +3 -1
  506. package/dist/document-sections.js.map +1 -1
  507. package/dist/fix-plan/all-signs.d.ts +17 -0
  508. package/dist/fix-plan/all-signs.d.ts.map +1 -0
  509. package/dist/fix-plan/all-signs.js +26 -0
  510. package/dist/fix-plan/all-signs.js.map +1 -0
  511. package/dist/fix-plan/plan.d.ts +31 -0
  512. package/dist/fix-plan/plan.d.ts.map +1 -1
  513. package/dist/fix-plan/plan.js +23 -3
  514. package/dist/fix-plan/plan.js.map +1 -1
  515. package/dist/fix-plan/render.d.ts.map +1 -1
  516. package/dist/fix-plan/render.js +31 -2
  517. package/dist/fix-plan/render.js.map +1 -1
  518. package/dist/fix-plan/risen.d.ts +10 -0
  519. package/dist/fix-plan/risen.d.ts.map +1 -0
  520. package/dist/fix-plan/risen.js +7 -0
  521. package/dist/fix-plan/risen.js.map +1 -0
  522. package/dist/fix-plan/text.d.ts +15 -0
  523. package/dist/fix-plan/text.d.ts.map +1 -1
  524. package/dist/fix-plan/text.js +38 -2
  525. package/dist/fix-plan/text.js.map +1 -1
  526. package/dist/heading-numbering.d.ts +2 -1
  527. package/dist/heading-numbering.d.ts.map +1 -1
  528. package/dist/heading-numbering.js +40 -10
  529. package/dist/heading-numbering.js.map +1 -1
  530. package/dist/html/html-site-chrome.d.ts.map +1 -1
  531. package/dist/html/html-site-chrome.js +7 -2
  532. package/dist/html/html-site-chrome.js.map +1 -1
  533. package/dist/latin-spacing-source.d.ts +12 -0
  534. package/dist/latin-spacing-source.d.ts.map +1 -0
  535. package/dist/latin-spacing-source.js +25 -0
  536. package/dist/latin-spacing-source.js.map +1 -0
  537. package/dist/law-title.d.ts +7 -0
  538. package/dist/law-title.d.ts.map +1 -0
  539. package/dist/law-title.js +29 -0
  540. package/dist/law-title.js.map +1 -0
  541. package/dist/name-ending-run.d.ts +11 -0
  542. package/dist/name-ending-run.d.ts.map +1 -0
  543. package/dist/name-ending-run.js +37 -0
  544. package/dist/name-ending-run.js.map +1 -0
  545. package/dist/name-separator.d.ts.map +1 -1
  546. package/dist/name-separator.js +4 -1
  547. package/dist/name-separator.js.map +1 -1
  548. package/dist/name-title-slip.d.ts +11 -0
  549. package/dist/name-title-slip.d.ts.map +1 -0
  550. package/dist/name-title-slip.js +51 -0
  551. package/dist/name-title-slip.js.map +1 -0
  552. package/dist/name-variant-shapes.d.ts +14 -0
  553. package/dist/name-variant-shapes.d.ts.map +1 -0
  554. package/dist/name-variant-shapes.js +43 -0
  555. package/dist/name-variant-shapes.js.map +1 -0
  556. package/dist/name-word-use.d.ts +5 -0
  557. package/dist/name-word-use.d.ts.map +1 -0
  558. package/dist/name-word-use.js +12 -0
  559. package/dist/name-word-use.js.map +1 -0
  560. package/dist/opening-passage.d.ts +8 -0
  561. package/dist/opening-passage.d.ts.map +1 -0
  562. package/dist/opening-passage.js +24 -0
  563. package/dist/opening-passage.js.map +1 -0
  564. package/dist/paragraph-length.d.ts +14 -0
  565. package/dist/paragraph-length.d.ts.map +1 -1
  566. package/dist/paragraph-length.js +25 -0
  567. package/dist/paragraph-length.js.map +1 -1
  568. package/dist/paragraph-runs.d.ts +2 -2
  569. package/dist/paragraph-runs.d.ts.map +1 -1
  570. package/dist/paragraph-runs.js +65 -14
  571. package/dist/paragraph-runs.js.map +1 -1
  572. package/dist/plugin.d.ts +2 -0
  573. package/dist/plugin.d.ts.map +1 -1
  574. package/dist/quote-echo.d.ts +6 -0
  575. package/dist/quote-echo.d.ts.map +1 -0
  576. package/dist/quote-echo.js +14 -0
  577. package/dist/quote-echo.js.map +1 -0
  578. package/dist/quote-gloss.d.ts +4 -0
  579. package/dist/quote-gloss.d.ts.map +1 -0
  580. package/dist/quote-gloss.js +7 -0
  581. package/dist/quote-gloss.js.map +1 -0
  582. package/dist/quoted-spelling.d.ts +17 -0
  583. package/dist/quoted-spelling.d.ts.map +1 -0
  584. package/dist/quoted-spelling.js +27 -0
  585. package/dist/quoted-spelling.js.map +1 -0
  586. package/dist/render/semantic.d.ts +1 -1
  587. package/dist/render/semantic.d.ts.map +1 -1
  588. package/dist/render/semantic.js +2 -1
  589. package/dist/render/semantic.js.map +1 -1
  590. package/dist/rule-of-three.d.ts +19 -0
  591. package/dist/rule-of-three.d.ts.map +1 -0
  592. package/dist/rule-of-three.js +33 -0
  593. package/dist/rule-of-three.js.map +1 -0
  594. package/dist/run-semantic.d.ts.map +1 -1
  595. package/dist/run-semantic.js +2 -2
  596. package/dist/run-semantic.js.map +1 -1
  597. package/dist/section-levels.d.ts +18 -0
  598. package/dist/section-levels.d.ts.map +1 -0
  599. package/dist/section-levels.js +80 -0
  600. package/dist/section-levels.js.map +1 -0
  601. package/dist/semantic.d.ts +2 -0
  602. package/dist/semantic.d.ts.map +1 -1
  603. package/dist/semantic.js +15 -2
  604. package/dist/semantic.js.map +1 -1
  605. package/dist/sentence-load.d.ts +2 -1
  606. package/dist/sentence-load.d.ts.map +1 -1
  607. package/dist/sentence-load.js +4 -2
  608. package/dist/sentence-load.js.map +1 -1
  609. package/dist/set-phrase-particles.d.ts +4 -0
  610. package/dist/set-phrase-particles.d.ts.map +1 -0
  611. package/dist/set-phrase-particles.js +26 -0
  612. package/dist/set-phrase-particles.js.map +1 -0
  613. package/dist/spelling.d.ts +11 -0
  614. package/dist/spelling.d.ts.map +1 -1
  615. package/dist/spelling.js +19 -5
  616. package/dist/spelling.js.map +1 -1
  617. package/dist/structure/alternative-clause.d.ts +7 -0
  618. package/dist/structure/alternative-clause.d.ts.map +1 -1
  619. package/dist/structure/alternative-clause.js +23 -8
  620. package/dist/structure/alternative-clause.js.map +1 -1
  621. package/dist/structure/cited-document-section.d.ts +2 -0
  622. package/dist/structure/cited-document-section.d.ts.map +1 -1
  623. package/dist/structure/cited-document-section.js +23 -1
  624. package/dist/structure/cited-document-section.js.map +1 -1
  625. package/dist/structure/issues.d.ts +4 -2
  626. package/dist/structure/issues.d.ts.map +1 -1
  627. package/dist/structure/issues.js +17 -9
  628. package/dist/structure/issues.js.map +1 -1
  629. package/dist/structure/numbering.d.ts +10 -1
  630. package/dist/structure/numbering.d.ts.map +1 -1
  631. package/dist/structure/numbering.js +41 -4
  632. package/dist/structure/numbering.js.map +1 -1
  633. package/dist/structure/unread-label.d.ts +13 -0
  634. package/dist/structure/unread-label.d.ts.map +1 -0
  635. package/dist/structure/unread-label.js +70 -0
  636. package/dist/structure/unread-label.js.map +1 -0
  637. package/dist/structure-shape/template-outline.d.ts +11 -0
  638. package/dist/structure-shape/template-outline.d.ts.map +1 -0
  639. package/dist/structure-shape/template-outline.js +25 -0
  640. package/dist/structure-shape/template-outline.js.map +1 -0
  641. package/dist/title-case-name.d.ts +12 -0
  642. package/dist/title-case-name.d.ts.map +1 -0
  643. package/dist/title-case-name.js +37 -0
  644. package/dist/title-case-name.js.map +1 -0
  645. package/dist/topic-clause.d.ts +6 -1
  646. package/dist/topic-clause.d.ts.map +1 -1
  647. package/dist/topic-clause.js +90 -3
  648. package/dist/topic-clause.js.map +1 -1
  649. package/dist/word-use.d.ts +12 -4
  650. package/dist/word-use.d.ts.map +1 -1
  651. package/dist/word-use.js +47 -5
  652. package/dist/word-use.js.map +1 -1
  653. package/package.json +4 -3
  654. package/rules/ai-generated-composite.yaml +12 -3
  655. package/rules/ai-structure.yaml +7 -6
  656. package/rules/ai-tell.yaml +10 -6
  657. package/rules/all-caps-shouting.yaml +2 -2
  658. package/rules/bold-emphasis.yaml +5 -4
  659. package/rules/bold-label-list.yaml +6 -6
  660. package/rules/closing-cliche.yaml +4 -5
  661. package/rules/closing-exhortation.yaml +74 -0
  662. package/rules/cold-open.yaml +95 -0
  663. package/rules/colon-lead-in.yaml +68 -10
  664. package/rules/comparative-without-baseline.yaml +2 -2
  665. package/rules/concrete-evidence-density.yaml +2 -2
  666. package/rules/contraction-consistency.yaml +2 -2
  667. package/rules/contrast-framing.yaml +16 -13
  668. package/rules/dangling-reference.yaml +2 -2
  669. package/rules/date-format-consistency.yaml +2 -2
  670. package/rules/duplicate-definition.yaml +2 -2
  671. package/rules/duplicate-heading.yaml +5 -2
  672. package/rules/email-greeting-closing.yaml +2 -2
  673. package/rules/email-stock-courtesy.yaml +62 -0
  674. package/rules/fullwidth-alnum-consistency.yaml +2 -2
  675. package/rules/generic-opening.yaml +63 -0
  676. package/rules/heading-level-skip.yaml +2 -2
  677. package/rules/heading-numbering-mix.yaml +20 -20
  678. package/rules/honesty-marker.yaml +84 -0
  679. package/rules/hyphen-as-dash.yaml +2 -2
  680. package/rules/kutoten-consistency.yaml +4 -4
  681. package/rules/latin-spacing.yaml +6 -4
  682. package/rules/list-item-form-mix.yaml +2 -2
  683. package/rules/max-kanji-continuous.yaml +7 -3
  684. package/rules/max-paragraph-length.yaml +2 -2
  685. package/rules/max-sentence-length.yaml +6 -2
  686. package/rules/missing-final-period.yaml +2 -2
  687. package/rules/name-variant.yaml +5 -2
  688. package/rules/ngram-repetition.yaml +2 -2
  689. package/rules/no-doubled-joshi.yaml +2 -2
  690. package/rules/no-em-dash.yaml +2 -2
  691. package/rules/no-mixed-desumasu.yaml +16 -3
  692. package/rules/nominalization.yaml +1 -1
  693. package/rules/numbering-gap.yaml +2 -2
  694. package/rules/one-sentence-paragraph-run.yaml +2 -2
  695. package/rules/orthographic-variant.yaml +2 -2
  696. package/rules/over-general-claim.yaml +2 -2
  697. package/rules/oxford-comma-consistency.yaml +15 -3
  698. package/rules/proper-noun-density.yaml +14 -7
  699. package/rules/quote-without-source.yaml +2 -2
  700. package/rules/request-without-deadline.yaml +2 -2
  701. package/rules/requirement-smell.yaml +2 -2
  702. package/rules/rule-of-three.yaml +3 -3
  703. package/rules/section-length-uniformity.yaml +2 -2
  704. package/rules/spelling-consistency.yaml +4 -4
  705. package/rules/teki-overuse.yaml +2 -2
  706. package/rules/topic-predicate-distance.yaml +3 -2
  707. package/rules/undefined-acronym.yaml +9 -2
  708. package/rules/undefined-term.yaml +2 -2
  709. package/rules/unfilled-placeholder.yaml +2 -2
  710. package/rules/unknown-word.yaml +2 -2
  711. package/rules/unprompted-denial.yaml +88 -0
  712. package/rules/unqualified-superlative.yaml +8 -2
  713. package/skills/chaff/SKILL.md +39 -6
  714. package/src/acronym-expansion.ts +57 -0
  715. package/src/ai-score/human-shares.ts +54 -12
  716. package/src/ai-score/of-document.ts +5 -2
  717. package/src/alternative-words.ts +15 -0
  718. package/src/body-section.ts +11 -2
  719. package/src/capitals-with-small.ts +16 -0
  720. package/src/checks.ts +32 -1
  721. package/src/cli-args.ts +1 -1
  722. package/src/cli-text.ts +4 -0
  723. package/src/closing-code.ts +21 -0
  724. package/src/commands/fix-plan.ts +72 -5
  725. package/src/commands/test.ts +18 -2
  726. package/src/date-format.ts +54 -7
  727. package/src/detectors/acronym-context.ts +23 -4
  728. package/src/detectors/acronym-expansion.ts +26 -0
  729. package/src/detectors/acronym-gloss.ts +123 -0
  730. package/src/detectors/acronym-mention.ts +17 -0
  731. package/src/detectors/acronym-name.ts +40 -3
  732. package/src/detectors/acronym-series.ts +27 -0
  733. package/src/detectors/ai-phrasing.ts +18 -17
  734. package/src/detectors/ai-structure.ts +23 -6
  735. package/src/detectors/alnum-number.ts +8 -3
  736. package/src/detectors/bare-comparative.ts +41 -13
  737. package/src/detectors/blank-runs.ts +30 -0
  738. package/src/detectors/bold-emphasis-form.ts +58 -0
  739. package/src/detectors/bold-emphasis.ts +16 -17
  740. package/src/detectors/bold-label.ts +22 -6
  741. package/src/detectors/capitalised-term.ts +36 -9
  742. package/src/detectors/caps-caption.ts +24 -2
  743. package/src/detectors/char-shape.ts +118 -29
  744. package/src/detectors/chat-log-line.ts +17 -0
  745. package/src/detectors/citation-string.ts +93 -0
  746. package/src/detectors/closing-cliche.ts +74 -0
  747. package/src/detectors/closing-exhortation.ts +74 -0
  748. package/src/detectors/cold-open.ts +145 -0
  749. package/src/detectors/comparative-context.ts +74 -0
  750. package/src/detectors/concrete-evidence-density.ts +99 -0
  751. package/src/detectors/concrete-evidence.ts +40 -0
  752. package/src/detectors/contraction-emphasis.ts +46 -0
  753. package/src/detectors/contraction-mention.ts +52 -6
  754. package/src/detectors/contraction-mix.ts +94 -0
  755. package/src/detectors/contrast-frame.ts +65 -7
  756. package/src/detectors/coordinate-adjective.ts +4 -2
  757. package/src/detectors/date-format.ts +18 -2
  758. package/src/detectors/duplicate-definition.ts +21 -0
  759. package/src/detectors/duplicate-heading.ts +44 -15
  760. package/src/detectors/email-frame-words.ts +39 -0
  761. package/src/detectors/email-letter.ts +15 -20
  762. package/src/detectors/final-period-captions.ts +78 -0
  763. package/src/detectors/fullwidth-alnum.ts +24 -4
  764. package/src/detectors/gram-furniture.ts +87 -1
  765. package/src/detectors/gram-openers.ts +71 -0
  766. package/src/detectors/gram-predicate.ts +49 -6
  767. package/src/detectors/gram-repetition.ts +199 -0
  768. package/src/detectors/heading-level-skip.ts +31 -1
  769. package/src/detectors/heading-numbering.ts +2 -2
  770. package/src/detectors/heading-sentences.ts +36 -0
  771. package/src/detectors/hyphen-copied-text.ts +65 -0
  772. package/src/detectors/kanji-name-edge.ts +31 -0
  773. package/src/detectors/kanji-run-pieces.ts +26 -0
  774. package/src/detectors/kutoten-consistency.ts +24 -4
  775. package/src/detectors/lead-in-dash.ts +11 -0
  776. package/src/detectors/letter-joined-name.ts +14 -0
  777. package/src/detectors/lexicon.ts +20 -63
  778. package/src/detectors/list-item.ts +37 -1
  779. package/src/detectors/list-items.ts +4 -1
  780. package/src/detectors/list-joint.ts +44 -0
  781. package/src/detectors/list-layout.ts +39 -0
  782. package/src/detectors/list-lead-in.ts +88 -7
  783. package/src/detectors/list-parallel.ts +119 -13
  784. package/src/detectors/list-run.ts +86 -0
  785. package/src/detectors/list-sentence.ts +11 -0
  786. package/src/detectors/mark-shape.ts +12 -7
  787. package/src/detectors/missing-final-period.ts +9 -1
  788. package/src/detectors/name-run.ts +2 -1
  789. package/src/detectors/name-variant-two-things.ts +136 -0
  790. package/src/detectors/name-variant.ts +14 -19
  791. package/src/detectors/numbering-readings.ts +10 -2
  792. package/src/detectors/open-end-anaphor.ts +31 -0
  793. package/src/detectors/open-end-lead.ts +46 -0
  794. package/src/detectors/open-end-scope.ts +8 -1
  795. package/src/detectors/ordinal-run-gaps.ts +1 -1
  796. package/src/detectors/organisation-run.ts +26 -2
  797. package/src/detectors/orthographic-variant-open.ts +124 -0
  798. package/src/detectors/orthographic-variant.ts +82 -82
  799. package/src/detectors/orthography.ts +20 -7
  800. package/src/detectors/over-general-claim.ts +106 -5
  801. package/src/detectors/oxford-comma.ts +68 -28
  802. package/src/detectors/particle-run-names.ts +17 -0
  803. package/src/detectors/placeholder-text.ts +21 -4
  804. package/src/detectors/proper-noun-density.ts +109 -0
  805. package/src/detectors/quote-without-source.ts +52 -10
  806. package/src/detectors/quoted-excerpt.ts +68 -0
  807. package/src/detectors/reference-entry.ts +42 -0
  808. package/src/detectors/register-neutral-shape.ts +26 -6
  809. package/src/detectors/register-separate-part.ts +42 -0
  810. package/src/detectors/register-set-apart.ts +124 -0
  811. package/src/detectors/register-voice.ts +63 -0
  812. package/src/detectors/register.ts +15 -0
  813. package/src/detectors/registry/closing-cliche.ts +4 -0
  814. package/src/detectors/registry/closing-exhortation.ts +4 -0
  815. package/src/detectors/registry/cold-open.ts +4 -0
  816. package/src/detectors/registry/colon-lead-in.ts +1 -1
  817. package/src/detectors/registry/concrete-evidence.ts +1 -1
  818. package/src/detectors/registry/contraction-mix.ts +1 -1
  819. package/src/detectors/registry/duplicate-definition.ts +1 -1
  820. package/src/detectors/registry/ngram-repetition.ts +1 -1
  821. package/src/detectors/registry/proper-noun-density.ts +1 -1
  822. package/src/detectors/registry/topic-predicate-distance.ts +1 -1
  823. package/src/detectors/registry/unprompted-denial.ts +4 -0
  824. package/src/detectors/reproduced-text.ts +33 -0
  825. package/src/detectors/request-owner.ts +31 -8
  826. package/src/detectors/requirement-smell.ts +21 -5
  827. package/src/detectors/sentence-counts.ts +27 -7
  828. package/src/detectors/sentence-ending.ts +66 -14
  829. package/src/detectors/sentence-length.ts +43 -11
  830. package/src/detectors/sentence-load.ts +3 -6
  831. package/src/detectors/sentence-parts.ts +73 -0
  832. package/src/detectors/sentence-title.ts +14 -0
  833. package/src/detectors/signals.ts +20 -202
  834. package/src/detectors/spelling-variety.ts +26 -2
  835. package/src/detectors/structure-tree.ts +5 -9
  836. package/src/detectors/structure.ts +47 -19
  837. package/src/detectors/superlative-clause.ts +21 -2
  838. package/src/detectors/superlative-context.ts +99 -0
  839. package/src/detectors/superlative-scope.ts +27 -9
  840. package/src/detectors/team.ts +1 -50
  841. package/src/detectors/titled-code-citation.ts +19 -0
  842. package/src/detectors/titled-run.ts +22 -5
  843. package/src/detectors/token-shape.ts +40 -18
  844. package/src/detectors/topic-predicate-distance.ts +25 -0
  845. package/src/detectors/undefined-term.ts +26 -1
  846. package/src/detectors/unfilled-placeholder.ts +20 -2
  847. package/src/detectors/unknown-word-context.ts +129 -0
  848. package/src/detectors/unknown-word.ts +29 -20
  849. package/src/detectors/unprompted-denial.ts +133 -0
  850. package/src/document-sections.ts +3 -1
  851. package/src/fix-plan/all-signs.ts +35 -0
  852. package/src/fix-plan/plan.ts +50 -3
  853. package/src/fix-plan/render.ts +41 -3
  854. package/src/fix-plan/risen.ts +13 -0
  855. package/src/fix-plan/text.ts +56 -2
  856. package/src/heading-numbering.ts +44 -10
  857. package/src/html/html-site-chrome.ts +9 -2
  858. package/src/latin-spacing-source.ts +33 -0
  859. package/src/law-title.ts +38 -0
  860. package/src/name-ending-run.ts +49 -0
  861. package/src/name-separator.ts +4 -1
  862. package/src/name-title-slip.ts +59 -0
  863. package/src/name-variant-shapes.ts +58 -0
  864. package/src/name-word-use.ts +17 -0
  865. package/src/opening-passage.ts +31 -0
  866. package/src/paragraph-length.ts +31 -0
  867. package/src/paragraph-runs.ts +71 -13
  868. package/src/plugin.ts +2 -0
  869. package/src/quote-echo.ts +18 -0
  870. package/src/quote-gloss.ts +11 -0
  871. package/src/quoted-spelling.ts +48 -0
  872. package/src/render/semantic.ts +2 -2
  873. package/src/rule-of-three.ts +50 -0
  874. package/src/run-semantic.ts +2 -2
  875. package/src/section-levels.ts +98 -0
  876. package/src/semantic.ts +16 -3
  877. package/src/sentence-load.ts +5 -3
  878. package/src/set-phrase-particles.ts +32 -0
  879. package/src/spelling.ts +37 -7
  880. package/src/structure/alternative-clause.ts +32 -7
  881. package/src/structure/cited-document-section.ts +24 -1
  882. package/src/structure/issues.ts +29 -10
  883. package/src/structure/numbering.ts +50 -3
  884. package/src/structure/unread-label.ts +74 -0
  885. package/src/structure-shape/template-outline.ts +34 -0
  886. package/src/title-case-name.ts +55 -0
  887. package/src/topic-clause.ts +110 -5
  888. package/src/word-use.ts +57 -6
  889. package/dist/legal-address.d.ts +0 -2
  890. package/dist/legal-address.d.ts.map +0 -1
  891. package/dist/legal-address.js +0 -16
  892. package/dist/legal-address.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-echo.js","sourceRoot":"","sources":["../src/quote-echo.ts"],"names":[],"mappings":"AAEA,0GAA0G;AAC1G,qGAAqG;AAErG,0HAA0H;AAC1H,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,4EAA4E;AAC5E,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,KAAsB,EAAY,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtI,4HAA4H;AAC5H,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,EAAE,KAAK,EAAE,GAAG,EAAQ,EAAE,UAA6B,EAAW,EAAE;IAC5G,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;IACpG,OAAO,MAAM,CAAC,MAAM,IAAI,eAAe,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACxG,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Span } from "./plugin.ts";
2
+ /** Where each bracket written straight after a closing quotation mark lies in text, the brackets included. */
3
+ export declare const quoteGlossSpans: (text: string) => Span[];
4
+ //# sourceMappingURL=quote-gloss.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-gloss.d.ts","sourceRoot":"","sources":["../src/quote-gloss.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKxC,8GAA8G;AAC9G,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,IAAI,EACqE,CAAC"}
@@ -0,0 +1,7 @@
1
+ // A bracket written straight after a closing quotation mark: the quotation's reading or translation (「天子有道」(天子に道有らば)).
2
+ // It renders the quoted text and keeps the quoted text's words and spelling, not the writer's. Pure.
3
+ /** A Japanese quotation's closing mark, then a bracket that closes on the same text. */
4
+ const GLOSS_AFTER_QUOTE = /[」』][((][^()()]*[))]/gu;
5
+ /** Where each bracket written straight after a closing quotation mark lies in text, the brackets included. */
6
+ export const quoteGlossSpans = (text) => [...text.matchAll(GLOSS_AFTER_QUOTE)].map((match) => ({ start: match.index + 1, end: match.index + match[0].length }));
7
+ //# sourceMappingURL=quote-gloss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-gloss.js","sourceRoot":"","sources":["../src/quote-gloss.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,qGAAqG;AAIrG,wFAAwF;AACxF,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAEnD,8GAA8G;AAC9G,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAU,EAAE,CACtD,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /** Where a word was taken from: a capitalised name, or a cited work. */
2
+ export type Quoted = "name" | "cited";
3
+ /** A word, and for a word in a capitalised run, the run as written (Twenty-Nine Palms Band of Mission Indians), quoted or not. */
4
+ type QuotedWord = {
5
+ readonly key: string;
6
+ readonly spelling: string;
7
+ readonly quoted?: Quoted | undefined;
8
+ readonly name?: string | undefined;
9
+ };
10
+ /**
11
+ * The words without those taken from elsewhere where their way is their own: in a group of one key whose spellings differ only
12
+ * in hyphens, a cited word and a word of a name the document writes one way only; and a cited ordinary word in small letters. spelling is the word with the first letter of each part
13
+ * in small letters; isWord says whether the language's dictionary has a word.
14
+ */
15
+ export declare const withoutQuotedSpellings: <Word extends QuotedWord>(words: readonly Word[], isWord: (word: string) => boolean) => Word[];
16
+ export {};
17
+ //# sourceMappingURL=quoted-spelling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quoted-spelling.d.ts","sourceRoot":"","sources":["../src/quoted-spelling.ts"],"names":[],"mappings":"AAMA,wEAAwE;AACxE,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtC,kIAAkI;AAClI,KAAK,UAAU,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAkBhJ;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,IAAI,SAAS,UAAU,EAAE,OAAO,SAAS,IAAI,EAAE,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,KAAG,IAAI,EAc/H,CAAC"}
@@ -0,0 +1,27 @@
1
+ // Words a document takes from elsewhere: a capitalised name (the Interagency Group) and a cited work (a reference list's entry,
2
+ // a citation written as a sentence). They keep the hyphens their owner gave them, unless the document writes the same name two
3
+ // ways (Co-working Space and Coworking Space), and a cited title keeps its ordinary words
4
+ // (factors beside the dataset FACTors). A capital the citing lost (arxiv for arXiv, ai-generated for AI-generated) is still
5
+ // the document's slip and is still compared. Pure.
6
+ /** The spelling without its hyphens: two spellings equal this way differ only in hyphenation (Interagency, inter-agency). */
7
+ const closedUp = (spelling) => spelling.replaceAll("-", "");
8
+ /** A name without its case and hyphens: two names equal this way are one name (Co-working Space, Coworking Space). */
9
+ const nameKeyOf = (name) => closedUp(name.toLowerCase());
10
+ /** The ways each group of words is written, grouped by keyOf and written as spellingOf gives. */
11
+ const spellingsBy = (words, keyOf, spellingOf) => words.reduce((groups, word) => groups.set(keyOf(word), (groups.get(keyOf(word)) ?? new Set()).add(spellingOf(word))), new Map());
12
+ const SMALL_LETTERS_ONLY = /^[\p{Ll}\d-]+$/u;
13
+ /** A cited word in small letters that the dictionary knows (factors): the title's own word, not a name written small. */
14
+ const isOrdinaryCitedWord = (word, isWord) => word.quoted === "cited" && SMALL_LETTERS_ONLY.test(word.spelling) && isWord(word.spelling);
15
+ /**
16
+ * The words without those taken from elsewhere where their way is their own: in a group of one key whose spellings differ only
17
+ * in hyphens, a cited word and a word of a name the document writes one way only; and a cited ordinary word in small letters. spelling is the word with the first letter of each part
18
+ * in small letters; isWord says whether the language's dictionary has a word.
19
+ */
20
+ export const withoutQuotedSpellings = (words, isWord) => {
21
+ const closed = spellingsBy(words, (word) => word.key, (word) => closedUp(word.spelling));
22
+ const names = spellingsBy(words.filter((word) => word.name !== undefined), (word) => nameKeyOf(word.name ?? ""), (word) => word.name ?? "");
23
+ const differsInHyphensOnly = (word) => closed.get(word.key)?.size === 1;
24
+ const isOwnWay = (word) => word.quoted === "cited" || names.get(nameKeyOf(word.name ?? ""))?.size === 1;
25
+ return words.filter((word) => word.quoted === undefined || !((differsInHyphensOnly(word) && isOwnWay(word)) || isOrdinaryCitedWord(word, isWord)));
26
+ };
27
+ //# sourceMappingURL=quoted-spelling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quoted-spelling.js","sourceRoot":"","sources":["../src/quoted-spelling.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAChI,+HAA+H;AAC/H,0FAA0F;AAC1F,4HAA4H;AAC5H,mDAAmD;AAQnD,6HAA6H;AAC7H,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAE5E,sHAAsH;AACtH,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AAEzE,iGAAiG;AACjG,MAAM,WAAW,GAAG,CAAO,KAAsB,EAAE,KAA6B,EAAE,UAAkC,EAA4B,EAAE,CAChJ,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,GAAG,EAAU,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,EAAuB,CAAC,CAAC;AAEhK,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C,yHAAyH;AACzH,MAAM,mBAAmB,GAAG,CAAC,IAAgB,EAAE,MAAiC,EAAW,EAAE,CAC3F,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAE7F;;;;GAIG;AACH,MAAM,CAAC,MAAM,s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3
3
  import type { Job as Plan, SemanticResult } from "../run-semantic.ts";
4
4
  /** The banner over a file's machine findings, in the file's language. */
5
5
  export declare const machineBanner: (language: string) => readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/render/semantic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,GAAG,IAAI,IAAI,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAgFtE,yEAAyE;AACzE,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,KAAG,SAAS,MAAM,EAAgD,CAAC;AAiEjH,eAAO,MAAM,cAAc,GAAI,QAAQ,cAAc,EAAE,OAAO,SAAS,cAAc,EAAE,EAAE,QAAQ,SAAS,SAAS,EAAE,EAAE,UAAU,MAAM,KAAG,MAAM,EAO/I,CAAC;AAgBF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,MAAM,SAAS,IAAI,EAAE,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM,KAAG,MAAM,EAO3G,CAAC"}
1
+ {"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/render/semantic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,KAAK,EAAE,GAAG,IAAI,IAAI,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAgFtE,yEAAyE;AACzE,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,KAAG,SAAS,MAAM,EAAgD,CAAC;AAiEjH,eAAO,MAAM,cAAc,GAAI,QAAQ,cAAc,EAAE,OAAO,SAAS,cAAc,EAAE,EAAE,QAAQ,SAAS,SAAS,EAAE,EAAE,UAAU,MAAM,KAAG,MAAM,EAO/I,CAAC;AAgBF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,MAAM,SAAS,IAAI,EAAE,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM,KAAG,MAAM,EAO3G,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { checkAppliesTo } from "../checks.js";
1
2
  import { uiLanguageOf } from "../ui.js";
2
3
  import { MARK, fill, localized } from "./text.js";
3
4
  import { counted, formFor } from "./plural.js";
@@ -82,7 +83,7 @@ const nameOf = (rule, rules, checks, language) => {
82
83
  const built = rules.find((entry) => entry.id === rule);
83
84
  if (built !== undefined)
84
85
  return { name: localized(built.name, language), howToFix: localized(built.how_to_fix, language) };
85
- const user = checks.find((entry) => entry.id === rule);
86
+ const user = checks.find((entry) => entry.id === rule && checkAppliesTo(entry, language));
86
87
  return { name: user?.name ?? rule, howToFix: user?.how_to_fix ?? "" };
87
88
  };
88
89
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"semantic.js","sourceRoot":"","sources":["../../src/render/semantic.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAA+B,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,IAAI,GAAG,EAAE,CAAC;AAEhB,MAAM,IAAI,GAqBL;IACH,EAAE,EAAE;QACF,aAAa,EAAE,CAAC,EAAE,EAAE,eAAe,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE,4BAA4B,EAAE,EAAE,CAAC;QAC7F,OAAO,EAAE,gBAAgB,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE;QAChD,MAAM,EAAE,CAAC,kCAAkC,EAAE,mCAAmC,CAAC;QACjF,IAAI,EAAE,CAAC,KAAK,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G,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1H,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/I,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;AAClF,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { BulletList } from "./plugin.ts";
2
+ /**
3
+ * rule-of-three の数え方。箇条書きのうち、ちょうど 3 項目のものがどれだけあるか。
4
+ * すぐ下の行が「など」「etc.」で始まる箇条書きは、書いた 3 つより多くあると書き手が言っている。ちょうど 3 項目とは数えない。
5
+ * 箇条書きが少ないと、1 つで割合が大きく動く(4 つなら 25 ポイント)。そのときは全部が 3 項目のときだけ報告する。
6
+ */
7
+ export type ThreeShare = {
8
+ readonly count: number;
9
+ readonly total: number;
10
+ readonly share: number;
11
+ readonly first: BulletList;
12
+ };
13
+ /** これより少ない箇条書きでは、割合では判断せず、全部が 3 項目のときだけ報告する。 */
14
+ export declare const MIN_LISTS_FOR_SHARE = 5;
15
+ /** 箇条書きのすぐ下の行が、並びが続くことを言う語(など、etc.)で始まる。 */
16
+ export declare const continuesBeyond: (source: string, list: BulletList, openWords: readonly string[]) => boolean;
17
+ /** 報告するときの数。報告しないときは undefined。 */
18
+ export declare const threeShare: (source: string, lists: readonly BulletList[], openWords: readonly string[], limit: number) => ThreeShare | undefined;
19
+ //# sourceMappingURL=rule-of-three.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-of-three.d.ts","sourceRoot":"","sources":["../src/rule-of-three.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAAC;AAMhI,gDAAgD;AAChD,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAkBrC,4CAA4C;AAC5C,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,EAAE,MAAM,UAAU,EAAE,WAAW,SAAS,MAAM,EAAE,KAAG,OAGhG,CAAC;AAKF,mCAAmC;AACnC,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,EAAE,OAAO,SAAS,UAAU,EAAE,EAAE,WAAW,SAAS,MAAM,EAAE,EAAE,OAAO,MAAM,KAAG,UAAU,GAAG,SAOnI,CAAC"}
@@ -0,0 +1,33 @@
1
+ const PERCENT = 100;
2
+ const THREE = 3;
3
+ /** これより少ない箇条書きは測らない。 */
4
+ const MIN_LISTS = 3;
5
+ /** これより少ない箇条書きでは、割合では判断せず、全部が 3 項目のときだけ報告する。 */
6
+ export const MIN_LISTS_FOR_SHARE = 5;
7
+ const LINE_BREAK = /\r?\n/u;
8
+ /** `from` より後ろで、最初の空でない行。 */
9
+ const nextWrittenLine = (source, from) => source
10
+ .slice(from)
11
+ .split(LINE_BREAK)
12
+ .find((line) => line.trim() !== "")
13
+ ?.trim() ?? "";
14
+ const LATIN_LETTER = /[A-Za-z]/u;
15
+ /** 英語の語は語の切れ目まで照らす(etc が etcetera の頭に当たらない)。日本語の語は字面どおり。 */
16
+ const startsWithWord = (line, word) => line.toLowerCase().startsWith(word.toLowerCase()) && !(LATIN_LETTER.test(word.at(-1) ?? "") && LATIN_LETTER.test(line[word.length] ?? ""));
17
+ /** 箇条書きのすぐ下の行が、並びが続くことを言う語(など、etc.)で始まる。 */
18
+ export const continuesBeyond = (source, list, openWords) => {
19
+ const next = nextWrittenLine(source, list.span.end);
20
+ return openWords.some((word) => startsWithWord(next, word));
21
+ };
22
+ const isExactlyThree = (source, list, openWords) => list.items.length === THREE && !continuesBeyond(source, list, openWords);
23
+ /** 報告するときの数。報告しないときは undefined。 */
24
+ export const threeShare = (source, lists, openWords, limit) => {
25
+ const threes = lists.filter((list) => isExactlyThree(source, list, openWords));
26
+ const first = threes[0];
27
+ if (lists.length < MIN_LISTS || first === undefined)
28
+ return undefined;
29
+ const share = Math.round((threes.length / lists.length) * PERCENT);
30
+ const reported = lists.length < MIN_LISTS_FOR_SHARE ? threes.length === lists.length : share > limit;
31
+ return reported ? { count: threes.length, total: lists.length, share, first } : undefined;
32
+ };
33
+ //# sourceMappingURL=rule-of-three.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-of-three.js","sourceRoot":"","sources":["../src/rule-of-three.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,KAAK,GAAG,CAAC,CAAC;AAChB,wBAAwB;AACxB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,gDAAgD;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B,6BAA6B;AAC7B,MAAM,eAAe,GAAG,CAAC,MAAc,EAAE,IAAY,EAAU,EAAE,CAC/D,MAAM;KACH,KAAK,CAAC,IAAI,CAAC;KACX,KAA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,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;CAChC,CAAC;AAoBF,4EAA4E;AAC5E,eAAO,MAAM,aAAa,GAAI,OAAO,SAAS,cAAc,EAAE,EAAE,UAAU,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,OAAO,MAAM,KAAG,YAEzH,CAAC;AAoDH,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG;IAAE,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,KAAK,aAAa,EAClB,OAAO,SAAS,cAAc,EAAE,EAChC,QAAQ,SAAS,SAAS,EAAE,EAC5B,UAAU,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EACzC,OAAO,MAAM,KACZ,GAAG,EAAoF,CAAC;AAE3F,eAAO,MAAM,WAAW,GACtB,KAAK,aAAa,EAClB,OAAO,SAAS,cAAc,EAAE,EAChC,QAAQ,SAAS,SAAS,EAAE,EAC5B,UAAU,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EACzC,OAAO,MAAM,EACb,SAAS,eAAe,KACvB,OAAO,CAAC,cAAc,CAuBxB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { severityOf } from "./checks.js";
1
+ import { checkAppliesTo, severityOf } from "./checks.js";
2
2
  import { ask } from "./judge.js";
3
3
  import { FILTERS } from "./semantic.js";
4
4
  import { narrow } from "./look-at.js";
@@ -44,7 +44,7 @@ const builtInJobs = (doc, rules, settings, genre) => semanticRules(rules, settin
44
44
  ];
45
45
  });
46
46
  const userJobs = (doc, checks, genre) => checks
47
- .filter((check) => check.level !== "off" && check.use_for.some((target) => genre.startsWith(target)))
47
+ .filter((check) => check.level !== "off" && check.use_for.some((target) => genre.startsWith(target)) && checkAppliesTo(check, doc.language))
48
48
  .map((check) => {
49
49
  // look_at の括弧の中を取り出して絞り込む。取り出せなければ文書全体。spec §14。
50
50
  const { candidates, narrowing } = narrow(doc, check.look_at, FILTERS["whole-document"] ?? (() => []));
@@ -1 +1 @@
1
- {"version":3,"file":"run-semantic.js","sourceRoot":"","sources":["../src/run-semantic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,GAAG,EAAqB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,EAAkB,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,MAAM,EAAkB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAqBhD;;;GAGG;AACH,MAAM,SAAS,GAAG,CAAC,IAAwB,EAAwC,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,gBAAgB,CAAC,CAAC;AAExH,MAAM,iBAAiB,GAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAEpF,MAAM,iBAAiB,GAAG,CAAC,IAAoB,EAAE,KAAY,EAAY,EAAE;IACzE,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,MAAM,CAAC;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAA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AC9H,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3I,CAAC,CAAC,CACH,CACF,CAAC;IACF,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;QACjF,OAAO;QACP,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QAChE,aAAa,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM;QACnC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;KACrH,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Section } from "./plugin.ts";
2
+ /** One heading level's section lengths, compared with each other. */
3
+ export type LevelLengths = {
4
+ readonly lengths: readonly number[];
5
+ };
6
+ /**
7
+ * Section lengths compared with each other. A subsection is part of its section's length, and the title's introduction
8
+ * is compared with the top level. A run of subsections under headings that only group them is also compared on its own:
9
+ * three pros and three cons are six of one size. Under a heading with text of its own, subsections are parts of that
10
+ * section (seven principles of one guideline), and a section with text between two groups ends the run.
11
+ */
12
+ export declare const sectionLevels: (sections: readonly Section[], size: (section: Section) => number) => LevelLengths[];
13
+ /**
14
+ * An interview: at least half of the headed sections open with the interviewer's question. Each section is one answer,
15
+ * so even lengths are the form, not a template.
16
+ */
17
+ export declare const isInterview: (source: string, sections: readonly Section[], paragraphStarts: readonly number[], marks: readonly string[]) => boolean;
18
+ //# sourceMappingURL=section-levels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-levels.d.ts","sourceRoot":"","sources":["../src/section-levels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AA8DnE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,SAAS,OAAO,EAAE,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,KAAG,YAAY,EAK5G,CAAC;AAWF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,EAAE,UAAU,SAAS,OAAO,EAAE,EAAE,iBAAiB,SAAS,MAAM,EAAE,EAAE,OAAO,SAAS,MAAM,EAAE,KAAG,OAMxI,CAAC"}
@@ -0,0 +1,80 @@
1
+ /** A section's own text and every subsection under it, up to the next heading at its depth or shallower. */
2
+ const withSubsections = (sections, index, size) => {
3
+ const depth = sections[index]?.depth ?? 0;
4
+ const after = sections.slice(index + 1);
5
+ const end = after.findIndex((section) => section.depth <= depth);
6
+ const subsections = end === -1 ? after : after.slice(0, end);
7
+ return [sections[index], ...subsections].reduce((sum, section) => sum + (section === undefined ? 0 : size(section)), 0);
8
+ };
9
+ const depthCounts = (sections) => sections.reduce((counts, section) => counts.set(section.depth, (counts.get(section.depth) ?? 0) + 1), new Map());
10
+ /** The shallowest depth that more than one heading shares: the document's top level of sections, below its title. */
11
+ const topDepth = (sections) => [...depthCounts(sections).entries()]
12
+ .filter(([, count]) => count > 1)
13
+ .map(([depth]) => depth)
14
+ .sort((a, b) => a - b)[0];
15
+ /** The nearest heading above the section that is shallower than it. */
16
+ const parentOf = (sections, index) => {
17
+ const depth = sections[index]?.depth ?? 0;
18
+ return sections
19
+ .slice(0, index)
20
+ .reverse()
21
+ .find((section) => section.depth < depth);
22
+ };
23
+ /** A heading that only groups the subsections under it (Pros, Cons): no text of its own. */
24
+ const isGroupHeading = (section, top, size) => section !== undefined && section.depth >= top && size(section) === 0;
25
+ const topLevel = (sections, top, size) => ({
26
+ lengths: sections
27
+ .flatMap((section, index) => {
28
+ if (section.depth === top)
29
+ return [withSubsections(sections, index, size)];
30
+ return section.depth < top ? [size(section)] : [];
31
+ })
32
+ .filter((length) => length > 0),
33
+ });
34
+ /** Subsections at one depth, read in order; a run goes on across group headings and ends at any heading with text. */
35
+ const subsectionRuns = (sections, depth, top, size) => sections
36
+ .reduce((state, section, index) => {
37
+ if (section.depth === depth && isGroupHeading(parentOf(sections, index), top, size)) {
38
+ const length = withSubsections(sections, index, size);
39
+ const runs = state.open ? [...state.runs.slice(0, -1), [...(state.runs.at(-1) ?? []), length]] : [...state.runs, [length]];
40
+ return { runs, open: true };
41
+ }
42
+ if (section.depth > depth || (section.depth < depth && size(section) === 0))
43
+ return state;
44
+ return { runs: state.runs, open: false };
45
+ }, { runs: [], open: false })
46
+ .runs.map((run) => ({ lengths: run.filter((length) => length > 0) }));
47
+ /**
48
+ * Section lengths compared with each other. A subsection is part of its section's length, and the title's introduction
49
+ * is compared with the top level. A run of subsections under headings that only group them is also compared on its own:
50
+ * three pros and three cons are six of one size. Under a heading with text of its own, subsections are parts of that
51
+ * section (seven principles of one guideline), and a section with text between two groups ends the run.
52
+ */
53
+ export const sectionLevels = (sections, size) => {
54
+ const top = topDepth(sections);
55
+ if (top === undefined)
56
+ return [];
57
+ const deeper = [...depthCounts(sections).keys()].filter((depth) => depth > top).sort((a, b) => a - b);
58
+ return [topLevel(sections, top, size), ...deeper.flatMap((depth) => subsectionRuns(sections, depth, top, size))].filter((level) => level.lengths.length > 0);
59
+ };
60
+ const leadingEmphasis = /^[\s*_]+/u;
61
+ /** The section's first paragraph opens with an interviewer's mark (―― in Japanese, Q: in English): a question turn. */
62
+ const opensWithPrompt = (source, section, firstParagraphStart, marks) => {
63
+ if (firstParagraphStart === undefined || firstParagraphStart >= section.span.end)
64
+ return false;
65
+ const text = source.slice(firstParagraphStart, section.span.end).replace(leadingEmphasis, "");
66
+ return marks.some((mark) => text.startsWith(mark));
67
+ };
68
+ /**
69
+ * An interview: at least half of the headed sections open with the interviewer's question. Each section is one answer,
70
+ * so even lengths are the form, not a template.
71
+ */
72
+ export const isInterview = (source, sections, paragraphStarts, marks) => {
73
+ if (marks.length === 0)
74
+ return false;
75
+ const headed = sections.filter((section) => section.depth > 0 && section.sentences.length > 0);
76
+ const firstStart = (section) => paragraphStarts.find((start) => start >= section.span.start && start < section.span.end);
77
+ const turns = headed.filter((section) => opensWithPrompt(source, section, firstStart(section), marks)).length;
78
+ return turns > 0 && turns * 2 >= headed.length;
79
+ };
80
+ //# sourceMappingURL=section-levels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-levels.js","sourceRoot":"","sources":["../src/section-levels.ts"],"names":[],"mappings":"AAKA,4GAA4G;AAC5G,MAAM,eAAe,GAAG,CAAC,QAA4B,EAAE,KAAa,EAAE,IAAkC,EAAU,EAAE;IAClH,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,C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,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/F,MAAM,UAAU,GAAG,CAAC,OAAgB,EAAsB,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtJ,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IAC9G,OAAO,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC;AACjD,CAAC,CAAC"}
@@ -19,6 +19,8 @@ export declare const riskDisclosure: Filter;
19
19
  export declare const emptyConclusion: Filter;
20
20
  /** 効果を主張する数値に根拠が無い文だけを渡す。 */
21
21
  export declare const unsourcedNumber: Filter;
22
+ /** 書き出しの数文だけを渡す。最初の文が数を言うなら、具体から始まっているので問い合わせない。 */
23
+ export declare const genericOpening: Filter;
22
24
  /** 利用者が checks.yaml に書いた検査の既定。絞り込みを書かなければ文書全体。 */
23
25
  export declare const wholeDocument: Filter;
24
26
  export declare const FILTERS: Readonly<Record<string, Filter>>;
@@ -1 +1 @@
1
- {"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../src/semantic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAW,MAAM,aAAa,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAA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} from "./calendar-number.js";
2
2
  import { closingAndEarlier, newNumbers } from "./closing-numbers.js";
3
+ import { hasNewCodeOrLink, isLinkList } from "./closing-code.js";
4
+ import { openingProse, opensWithNumber } from "./opening-passage.js";
5
+ import { proseText } from "./measure.js";
3
6
  const heads = (doc) => doc.sections.map((section) => section.heading).join(" ");
4
7
  const sectionText = (doc, section) => doc.source.slice(section.span.start, section.span.end).trim();
5
8
  /** 見出しに答えが書いてあるなら、本文を読ませる必要はない。 */
@@ -14,7 +17,6 @@ export const riskDisclosure = (doc) => {
14
17
  return [];
15
18
  return [{ text: body.slice(0, 4000), offset: doc.sentences[0]?.span.start ?? 0 }];
16
19
  };
17
- const EVIDENCE = /`|https?:\/\//u;
18
20
  /** 結びに、前に書いていない数があるか。本文の数を繰り返すだけ(「以上のように、9月は…」)なら具体物ではない。 */
19
21
  const hasNewNumber = (doc, last) => {
20
22
  const { closing, earlier } = closingAndEarlier(doc, last);
@@ -29,7 +31,7 @@ export const emptyConclusion = (doc) => {
29
31
  if (last === undefined || last.sentences.length === 0)
30
32
  return [];
31
33
  const text = sectionText(doc, last);
32
- if (EVIDENCE.test(text) || hasNewNumber(doc, last))
34
+ if (isLinkList(text) || hasNewCodeOrLink(text, doc.source.slice(0, last.span.start)) || hasNewNumber(doc, last))
33
35
  return [];
34
36
  return [{ text: text.slice(0, 2000), offset: last.sentences[0]?.span.start ?? last.span.start }];
35
37
  };
@@ -48,6 +50,16 @@ const hasEvidence = (text) => EVIDENCE_WORDS.some((word) => text.includes(word))
48
50
  export const unsourcedNumber = (doc) => doc.sentences
49
51
  .filter((sentence) => NUMBER.test(sentence.text) && EFFECT.test(sentence.text) && !hasEvidence(sentence.text))
50
52
  .map((sentence) => ({ text: sentence.text.trim(), offset: sentence.span.start }));
53
+ const OPENING_MAX_CHARS = 1000;
54
+ /** 書き出しの数文だけを渡す。最初の文が数を言うなら、具体から始まっているので問い合わせない。 */
55
+ export const genericOpening = (doc) => {
56
+ const opening = openingProse(doc);
57
+ const first = opening[0];
58
+ if (first === undefined || opensWithNumber(opening))
59
+ return [];
60
+ const text = opening.map(proseText).join(doc.lengthUnit === "char" ? "" : " ");
61
+ return [{ text: text.slice(0, OPENING_MAX_CHARS), offset: first.span.start }];
62
+ };
51
63
  /** 利用者が checks.yaml に書いた検査の既定。絞り込みを書かなければ文書全体。 */
52
64
  export const wholeDocument = (doc) => {
53
65
  const body = doc.sentences.map((sentence) => sentence.text.trim()).join("");
@@ -57,6 +69,7 @@ export const FILTERS = {
57
69
  "risk-disclosure": riskDisclosure,
58
70
  "empty-conclusion": emptyConclusion,
59
71
  "unsourced-number": unsourcedNumber,
72
+ "generic-opening": genericOpening,
60
73
  "whole-document": wholeDocument,
61
74
  };
62
75
  //# sourceMappingURL=semantic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"semantic.js","sourceRoot":"","sources":["../src/semantic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAarE,MAAM,KAAK,GAAG,CAAC,GAAkB,EAAU,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEvG,MAAM,WAAW,GAAG,CAAC,GAAkB,EAAE,OAAgB,EAAU,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAEpI,mCAAmC;AACnC,MAAM,oBAAoB,GAAG,CAAC,GAAkB,EAAE,OAAe,EAAW,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAExG,MAAM,YAAY,GAAG,uCA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S,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC/E,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC;AAEF,kDAAkD;AAClD,MAAM,CAAC,MAAM,aAAa,GAAW,CAAC,GAAG,EAAE,EAAE;IAC3C,MAAM,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5E,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7G,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAqC;IACvD,iBAAiB,EAAE,cAAc;IACjC,kBAAkB,EAAE,eAAe;IACnC,kBAAkB,EAAE,eAAe;IACnC,iBAAiB,EAAE,cAAc;IACjC,gBAAgB,EAAE,aAAa;CAChC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { Token } from "./plugin.ts";
2
+ import { type TopicClauseWords } from "./topic-clause.ts";
2
3
  /**
3
4
  * The deepest the brackets of a text nest: 「計画(案)」 is one, 「(注(a)を参照)」 two, plain text none. A closer with no
4
5
  * opener (the 1) of a list) is ignored, an opener never closed counts as open until the end, a closer of the other width closes
@@ -17,5 +18,5 @@ export declare const clauseCount: (tokens: readonly Token[]) => number;
17
18
  * undefined when the sentence has no topic. The distance is the reader's wait: everything between has to be held before the
18
19
  * topic is said to do anything.
19
20
  */
20
- export declare const topicDistance: (tokens: readonly Token[]) => number | undefined;
21
+ export declare const topicDistance: (tokens: readonly Token[], words?: TopicClauseWords) => number | undefined;
21
22
  //# sourceMappingURL=sentence-load.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sentence-load.d.ts","sourceRoot":"","sources":["../src/sentence-load.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAoCzC;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,MAS3C,CAAC;AAiBF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,SAAS,KAAK,EAAE,KAAG,MAGtD,CAAC;AAoCF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,KAAK,EAAE,KAAG,MAAM,GAAG,SAKjE,CAAC"}
1
+ {"version":3,"file":"sentence-load.d.ts","sourceRoot":"","sources":["../src/sentence-load.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAmC1E;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,MAS3C,CAAC;AAiBF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,SAAS,KAAK,EAAE,KAAG,MAGtD,CAAC;AAoCF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,KAAK,EAAE,EAAE,QAAQ,gBAAgB,KAAG,MAAM,GAAG,SAO3F,CAAC"}
@@ -98,11 +98,13 @@ const firstTopic = (tokens) => {
98
98
  * undefined when the sentence has no topic. The distance is the reader's wait: everything between has to be held before the
99
99
  * topic is said to do anything.
100
100
  */
101
- export const topicDistance = (tokens) => {
101
+ export const topicDistance = (tokens, words) => {
102
102
  const topic = firstTopic(tokens);
103
103
  const last = tokens.findLastIndex((token) => !TRAILING.has(token.pos));
104
104
  if (topic === -1 || last <= topic)
105
105
  return undefined;
106
- return tokens.slice(topic + 1, topicClauseEnd(tokens, topic, last) ?? last).reduce((sum, token) => sum + [...token.surface.replace(/\s/gu, "")].length, 0);
106
+ return tokens
107
+ .slice(topic + 1, topicClauseEnd(tokens, topic, last, words) ?? last)
108
+ .reduce((sum, token) => sum + [...token.surface.replace(/\s/gu, "")].length, 0);
107
109
  };
108
110
  //# sourceMappingURL=sentence-load.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sentence-load.js","sourceRoot":"","sources":["../src/sentence-load.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,MAAM,QAAQ,GAAqC;IACjD,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;CACT,CAAC;AAEF,oHAAoH;AACpH,MAAM,WAAW,GAAqC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEjG,6GAA6G;AAC7G,MAAM,OAAO,GAAG,6BAA6B,CAAC;AAE9C;;;GAGG;AACH,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAE5D,MAAM,OAAO,GAAG,CAAC,IAAY,EAAU,EAAE,CACvC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,MAAc,E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AC,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AACpF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Token } from "./plugin.ts";
2
+ /** The counted particles (particles) of a sentence that stand inside one of phrases, each written whole (おそれのある). */
3
+ export declare const setPhraseParticles: (tokens: readonly Token[], particles: readonly string[], phrases: readonly string[]) => ReadonlySet<Token>;
4
+ //# sourceMappingURL=set-phrase-particles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-phrase-particles.d.ts","sourceRoot":"","sources":["../src/set-phrase-particles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA6BzC,qHAAqH;AACrH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,SAAS,KAAK,EAAE,EAAE,WAAW,SAAS,MAAM,EAAE,EAAE,SAAS,SAAS,MAAM,EAAE,KAAG,WAAW,CAAC,KAAK,CAC5B,CAAC"}
@@ -0,0 +1,26 @@
1
+ // A particle inside a set phrase (絶滅のおそれのある種: おそれのある, "at risk of"): the phrase is read as one word, so its particle
2
+ // is not a link of a nesting chain. Pure.
3
+ const touches = (left, right) => left !== undefined && right !== undefined && left.span.end === right.span.start;
4
+ /** How many words before a particle are read for a phrase's head: the tokenizer may cut it (おそれ as お and それ). */
5
+ const MAX_HEAD_WORDS = 3;
6
+ /** The words written straight before tokens[at], joined (おそれ from お and それ). */
7
+ const headBefore = (tokens, at) => {
8
+ const window = tokens.slice(Math.max(0, at - MAX_HEAD_WORDS), at + 1);
9
+ const gap = window.findLastIndex((token, index) => index < window.length - 1 && !touches(token, window[index + 1]));
10
+ return window
11
+ .slice(gap + 1, -1)
12
+ .map((token) => token.surface)
13
+ .join("");
14
+ };
15
+ /** Whether the particle at `at`, the words before it and the dictionary form of the word after it spell one of phrases (おそれのある). */
16
+ const isInPhrase = (tokens, at, phrases) => {
17
+ const [particle, after] = [tokens[at], tokens[at + 1]];
18
+ if (particle === undefined || after === undefined || !touches(particle, after))
19
+ return false;
20
+ const tail = `${particle.surface}${after.lemma ?? after.surface}`;
21
+ const head = headBefore(tokens, at);
22
+ return phrases.some((phrase) => phrase.endsWith(tail) && phrase.length > tail.length && head.endsWith(phrase.slice(0, -tail.length)));
23
+ };
24
+ /** The counted particles (particles) of a sentence that stand inside one of phrases, each written whole (おそれのある). */
25
+ export const setPhraseParticles = (tokens, particles, phrases) => new Set(tokens.filter((token, at) => particles.includes(token.surface) && isInPhrase(tokens, at, phrases)));
26
+ //# sourceMappingURL=set-phrase-particles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-phrase-particles.js","sourceRoot":"","sources":["../src/set-phrase-particles.ts"],"names":[],"mappings":"AAEA,qHAAqH;AACrH,0CAA0C;AAE1C,MAAM,OAAO,GAAG,CAAC,IAAuB,EAAE,KAAwB,EAAW,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AAEhK,iHAAiH;AACjH,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,gFAAgF;AAChF,MAAM,UAAU,GAAG,CAAC,MAAwB,EAAE,EAAU,EAAU,EAAE;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,cAAc,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IACtE,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC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