chaffjs 0.17.0 → 0.19.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 (1236) hide show
  1. package/README.md +52 -56
  2. package/bin/chaff.js +17 -2
  3. package/dist/acronym-expansions.d.ts +26 -0
  4. package/dist/acronym-expansions.d.ts.map +1 -0
  5. package/dist/acronym-expansions.js +88 -0
  6. package/dist/acronym-expansions.js.map +1 -0
  7. package/dist/announced-count.d.ts +26 -0
  8. package/dist/announced-count.d.ts.map +1 -0
  9. package/dist/announced-count.js +138 -0
  10. package/dist/announced-count.js.map +1 -0
  11. package/dist/announced-list.d.ts +30 -0
  12. package/dist/announced-list.d.ts.map +1 -0
  13. package/dist/announced-list.js +95 -0
  14. package/dist/announced-list.js.map +1 -0
  15. package/dist/api.d.ts +168 -0
  16. package/dist/api.d.ts.map +1 -0
  17. package/dist/api.js +10 -0
  18. package/dist/api.js.map +1 -0
  19. package/dist/bare-url.d.ts +14 -0
  20. package/dist/bare-url.d.ts.map +1 -0
  21. package/dist/bare-url.js +28 -0
  22. package/dist/bare-url.js.map +1 -0
  23. package/dist/baseline.d.ts +5 -0
  24. package/dist/baseline.d.ts.map +1 -1
  25. package/dist/baseline.js +16 -1
  26. package/dist/baseline.js.map +1 -1
  27. package/dist/body-section.d.ts +7 -0
  28. package/dist/body-section.d.ts.map +1 -0
  29. package/dist/body-section.js +6 -0
  30. package/dist/body-section.js.map +1 -0
  31. package/dist/calendar-number.d.ts +2 -0
  32. package/dist/calendar-number.d.ts.map +1 -1
  33. package/dist/calendar-number.js +9 -2
  34. package/dist/calendar-number.js.map +1 -1
  35. package/dist/cli-args.d.ts +4 -0
  36. package/dist/cli-args.d.ts.map +1 -1
  37. package/dist/cli-args.js +5 -0
  38. package/dist/cli-args.js.map +1 -1
  39. package/dist/cli-text.d.ts +0 -1
  40. package/dist/cli-text.d.ts.map +1 -1
  41. package/dist/cli-text.js +14 -18
  42. package/dist/cli-text.js.map +1 -1
  43. package/dist/cli.d.ts.map +1 -1
  44. package/dist/cli.js +83 -84
  45. package/dist/cli.js.map +1 -1
  46. package/dist/closing-paragraph.d.ts +7 -0
  47. package/dist/closing-paragraph.d.ts.map +1 -0
  48. package/dist/closing-paragraph.js +22 -0
  49. package/dist/closing-paragraph.js.map +1 -0
  50. package/dist/commands/compare.d.ts +15 -0
  51. package/dist/commands/compare.d.ts.map +1 -0
  52. package/dist/commands/compare.js +64 -0
  53. package/dist/commands/compare.js.map +1 -0
  54. package/dist/commands/document-commands.d.ts +9 -0
  55. package/dist/commands/document-commands.d.ts.map +1 -0
  56. package/dist/commands/document-commands.js +17 -0
  57. package/dist/commands/document-commands.js.map +1 -0
  58. package/dist/commands/eval.d.ts.map +1 -1
  59. package/dist/commands/eval.js +19 -10
  60. package/dist/commands/eval.js.map +1 -1
  61. package/dist/commands/facts.d.ts +8 -0
  62. package/dist/commands/facts.d.ts.map +1 -0
  63. package/dist/commands/facts.js +30 -0
  64. package/dist/commands/facts.js.map +1 -0
  65. package/dist/commands/feedback.d.ts +15 -2
  66. package/dist/commands/feedback.d.ts.map +1 -1
  67. package/dist/commands/feedback.js +36 -6
  68. package/dist/commands/feedback.js.map +1 -1
  69. package/dist/commands/fix-plan.d.ts +13 -0
  70. package/dist/commands/fix-plan.d.ts.map +1 -0
  71. package/dist/commands/fix-plan.js +44 -0
  72. package/dist/commands/fix-plan.js.map +1 -0
  73. package/dist/commands/outline.d.ts +8 -0
  74. package/dist/commands/outline.d.ts.map +1 -0
  75. package/dist/commands/outline.js +43 -0
  76. package/dist/commands/outline.js.map +1 -0
  77. package/dist/commands/read-document.d.ts +14 -0
  78. package/dist/commands/read-document.d.ts.map +1 -0
  79. package/dist/commands/read-document.js +21 -0
  80. package/dist/commands/read-document.js.map +1 -0
  81. package/dist/commands/suppressions.d.ts +7 -0
  82. package/dist/commands/suppressions.d.ts.map +1 -0
  83. package/dist/commands/suppressions.js +9 -0
  84. package/dist/commands/suppressions.js.map +1 -0
  85. package/dist/commands/test.d.ts.map +1 -1
  86. package/dist/commands/test.js +3 -5
  87. package/dist/commands/test.js.map +1 -1
  88. package/dist/commands/tree.d.ts +13 -0
  89. package/dist/commands/tree.d.ts.map +1 -1
  90. package/dist/commands/tree.js +35 -5
  91. package/dist/commands/tree.js.map +1 -1
  92. package/dist/compare/atom.d.ts +31 -0
  93. package/dist/compare/atom.d.ts.map +1 -0
  94. package/dist/compare/atom.js +4 -0
  95. package/dist/compare/atom.js.map +1 -0
  96. package/dist/compare/clock-time.d.ts +8 -0
  97. package/dist/compare/clock-time.d.ts.map +1 -0
  98. package/dist/compare/clock-time.js +68 -0
  99. package/dist/compare/clock-time.js.map +1 -0
  100. package/dist/compare/distinct.d.ts +9 -0
  101. package/dist/compare/distinct.d.ts.map +1 -0
  102. package/dist/compare/distinct.js +12 -0
  103. package/dist/compare/distinct.js.map +1 -0
  104. package/dist/compare/extract.d.ts +15 -0
  105. package/dist/compare/extract.d.ts.map +1 -0
  106. package/dist/compare/extract.js +60 -0
  107. package/dist/compare/extract.js.map +1 -0
  108. package/dist/compare/fact-key.d.ts +17 -0
  109. package/dist/compare/fact-key.d.ts.map +1 -0
  110. package/dist/compare/fact-key.js +25 -0
  111. package/dist/compare/fact-key.js.map +1 -0
  112. package/dist/compare/fact-text.d.ts +28 -0
  113. package/dist/compare/fact-text.d.ts.map +1 -0
  114. package/dist/compare/fact-text.js +61 -0
  115. package/dist/compare/fact-text.js.map +1 -0
  116. package/dist/compare/facts-render.d.ts +17 -0
  117. package/dist/compare/facts-render.d.ts.map +1 -0
  118. package/dist/compare/facts-render.js +43 -0
  119. package/dist/compare/facts-render.js.map +1 -0
  120. package/dist/compare/facts-text.d.ts +15 -0
  121. package/dist/compare/facts-text.d.ts.map +1 -0
  122. package/dist/compare/facts-text.js +27 -0
  123. package/dist/compare/facts-text.js.map +1 -0
  124. package/dist/compare/markup-atoms.d.ts +11 -0
  125. package/dist/compare/markup-atoms.d.ts.map +1 -0
  126. package/dist/compare/markup-atoms.js +23 -0
  127. package/dist/compare/markup-atoms.js.map +1 -0
  128. package/dist/compare/match.d.ts +20 -0
  129. package/dist/compare/match.d.ts.map +1 -0
  130. package/dist/compare/match.js +84 -0
  131. package/dist/compare/match.js.map +1 -0
  132. package/dist/compare/outcome.d.ts +36 -0
  133. package/dist/compare/outcome.d.ts.map +1 -0
  134. package/dist/compare/outcome.js +46 -0
  135. package/dist/compare/outcome.js.map +1 -0
  136. package/dist/compare/proper-nouns.d.ts +19 -0
  137. package/dist/compare/proper-nouns.d.ts.map +1 -0
  138. package/dist/compare/proper-nouns.js +43 -0
  139. package/dist/compare/proper-nouns.js.map +1 -0
  140. package/dist/compare/render.d.ts +13 -0
  141. package/dist/compare/render.d.ts.map +1 -0
  142. package/dist/compare/render.js +64 -0
  143. package/dist/compare/render.js.map +1 -0
  144. package/dist/compare/spans.d.ts +9 -0
  145. package/dist/compare/spans.d.ts.map +1 -0
  146. package/dist/compare/spans.js +11 -0
  147. package/dist/compare/spans.js.map +1 -0
  148. package/dist/compare/text-atoms.d.ts +27 -0
  149. package/dist/compare/text-atoms.d.ts.map +1 -0
  150. package/dist/compare/text-atoms.js +69 -0
  151. package/dist/compare/text-atoms.js.map +1 -0
  152. package/dist/compare/text.d.ts +24 -0
  153. package/dist/compare/text.d.ts.map +1 -0
  154. package/dist/compare/text.js +90 -0
  155. package/dist/compare/text.js.map +1 -0
  156. package/dist/compare/tree-atoms.d.ts +20 -0
  157. package/dist/compare/tree-atoms.d.ts.map +1 -0
  158. package/dist/compare/tree-atoms.js +58 -0
  159. package/dist/compare/tree-atoms.js.map +1 -0
  160. package/dist/compare/written-names.d.ts +8 -0
  161. package/dist/compare/written-names.d.ts.map +1 -0
  162. package/dist/compare/written-names.js +24 -0
  163. package/dist/compare/written-names.js.map +1 -0
  164. package/dist/config/load.d.ts +23 -0
  165. package/dist/config/load.d.ts.map +1 -1
  166. package/dist/config/load.js +6 -0
  167. package/dist/config/load.js.map +1 -1
  168. package/dist/config/option-problems.d.ts +17 -0
  169. package/dist/config/option-problems.d.ts.map +1 -0
  170. package/dist/config/option-problems.js +59 -0
  171. package/dist/config/option-problems.js.map +1 -0
  172. package/dist/config/read.d.ts +4 -0
  173. package/dist/config/read.d.ts.map +1 -0
  174. package/dist/config/read.js +8 -0
  175. package/dist/config/read.js.map +1 -0
  176. package/dist/config/rule-problems.d.ts +2 -4
  177. package/dist/config/rule-problems.d.ts.map +1 -1
  178. package/dist/config/rule-problems.js +7 -1
  179. package/dist/config/rule-problems.js.map +1 -1
  180. package/dist/config/style.d.ts +21 -0
  181. package/dist/config/style.d.ts.map +1 -0
  182. package/dist/config/style.js +48 -0
  183. package/dist/config/style.js.map +1 -0
  184. package/dist/config/warnings.d.ts +6 -0
  185. package/dist/config/warnings.d.ts.map +1 -0
  186. package/dist/config/warnings.js +10 -0
  187. package/dist/config/warnings.js.map +1 -0
  188. package/dist/config/write.d.ts.map +1 -1
  189. package/dist/config/write.js +17 -4
  190. package/dist/config/write.js.map +1 -1
  191. package/dist/custom/bounded-match.d.ts +15 -0
  192. package/dist/custom/bounded-match.d.ts.map +1 -0
  193. package/dist/custom/bounded-match.js +43 -0
  194. package/dist/custom/bounded-match.js.map +1 -0
  195. package/dist/custom/load.d.ts +11 -0
  196. package/dist/custom/load.d.ts.map +1 -0
  197. package/dist/custom/load.js +19 -0
  198. package/dist/custom/load.js.map +1 -0
  199. package/dist/custom/module-path.d.ts +11 -0
  200. package/dist/custom/module-path.d.ts.map +1 -0
  201. package/dist/custom/module-path.js +15 -0
  202. package/dist/custom/module-path.js.map +1 -0
  203. package/dist/custom/parse.d.ts +84 -0
  204. package/dist/custom/parse.d.ts.map +1 -0
  205. package/dist/custom/parse.js +258 -0
  206. package/dist/custom/parse.js.map +1 -0
  207. package/dist/custom/problems.d.ts +8 -0
  208. package/dist/custom/problems.d.ts.map +1 -0
  209. package/dist/custom/problems.js +95 -0
  210. package/dist/custom/problems.js.map +1 -0
  211. package/dist/custom/regex-safety.d.ts +11 -0
  212. package/dist/custom/regex-safety.d.ts.map +1 -0
  213. package/dist/custom/regex-safety.js +110 -0
  214. package/dist/custom/regex-safety.js.map +1 -0
  215. package/dist/custom/token-pattern.d.ts +8 -0
  216. package/dist/custom/token-pattern.d.ts.map +1 -0
  217. package/dist/custom/token-pattern.js +75 -0
  218. package/dist/custom/token-pattern.js.map +1 -0
  219. package/dist/detect-language.js +1 -1
  220. package/dist/detect.d.ts.map +1 -1
  221. package/dist/detect.js +30 -2
  222. package/dist/detect.js.map +1 -1
  223. package/dist/detectors/acronym-context.d.ts +2 -0
  224. package/dist/detectors/acronym-context.d.ts.map +1 -1
  225. package/dist/detectors/acronym-context.js +12 -4
  226. package/dist/detectors/acronym-context.js.map +1 -1
  227. package/dist/detectors/ai-phrasing.d.ts +23 -0
  228. package/dist/detectors/ai-phrasing.d.ts.map +1 -0
  229. package/dist/detectors/ai-phrasing.js +116 -0
  230. package/dist/detectors/ai-phrasing.js.map +1 -0
  231. package/dist/detectors/announced-count.d.ts +4 -0
  232. package/dist/detectors/announced-count.d.ts.map +1 -0
  233. package/dist/detectors/announced-count.js +20 -0
  234. package/dist/detectors/announced-count.js.map +1 -0
  235. package/dist/detectors/bold-label.d.ts +10 -0
  236. package/dist/detectors/bold-label.d.ts.map +1 -0
  237. package/dist/detectors/bold-label.js +44 -0
  238. package/dist/detectors/bold-label.js.map +1 -0
  239. package/dist/detectors/broken-link.d.ts +17 -0
  240. package/dist/detectors/broken-link.d.ts.map +1 -0
  241. package/dist/detectors/broken-link.js +66 -0
  242. package/dist/detectors/broken-link.js.map +1 -0
  243. package/dist/detectors/cited-name.d.ts.map +1 -1
  244. package/dist/detectors/cited-name.js +4 -4
  245. package/dist/detectors/cited-name.js.map +1 -1
  246. package/dist/detectors/cited-title.d.ts +11 -0
  247. package/dist/detectors/cited-title.d.ts.map +1 -0
  248. package/dist/detectors/cited-title.js +75 -0
  249. package/dist/detectors/cited-title.js.map +1 -0
  250. package/dist/detectors/concrete-evidence.d.ts +1 -1
  251. package/dist/detectors/concrete-evidence.d.ts.map +1 -1
  252. package/dist/detectors/concrete-evidence.js +2 -1
  253. package/dist/detectors/concrete-evidence.js.map +1 -1
  254. package/dist/detectors/contrast-frame.d.ts +17 -0
  255. package/dist/detectors/contrast-frame.d.ts.map +1 -0
  256. package/dist/detectors/contrast-frame.js +32 -0
  257. package/dist/detectors/contrast-frame.js.map +1 -0
  258. package/dist/detectors/custom.d.ts +8 -0
  259. package/dist/detectors/custom.d.ts.map +1 -0
  260. package/dist/detectors/custom.js +71 -0
  261. package/dist/detectors/custom.js.map +1 -0
  262. package/dist/detectors/dangling-figure.d.ts +7 -0
  263. package/dist/detectors/dangling-figure.d.ts.map +1 -0
  264. package/dist/detectors/dangling-figure.js +20 -0
  265. package/dist/detectors/dangling-figure.js.map +1 -0
  266. package/dist/detectors/definition-use.d.ts +8 -0
  267. package/dist/detectors/definition-use.d.ts.map +1 -0
  268. package/dist/detectors/definition-use.js +32 -0
  269. package/dist/detectors/definition-use.js.map +1 -0
  270. package/dist/detectors/doubled-punctuation.d.ts +9 -0
  271. package/dist/detectors/doubled-punctuation.d.ts.map +1 -0
  272. package/dist/detectors/doubled-punctuation.js +35 -0
  273. package/dist/detectors/doubled-punctuation.js.map +1 -0
  274. package/dist/detectors/doubled-word.d.ts +5 -0
  275. package/dist/detectors/doubled-word.d.ts.map +1 -1
  276. package/dist/detectors/doubled-word.js +24 -11
  277. package/dist/detectors/doubled-word.js.map +1 -1
  278. package/dist/detectors/duplicate-heading.d.ts +14 -0
  279. package/dist/detectors/duplicate-heading.d.ts.map +1 -0
  280. package/dist/detectors/duplicate-heading.js +39 -0
  281. package/dist/detectors/duplicate-heading.js.map +1 -0
  282. package/dist/detectors/empty-section.d.ts +8 -0
  283. package/dist/detectors/empty-section.d.ts.map +1 -0
  284. package/dist/detectors/empty-section.js +16 -0
  285. package/dist/detectors/empty-section.js.map +1 -0
  286. package/dist/detectors/enumerated-runs.d.ts +1 -1
  287. package/dist/detectors/enumerated-runs.d.ts.map +1 -1
  288. package/dist/detectors/enumerated-runs.js +15 -4
  289. package/dist/detectors/enumerated-runs.js.map +1 -1
  290. package/dist/detectors/fullwidth-alnum.d.ts +24 -0
  291. package/dist/detectors/fullwidth-alnum.d.ts.map +1 -0
  292. package/dist/detectors/fullwidth-alnum.js +88 -0
  293. package/dist/detectors/fullwidth-alnum.js.map +1 -0
  294. package/dist/detectors/gram-furniture.d.ts +6 -0
  295. package/dist/detectors/gram-furniture.d.ts.map +1 -0
  296. package/dist/detectors/gram-furniture.js +21 -0
  297. package/dist/detectors/gram-furniture.js.map +1 -0
  298. package/dist/detectors/gram-place.d.ts +2 -0
  299. package/dist/detectors/gram-place.d.ts.map +1 -1
  300. package/dist/detectors/gram-place.js +9 -7
  301. package/dist/detectors/gram-place.js.map +1 -1
  302. package/dist/detectors/gram-windows.d.ts +9 -0
  303. package/dist/detectors/gram-windows.d.ts.map +1 -0
  304. package/dist/detectors/gram-windows.js +27 -0
  305. package/dist/detectors/gram-windows.js.map +1 -0
  306. package/dist/detectors/hankaku-kana.d.ts +9 -0
  307. package/dist/detectors/hankaku-kana.d.ts.map +1 -0
  308. package/dist/detectors/hankaku-kana.js +27 -0
  309. package/dist/detectors/hankaku-kana.js.map +1 -0
  310. package/dist/detectors/heading-case.d.ts +2 -0
  311. package/dist/detectors/heading-case.d.ts.map +1 -1
  312. package/dist/detectors/heading-case.js +29 -2
  313. package/dist/detectors/heading-case.js.map +1 -1
  314. package/dist/detectors/heading-code-words.d.ts +6 -0
  315. package/dist/detectors/heading-code-words.d.ts.map +1 -0
  316. package/dist/detectors/heading-code-words.js +29 -0
  317. package/dist/detectors/heading-code-words.js.map +1 -0
  318. package/dist/detectors/heading-echo.d.ts.map +1 -1
  319. package/dist/detectors/heading-echo.js +7 -4
  320. package/dist/detectors/heading-echo.js.map +1 -1
  321. package/dist/detectors/heading-level-skip.d.ts +12 -0
  322. package/dist/detectors/heading-level-skip.d.ts.map +1 -0
  323. package/dist/detectors/heading-level-skip.js +11 -0
  324. package/dist/detectors/heading-level-skip.js.map +1 -0
  325. package/dist/detectors/image-alt-text.d.ts +3 -0
  326. package/dist/detectors/image-alt-text.d.ts.map +1 -0
  327. package/dist/detectors/image-alt-text.js +9 -0
  328. package/dist/detectors/image-alt-text.js.map +1 -0
  329. package/dist/detectors/index.d.ts.map +1 -1
  330. package/dist/detectors/index.js +70 -1
  331. package/dist/detectors/index.js.map +1 -1
  332. package/dist/detectors/invisible-character.d.ts +20 -0
  333. package/dist/detectors/invisible-character.d.ts.map +1 -0
  334. package/dist/detectors/invisible-character.js +143 -0
  335. package/dist/detectors/invisible-character.js.map +1 -0
  336. package/dist/detectors/kutoten-consistency.d.ts +24 -0
  337. package/dist/detectors/kutoten-consistency.d.ts.map +1 -0
  338. package/dist/detectors/kutoten-consistency.js +77 -0
  339. package/dist/detectors/kutoten-consistency.js.map +1 -0
  340. package/dist/detectors/lead-in.d.ts +1 -0
  341. package/dist/detectors/lead-in.d.ts.map +1 -1
  342. package/dist/detectors/lead-in.js +2 -1
  343. package/dist/detectors/lead-in.js.map +1 -1
  344. package/dist/detectors/lexicon-match.d.ts +14 -1
  345. package/dist/detectors/lexicon-match.d.ts.map +1 -1
  346. package/dist/detectors/lexicon-match.js +32 -2
  347. package/dist/detectors/lexicon-match.js.map +1 -1
  348. package/dist/detectors/lexicon.d.ts +6 -1
  349. package/dist/detectors/lexicon.d.ts.map +1 -1
  350. package/dist/detectors/lexicon.js +31 -13
  351. package/dist/detectors/lexicon.js.map +1 -1
  352. package/dist/detectors/list-item.d.ts +45 -0
  353. package/dist/detectors/list-item.d.ts.map +1 -0
  354. package/dist/detectors/list-item.js +88 -0
  355. package/dist/detectors/list-item.js.map +1 -0
  356. package/dist/detectors/list-items.d.ts +31 -0
  357. package/dist/detectors/list-items.d.ts.map +1 -0
  358. package/dist/detectors/list-items.js +113 -0
  359. package/dist/detectors/list-items.js.map +1 -0
  360. package/dist/detectors/list-lead-in.d.ts +7 -0
  361. package/dist/detectors/list-lead-in.d.ts.map +1 -0
  362. package/dist/detectors/list-lead-in.js +28 -0
  363. package/dist/detectors/list-lead-in.js.map +1 -0
  364. package/dist/detectors/list-sentence.d.ts +67 -0
  365. package/dist/detectors/list-sentence.d.ts.map +1 -0
  366. package/dist/detectors/list-sentence.js +130 -0
  367. package/dist/detectors/list-sentence.js.map +1 -0
  368. package/dist/detectors/list-view.d.ts +34 -0
  369. package/dist/detectors/list-view.d.ts.map +1 -0
  370. package/dist/detectors/list-view.js +137 -0
  371. package/dist/detectors/list-view.js.map +1 -0
  372. package/dist/detectors/long-vowel.d.ts +7 -0
  373. package/dist/detectors/long-vowel.d.ts.map +1 -0
  374. package/dist/detectors/long-vowel.js +71 -0
  375. package/dist/detectors/long-vowel.js.map +1 -0
  376. package/dist/detectors/markup-finding.d.ts +8 -0
  377. package/dist/detectors/markup-finding.d.ts.map +1 -0
  378. package/dist/detectors/markup-finding.js +29 -0
  379. package/dist/detectors/markup-finding.js.map +1 -0
  380. package/dist/detectors/modal-conflict.d.ts +4 -0
  381. package/dist/detectors/modal-conflict.d.ts.map +1 -0
  382. package/dist/detectors/modal-conflict.js +22 -0
  383. package/dist/detectors/modal-conflict.js.map +1 -0
  384. package/dist/detectors/name-numeral.d.ts +1 -1
  385. package/dist/detectors/name-numeral.d.ts.map +1 -1
  386. package/dist/detectors/name-numeral.js +2 -7
  387. package/dist/detectors/name-numeral.js.map +1 -1
  388. package/dist/detectors/name-variant.d.ts +4 -0
  389. package/dist/detectors/name-variant.d.ts.map +1 -0
  390. package/dist/detectors/name-variant.js +13 -0
  391. package/dist/detectors/name-variant.js.map +1 -0
  392. package/dist/detectors/nominalization.d.ts +11 -0
  393. package/dist/detectors/nominalization.d.ts.map +1 -0
  394. package/dist/detectors/nominalization.js +56 -0
  395. package/dist/detectors/nominalization.js.map +1 -0
  396. package/dist/detectors/orthography.d.ts.map +1 -1
  397. package/dist/detectors/orthography.js +72 -37
  398. package/dist/detectors/orthography.js.map +1 -1
  399. package/dist/detectors/outside-announced-list.d.ts +4 -0
  400. package/dist/detectors/outside-announced-list.d.ts.map +1 -0
  401. package/dist/detectors/outside-announced-list.js +24 -0
  402. package/dist/detectors/outside-announced-list.js.map +1 -0
  403. package/dist/detectors/oxford-comma.d.ts +7 -1
  404. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  405. package/dist/detectors/oxford-comma.js +136 -229
  406. package/dist/detectors/oxford-comma.js.map +1 -1
  407. package/dist/detectors/phrase-match.d.ts +4 -1
  408. package/dist/detectors/phrase-match.d.ts.map +1 -1
  409. package/dist/detectors/phrase-match.js +26 -7
  410. package/dist/detectors/phrase-match.js.map +1 -1
  411. package/dist/detectors/place-run.d.ts.map +1 -1
  412. package/dist/detectors/place-run.js +10 -6
  413. package/dist/detectors/place-run.js.map +1 -1
  414. package/dist/detectors/placeholder-text.d.ts +9 -0
  415. package/dist/detectors/placeholder-text.d.ts.map +1 -0
  416. package/dist/detectors/placeholder-text.js +18 -0
  417. package/dist/detectors/placeholder-text.js.map +1 -0
  418. package/dist/detectors/quote-around.d.ts +3 -0
  419. package/dist/detectors/quote-around.d.ts.map +1 -0
  420. package/dist/detectors/quote-around.js +8 -0
  421. package/dist/detectors/quote-around.js.map +1 -0
  422. package/dist/detectors/ra-nuki.d.ts +9 -0
  423. package/dist/detectors/ra-nuki.d.ts.map +1 -0
  424. package/dist/detectors/ra-nuki.js +30 -0
  425. package/dist/detectors/ra-nuki.js.map +1 -0
  426. package/dist/detectors/register.d.ts +11 -3
  427. package/dist/detectors/register.d.ts.map +1 -1
  428. package/dist/detectors/register.js +28 -9
  429. package/dist/detectors/register.js.map +1 -1
  430. package/dist/detectors/requirement-modal.d.ts +5 -0
  431. package/dist/detectors/requirement-modal.d.ts.map +1 -0
  432. package/dist/detectors/requirement-modal.js +54 -0
  433. package/dist/detectors/requirement-modal.js.map +1 -0
  434. package/dist/detectors/requirement-smell.d.ts +4 -0
  435. package/dist/detectors/requirement-smell.d.ts.map +1 -0
  436. package/dist/detectors/requirement-smell.js +41 -0
  437. package/dist/detectors/requirement-smell.js.map +1 -0
  438. package/dist/detectors/roman-numeral.d.ts +2 -0
  439. package/dist/detectors/roman-numeral.d.ts.map +1 -1
  440. package/dist/detectors/roman-numeral.js +2 -0
  441. package/dist/detectors/roman-numeral.js.map +1 -1
  442. package/dist/detectors/sentence-ending.d.ts +17 -1
  443. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  444. package/dist/detectors/sentence-ending.js +13 -7
  445. package/dist/detectors/sentence-ending.js.map +1 -1
  446. package/dist/detectors/sentence-length.d.ts.map +1 -1
  447. package/dist/detectors/sentence-length.js +13 -4
  448. package/dist/detectors/sentence-length.js.map +1 -1
  449. package/dist/detectors/signals.d.ts +8 -0
  450. package/dist/detectors/signals.d.ts.map +1 -1
  451. package/dist/detectors/signals.js +67 -46
  452. package/dist/detectors/signals.js.map +1 -1
  453. package/dist/detectors/space-before-punctuation.d.ts +8 -0
  454. package/dist/detectors/space-before-punctuation.d.ts.map +1 -0
  455. package/dist/detectors/space-before-punctuation.js +24 -0
  456. package/dist/detectors/space-before-punctuation.js.map +1 -0
  457. package/dist/detectors/spelling-variety.d.ts +23 -0
  458. package/dist/detectors/spelling-variety.d.ts.map +1 -0
  459. package/dist/detectors/spelling-variety.js +59 -0
  460. package/dist/detectors/spelling-variety.js.map +1 -0
  461. package/dist/detectors/structure-tree.d.ts +6 -0
  462. package/dist/detectors/structure-tree.d.ts.map +1 -1
  463. package/dist/detectors/structure-tree.js +39 -1
  464. package/dist/detectors/structure-tree.js.map +1 -1
  465. package/dist/detectors/structure.d.ts +1 -3
  466. package/dist/detectors/structure.d.ts.map +1 -1
  467. package/dist/detectors/structure.js +19 -6
  468. package/dist/detectors/structure.js.map +1 -1
  469. package/dist/detectors/superlative-comparison.d.ts +20 -0
  470. package/dist/detectors/superlative-comparison.d.ts.map +1 -0
  471. package/dist/detectors/superlative-comparison.js +32 -0
  472. package/dist/detectors/superlative-comparison.js.map +1 -0
  473. package/dist/detectors/superlative-name.d.ts.map +1 -1
  474. package/dist/detectors/superlative-name.js +8 -5
  475. package/dist/detectors/superlative-name.js.map +1 -1
  476. package/dist/detectors/superlative-scope.d.ts.map +1 -1
  477. package/dist/detectors/superlative-scope.js +9 -4
  478. package/dist/detectors/superlative-scope.js.map +1 -1
  479. package/dist/detectors/token-column.d.ts +46 -0
  480. package/dist/detectors/token-column.d.ts.map +1 -0
  481. package/dist/detectors/token-column.js +95 -0
  482. package/dist/detectors/token-column.js.map +1 -0
  483. package/dist/detectors/unbalanced-bracket.d.ts +22 -0
  484. package/dist/detectors/unbalanced-bracket.d.ts.map +1 -0
  485. package/dist/detectors/unbalanced-bracket.js +119 -0
  486. package/dist/detectors/unbalanced-bracket.js.map +1 -0
  487. package/dist/detectors/url-run-on.d.ts +9 -0
  488. package/dist/detectors/url-run-on.d.ts.map +1 -0
  489. package/dist/detectors/url-run-on.js +24 -0
  490. package/dist/detectors/url-run-on.js.map +1 -0
  491. package/dist/detectors/vague-figure-pointer.d.ts +10 -0
  492. package/dist/detectors/vague-figure-pointer.d.ts.map +1 -0
  493. package/dist/detectors/vague-figure-pointer.js +46 -0
  494. package/dist/detectors/vague-figure-pointer.js.map +1 -0
  495. package/dist/detectors/word-list.d.ts +2 -0
  496. package/dist/detectors/word-list.d.ts.map +1 -1
  497. package/dist/detectors/word-list.js +4 -1
  498. package/dist/detectors/word-list.js.map +1 -1
  499. package/dist/document-sections.d.ts +13 -0
  500. package/dist/document-sections.d.ts.map +1 -0
  501. package/dist/document-sections.js +32 -0
  502. package/dist/document-sections.js.map +1 -0
  503. package/dist/document.d.ts +20 -7
  504. package/dist/document.d.ts.map +1 -1
  505. package/dist/document.js +140 -125
  506. package/dist/document.js.map +1 -1
  507. package/dist/email-parts.d.ts +28 -0
  508. package/dist/email-parts.d.ts.map +1 -0
  509. package/dist/email-parts.js +230 -0
  510. package/dist/email-parts.js.map +1 -0
  511. package/dist/eval.d.ts +2 -1
  512. package/dist/eval.d.ts.map +1 -1
  513. package/dist/eval.js +16 -4
  514. package/dist/eval.js.map +1 -1
  515. package/dist/extension/document-view.d.ts +7 -0
  516. package/dist/extension/document-view.d.ts.map +1 -0
  517. package/dist/extension/document-view.js +91 -0
  518. package/dist/extension/document-view.js.map +1 -0
  519. package/dist/extension/failure-text.d.ts +5 -0
  520. package/dist/extension/failure-text.d.ts.map +1 -0
  521. package/dist/extension/failure-text.js +33 -0
  522. package/dist/extension/failure-text.js.map +1 -0
  523. package/dist/extension/import-default.d.ts +7 -0
  524. package/dist/extension/import-default.d.ts.map +1 -0
  525. package/dist/extension/import-default.js +21 -0
  526. package/dist/extension/import-default.js.map +1 -0
  527. package/dist/extension/load.d.ts +28 -0
  528. package/dist/extension/load.d.ts.map +1 -0
  529. package/dist/extension/load.js +51 -0
  530. package/dist/extension/load.js.map +1 -0
  531. package/dist/extension/module-detector.d.ts +21 -0
  532. package/dist/extension/module-detector.d.ts.map +1 -0
  533. package/dist/extension/module-detector.js +49 -0
  534. package/dist/extension/module-detector.js.map +1 -0
  535. package/dist/extension/plugin-load.d.ts +9 -0
  536. package/dist/extension/plugin-load.d.ts.map +1 -0
  537. package/dist/extension/plugin-load.js +68 -0
  538. package/dist/extension/plugin-load.js.map +1 -0
  539. package/dist/extension/plugin-name.d.ts +8 -0
  540. package/dist/extension/plugin-name.d.ts.map +1 -0
  541. package/dist/extension/plugin-name.js +22 -0
  542. package/dist/extension/plugin-name.js.map +1 -0
  543. package/dist/extension/plugin-parse.d.ts +41 -0
  544. package/dist/extension/plugin-parse.d.ts.map +1 -0
  545. package/dist/extension/plugin-parse.js +156 -0
  546. package/dist/extension/plugin-parse.js.map +1 -0
  547. package/dist/extension/problem-text.d.ts +5 -0
  548. package/dist/extension/problem-text.d.ts.map +1 -0
  549. package/dist/extension/problem-text.js +74 -0
  550. package/dist/extension/problem-text.js.map +1 -0
  551. package/dist/extension/real-path.d.ts +3 -0
  552. package/dist/extension/real-path.d.ts.map +1 -0
  553. package/dist/extension/real-path.js +8 -0
  554. package/dist/extension/real-path.js.map +1 -0
  555. package/dist/extension/returned-findings.d.ts +17 -0
  556. package/dist/extension/returned-findings.d.ts.map +1 -0
  557. package/dist/extension/returned-findings.js +48 -0
  558. package/dist/extension/returned-findings.js.map +1 -0
  559. package/dist/extension/rule-export.d.ts +13 -0
  560. package/dist/extension/rule-export.d.ts.map +1 -0
  561. package/dist/extension/rule-export.js +16 -0
  562. package/dist/extension/rule-export.js.map +1 -0
  563. package/dist/feedback/draft.d.ts +2 -0
  564. package/dist/feedback/draft.d.ts.map +1 -1
  565. package/dist/feedback/draft.js +3 -0
  566. package/dist/feedback/draft.js.map +1 -1
  567. package/dist/figure-references.d.ts +39 -0
  568. package/dist/figure-references.d.ts.map +1 -0
  569. package/dist/figure-references.js +113 -0
  570. package/dist/figure-references.js.map +1 -0
  571. package/dist/files.d.ts +2 -0
  572. package/dist/files.d.ts.map +1 -1
  573. package/dist/files.js +4 -0
  574. package/dist/files.js.map +1 -1
  575. package/dist/finding-order.d.ts +9 -0
  576. package/dist/finding-order.d.ts.map +1 -0
  577. package/dist/finding-order.js +3 -0
  578. package/dist/finding-order.js.map +1 -0
  579. package/dist/fix-plan/mode.d.ts +21 -0
  580. package/dist/fix-plan/mode.d.ts.map +1 -0
  581. package/dist/fix-plan/mode.js +16 -0
  582. package/dist/fix-plan/mode.js.map +1 -0
  583. package/dist/fix-plan/plan.d.ts +77 -0
  584. package/dist/fix-plan/plan.d.ts.map +1 -0
  585. package/dist/fix-plan/plan.js +100 -0
  586. package/dist/fix-plan/plan.js.map +1 -0
  587. package/dist/fix-plan/render.d.ts +6 -0
  588. package/dist/fix-plan/render.d.ts.map +1 -0
  589. package/dist/fix-plan/render.js +101 -0
  590. package/dist/fix-plan/render.js.map +1 -0
  591. package/dist/fix-plan/text.d.ts +35 -0
  592. package/dist/fix-plan/text.d.ts.map +1 -0
  593. package/dist/fix-plan/text.js +95 -0
  594. package/dist/fix-plan/text.js.map +1 -0
  595. package/dist/heading-label.d.ts +22 -0
  596. package/dist/heading-label.d.ts.map +1 -0
  597. package/dist/heading-label.js +50 -0
  598. package/dist/heading-label.js.map +1 -0
  599. package/dist/in-page-nav.d.ts +4 -1
  600. package/dist/in-page-nav.d.ts.map +1 -1
  601. package/dist/in-page-nav.js +53 -18
  602. package/dist/in-page-nav.js.map +1 -1
  603. package/dist/joined-view.d.ts.map +1 -1
  604. package/dist/joined-view.js +1 -0
  605. package/dist/joined-view.js.map +1 -1
  606. package/dist/language-sample.d.ts +2 -0
  607. package/dist/language-sample.d.ts.map +1 -0
  608. package/dist/language-sample.js +41 -0
  609. package/dist/language-sample.js.map +1 -0
  610. package/dist/levels.d.ts +5 -1
  611. package/dist/levels.d.ts.map +1 -1
  612. package/dist/levels.js +9 -0
  613. package/dist/levels.js.map +1 -1
  614. package/dist/line-paragraphs.d.ts +8 -0
  615. package/dist/line-paragraphs.d.ts.map +1 -1
  616. package/dist/line-paragraphs.js +33 -10
  617. package/dist/line-paragraphs.js.map +1 -1
  618. package/dist/link-line.d.ts +8 -0
  619. package/dist/link-line.d.ts.map +1 -0
  620. package/dist/link-line.js +12 -0
  621. package/dist/link-line.js.map +1 -0
  622. package/dist/long-vowel.d.ts +38 -0
  623. package/dist/long-vowel.d.ts.map +1 -0
  624. package/dist/long-vowel.js +78 -0
  625. package/dist/long-vowel.js.map +1 -0
  626. package/dist/markdown-node.d.ts +19 -0
  627. package/dist/markdown-node.d.ts.map +1 -0
  628. package/dist/markdown-node.js +6 -0
  629. package/dist/markdown-node.js.map +1 -0
  630. package/dist/markdown-read.d.ts +17 -0
  631. package/dist/markdown-read.d.ts.map +1 -0
  632. package/dist/markdown-read.js +37 -0
  633. package/dist/markdown-read.js.map +1 -0
  634. package/dist/markup.d.ts +22 -0
  635. package/dist/markup.d.ts.map +1 -0
  636. package/dist/markup.js +182 -0
  637. package/dist/markup.js.map +1 -0
  638. package/dist/mask.js +8 -5
  639. package/dist/mask.js.map +1 -1
  640. package/dist/name-variants.d.ts +25 -0
  641. package/dist/name-variants.d.ts.map +1 -0
  642. package/dist/name-variants.js +181 -0
  643. package/dist/name-variants.js.map +1 -0
  644. package/dist/node-version.d.ts +7 -0
  645. package/dist/node-version.d.ts.map +1 -0
  646. package/dist/node-version.js +19 -0
  647. package/dist/node-version.js.map +1 -0
  648. package/dist/not-run.d.ts +14 -0
  649. package/dist/not-run.d.ts.map +1 -0
  650. package/dist/not-run.js +12 -0
  651. package/dist/not-run.js.map +1 -0
  652. package/dist/number-name.d.ts +21 -5
  653. package/dist/number-name.d.ts.map +1 -1
  654. package/dist/number-name.js +119 -17
  655. package/dist/number-name.js.map +1 -1
  656. package/dist/orthography.d.ts +10 -1
  657. package/dist/orthography.d.ts.map +1 -1
  658. package/dist/orthography.js +42 -16
  659. package/dist/orthography.js.map +1 -1
  660. package/dist/outline/render.d.ts +18 -0
  661. package/dist/outline/render.d.ts.map +1 -0
  662. package/dist/outline/render.js +60 -0
  663. package/dist/outline/render.js.map +1 -0
  664. package/dist/outline/shape.d.ts +26 -0
  665. package/dist/outline/shape.d.ts.map +1 -0
  666. package/dist/outline/shape.js +37 -0
  667. package/dist/outline/shape.js.map +1 -0
  668. package/dist/outline/text.d.ts +21 -0
  669. package/dist/outline/text.d.ts.map +1 -0
  670. package/dist/outline/text.js +30 -0
  671. package/dist/outline/text.js.map +1 -0
  672. package/dist/page-furniture.d.ts +5 -2
  673. package/dist/page-furniture.d.ts.map +1 -1
  674. package/dist/page-furniture.js +8 -2
  675. package/dist/page-furniture.js.map +1 -1
  676. package/dist/plain-source.d.ts +1 -0
  677. package/dist/plain-source.d.ts.map +1 -1
  678. package/dist/plain-source.js +2 -1
  679. package/dist/plain-source.js.map +1 -1
  680. package/dist/plugin.d.ts +138 -1
  681. package/dist/plugin.d.ts.map +1 -1
  682. package/dist/profile/for-file.d.ts.map +1 -1
  683. package/dist/profile/for-file.js +3 -1
  684. package/dist/profile/for-file.js.map +1 -1
  685. package/dist/quoted-span.d.ts.map +1 -1
  686. package/dist/quoted-span.js +8 -3
  687. package/dist/quoted-span.js.map +1 -1
  688. package/dist/reasons.d.ts +4 -0
  689. package/dist/reasons.d.ts.map +1 -1
  690. package/dist/reasons.js +8 -0
  691. package/dist/reasons.js.map +1 -1
  692. package/dist/reference-lists.d.ts +3 -0
  693. package/dist/reference-lists.d.ts.map +1 -0
  694. package/dist/reference-lists.js +75 -0
  695. package/dist/reference-lists.js.map +1 -0
  696. package/dist/render/compact.d.ts +3 -1
  697. package/dist/render/compact.d.ts.map +1 -1
  698. package/dist/render/compact.js +8 -2
  699. package/dist/render/compact.js.map +1 -1
  700. package/dist/render/explain.d.ts +9 -1
  701. package/dist/render/explain.d.ts.map +1 -1
  702. package/dist/render/explain.js +54 -13
  703. package/dist/render/explain.js.map +1 -1
  704. package/dist/render/friendly.d.ts.map +1 -1
  705. package/dist/render/friendly.js +19 -9
  706. package/dist/render/friendly.js.map +1 -1
  707. package/dist/render/options.d.ts +7 -0
  708. package/dist/render/options.d.ts.map +1 -0
  709. package/dist/render/options.js +50 -0
  710. package/dist/render/options.js.map +1 -0
  711. package/dist/render/rules-json.d.ts +4 -1
  712. package/dist/render/rules-json.d.ts.map +1 -1
  713. package/dist/render/rules-json.js +110 -16
  714. package/dist/render/rules-json.js.map +1 -1
  715. package/dist/render/rules-table.d.ts +4 -0
  716. package/dist/render/rules-table.d.ts.map +1 -0
  717. package/dist/render/rules-table.js +70 -0
  718. package/dist/render/rules-table.js.map +1 -0
  719. package/dist/render/sarif.js +4 -4
  720. package/dist/render/sarif.js.map +1 -1
  721. package/dist/render/semantic.js +3 -3
  722. package/dist/render/semantic.js.map +1 -1
  723. package/dist/render/severity-name.d.ts +6 -0
  724. package/dist/render/severity-name.d.ts.map +1 -0
  725. package/dist/render/severity-name.js +7 -0
  726. package/dist/render/severity-name.js.map +1 -0
  727. package/dist/render/suppressions.d.ts +3 -0
  728. package/dist/render/suppressions.d.ts.map +1 -1
  729. package/dist/render/suppressions.js +20 -1
  730. package/dist/render/suppressions.js.map +1 -1
  731. package/dist/render/text.d.ts +7 -2
  732. package/dist/render/text.d.ts.map +1 -1
  733. package/dist/render/text.js +15 -4
  734. package/dist/render/text.js.map +1 -1
  735. package/dist/resolve-genre.d.ts +1 -1
  736. package/dist/resolve-genre.d.ts.map +1 -1
  737. package/dist/resolve-genre.js +4 -1
  738. package/dist/resolve-genre.js.map +1 -1
  739. package/dist/rule-genres.d.ts +24 -0
  740. package/dist/rule-genres.d.ts.map +1 -0
  741. package/dist/rule-genres.js +11 -0
  742. package/dist/rule-genres.js.map +1 -0
  743. package/dist/rule-guide.d.ts +73 -0
  744. package/dist/rule-guide.d.ts.map +1 -0
  745. package/dist/rule-guide.js +95 -0
  746. package/dist/rule-guide.js.map +1 -0
  747. package/dist/rule-load.d.ts.map +1 -1
  748. package/dist/rule-load.js +87 -33
  749. package/dist/rule-load.js.map +1 -1
  750. package/dist/rule-options.d.ts +50 -0
  751. package/dist/rule-options.d.ts.map +1 -0
  752. package/dist/rule-options.js +106 -0
  753. package/dist/rule-options.js.map +1 -0
  754. package/dist/run-semantic.d.ts.map +1 -1
  755. package/dist/run-semantic.js +2 -1
  756. package/dist/run-semantic.js.map +1 -1
  757. package/dist/run.d.ts +18 -1
  758. package/dist/run.d.ts.map +1 -1
  759. package/dist/run.js +80 -19
  760. package/dist/run.js.map +1 -1
  761. package/dist/sentence-shape.d.ts.map +1 -1
  762. package/dist/sentence-shape.js +4 -4
  763. package/dist/sentence-shape.js.map +1 -1
  764. package/dist/setting-problems.d.ts +2 -1
  765. package/dist/setting-problems.d.ts.map +1 -1
  766. package/dist/setting-problems.js +8 -1
  767. package/dist/setting-problems.js.map +1 -1
  768. package/dist/spacing-minority.d.ts +16 -0
  769. package/dist/spacing-minority.d.ts.map +1 -0
  770. package/dist/spacing-minority.js +23 -0
  771. package/dist/spacing-minority.js.map +1 -0
  772. package/dist/span-cut.d.ts +6 -0
  773. package/dist/span-cut.d.ts.map +1 -0
  774. package/dist/span-cut.js +22 -0
  775. package/dist/span-cut.js.map +1 -0
  776. package/dist/stet-block.d.ts +5 -0
  777. package/dist/stet-block.d.ts.map +1 -0
  778. package/dist/stet-block.js +59 -0
  779. package/dist/stet-block.js.map +1 -0
  780. package/dist/stet.d.ts +4 -0
  781. package/dist/stet.d.ts.map +1 -1
  782. package/dist/stet.js +31 -11
  783. package/dist/stet.js.map +1 -1
  784. package/dist/structure/aside-depth.d.ts +21 -0
  785. package/dist/structure/aside-depth.d.ts.map +1 -0
  786. package/dist/structure/aside-depth.js +65 -0
  787. package/dist/structure/aside-depth.js.map +1 -0
  788. package/dist/structure/build.d.ts +5 -1
  789. package/dist/structure/build.d.ts.map +1 -1
  790. package/dist/structure/build.js +29 -17
  791. package/dist/structure/build.js.map +1 -1
  792. package/dist/structure/closed-pairs.d.ts +8 -0
  793. package/dist/structure/closed-pairs.d.ts.map +1 -0
  794. package/dist/structure/closed-pairs.js +22 -0
  795. package/dist/structure/closed-pairs.js.map +1 -0
  796. package/dist/structure/date-range.d.ts +31 -0
  797. package/dist/structure/date-range.d.ts.map +1 -0
  798. package/dist/structure/date-range.js +77 -0
  799. package/dist/structure/date-range.js.map +1 -0
  800. package/dist/structure/definition-use.d.ts +32 -0
  801. package/dist/structure/definition-use.d.ts.map +1 -0
  802. package/dist/structure/definition-use.js +102 -0
  803. package/dist/structure/definition-use.js.map +1 -0
  804. package/dist/structure/known-mentions.d.ts +18 -0
  805. package/dist/structure/known-mentions.d.ts.map +1 -0
  806. package/dist/structure/known-mentions.js +78 -0
  807. package/dist/structure/known-mentions.js.map +1 -0
  808. package/dist/structure/lazy-tree.d.ts +8 -0
  809. package/dist/structure/lazy-tree.d.ts.map +1 -0
  810. package/dist/structure/lazy-tree.js +14 -0
  811. package/dist/structure/lazy-tree.js.map +1 -0
  812. package/dist/structure/modal-conflict.d.ts +28 -0
  813. package/dist/structure/modal-conflict.d.ts.map +1 -0
  814. package/dist/structure/modal-conflict.js +74 -0
  815. package/dist/structure/modal-conflict.js.map +1 -0
  816. package/dist/structure/numbered-clauses.d.ts +4 -0
  817. package/dist/structure/numbered-clauses.d.ts.map +1 -0
  818. package/dist/structure/numbered-clauses.js +9 -0
  819. package/dist/structure/numbered-clauses.js.map +1 -0
  820. package/dist/structure/numbering.d.ts +1 -0
  821. package/dist/structure/numbering.d.ts.map +1 -1
  822. package/dist/structure/numbering.js +11 -6
  823. package/dist/structure/numbering.js.map +1 -1
  824. package/dist/structure/of.d.ts +3 -1
  825. package/dist/structure/of.d.ts.map +1 -1
  826. package/dist/structure/of.js +5 -1
  827. package/dist/structure/of.js.map +1 -1
  828. package/dist/structure/percent-sum.d.ts +16 -0
  829. package/dist/structure/percent-sum.d.ts.map +1 -0
  830. package/dist/structure/percent-sum.js +104 -0
  831. package/dist/structure/percent-sum.js.map +1 -0
  832. package/dist/structure/quoted-number.d.ts +8 -0
  833. package/dist/structure/quoted-number.d.ts.map +1 -0
  834. package/dist/structure/quoted-number.js +34 -0
  835. package/dist/structure/quoted-number.js.map +1 -0
  836. package/dist/structure/relative-find.d.ts.map +1 -1
  837. package/dist/structure/relative-find.js +34 -46
  838. package/dist/structure/relative-find.js.map +1 -1
  839. package/dist/structure/relative-resolve.d.ts.map +1 -1
  840. package/dist/structure/relative-resolve.js +76 -30
  841. package/dist/structure/relative-resolve.js.map +1 -1
  842. package/dist/structure/runs.d.ts +2 -0
  843. package/dist/structure/runs.d.ts.map +1 -1
  844. package/dist/structure/runs.js +2 -2
  845. package/dist/structure/runs.js.map +1 -1
  846. package/dist/structure/sexp.d.ts +1 -1
  847. package/dist/structure/sexp.d.ts.map +1 -1
  848. package/dist/structure/sexp.js +18 -6
  849. package/dist/structure/sexp.js.map +1 -1
  850. package/dist/structure/total.d.ts +3 -0
  851. package/dist/structure/total.d.ts.map +1 -1
  852. package/dist/structure/total.js +2 -2
  853. package/dist/structure/total.js.map +1 -1
  854. package/dist/structure/universal.d.ts +14 -2
  855. package/dist/structure/universal.d.ts.map +1 -1
  856. package/dist/structure/universal.js +24 -3
  857. package/dist/structure/universal.js.map +1 -1
  858. package/dist/structure/wrapped-tail.d.ts +14 -7
  859. package/dist/structure/wrapped-tail.d.ts.map +1 -1
  860. package/dist/structure/wrapped-tail.js +33 -8
  861. package/dist/structure/wrapped-tail.js.map +1 -1
  862. package/dist/style-load.d.ts +4 -0
  863. package/dist/style-load.d.ts.map +1 -0
  864. package/dist/style-load.js +28 -0
  865. package/dist/style-load.js.map +1 -0
  866. package/dist/style-parse.d.ts +25 -0
  867. package/dist/style-parse.d.ts.map +1 -0
  868. package/dist/style-parse.js +88 -0
  869. package/dist/style-parse.js.map +1 -0
  870. package/dist/subheading-line.d.ts +23 -0
  871. package/dist/subheading-line.d.ts.map +1 -0
  872. package/dist/subheading-line.js +85 -0
  873. package/dist/subheading-line.js.map +1 -0
  874. package/dist/tag-coverage.d.ts +8 -0
  875. package/dist/tag-coverage.d.ts.map +1 -0
  876. package/dist/tag-coverage.js +7 -0
  877. package/dist/tag-coverage.js.map +1 -0
  878. package/dist/template-syntax.d.ts +17 -0
  879. package/dist/template-syntax.d.ts.map +1 -0
  880. package/dist/template-syntax.js +140 -0
  881. package/dist/template-syntax.js.map +1 -0
  882. package/dist/text-above.d.ts +19 -0
  883. package/dist/text-above.d.ts.map +1 -0
  884. package/dist/text-above.js +43 -0
  885. package/dist/text-above.js.map +1 -0
  886. package/dist/text-figures.d.ts +10 -0
  887. package/dist/text-figures.d.ts.map +1 -0
  888. package/dist/text-figures.js +131 -0
  889. package/dist/text-figures.js.map +1 -0
  890. package/dist/trailing-aside.d.ts +2 -0
  891. package/dist/trailing-aside.d.ts.map +1 -0
  892. package/dist/trailing-aside.js +53 -0
  893. package/dist/trailing-aside.js.map +1 -0
  894. package/dist/tree-walk.d.ts +18 -0
  895. package/dist/tree-walk.d.ts.map +1 -0
  896. package/dist/tree-walk.js +45 -0
  897. package/dist/tree-walk.js.map +1 -0
  898. package/genres.yaml +68 -0
  899. package/package.json +9 -3
  900. package/reference-headings.yaml +17 -0
  901. package/rules/acronym-expansion-conflict.yaml +82 -0
  902. package/rules/adverb-overuse.yaml +19 -0
  903. package/rules/agentless-passive.yaml +47 -0
  904. package/rules/agreement-slip.yaml +14 -1
  905. package/rules/ai-generated-composite.yaml +102 -0
  906. package/rules/ai-tell.yaml +57 -0
  907. package/rules/announced-count-mismatch.yaml +57 -0
  908. package/rules/announcing-opener.yaml +82 -0
  909. package/rules/assistant-residue.yaml +82 -0
  910. package/rules/bold-density.yaml +59 -0
  911. package/rules/bold-label-list.yaml +81 -0
  912. package/rules/broken-link.yaml +65 -0
  913. package/rules/closing-cliche.yaml +58 -0
  914. package/rules/colon-lead-in.yaml +83 -0
  915. package/rules/concrete-evidence-density.yaml +41 -0
  916. package/rules/contraction-consistency.yaml +18 -0
  917. package/rules/contrast-framing.yaml +88 -0
  918. package/rules/cushion-phrase-density.yaml +53 -1
  919. package/rules/dangling-figure-reference.yaml +61 -0
  920. package/rules/dangling-reference.yaml +54 -1
  921. package/rules/date-order.yaml +34 -1
  922. package/rules/date-range-reversed.yaml +46 -0
  923. package/rules/date-weekday-mismatch.yaml +17 -1
  924. package/rules/double-keigo.yaml +16 -0
  925. package/rules/double-negative.yaml +51 -0
  926. package/rules/doubled-punctuation.yaml +45 -0
  927. package/rules/doubled-word.yaml +18 -2
  928. package/rules/duplicate-definition.yaml +59 -1
  929. package/rules/duplicate-heading.yaml +78 -0
  930. package/rules/emoji-density.yaml +28 -2
  931. package/rules/empty-conclusion.yaml +28 -0
  932. package/rules/empty-intensifier.yaml +44 -0
  933. package/rules/empty-section.yaml +74 -0
  934. package/rules/excessive-hedging.yaml +49 -2
  935. package/rules/expletive-construction.yaml +19 -0
  936. package/rules/fullwidth-alnum-consistency.yaml +53 -0
  937. package/rules/hankaku-kana.yaml +41 -0
  938. package/rules/heading-echo.yaml +31 -0
  939. package/rules/heading-level-skip.yaml +78 -0
  940. package/rules/hiragana-fukushi.yaml +16 -0
  941. package/rules/image-alt-text.yaml +54 -0
  942. package/rules/internal-jargon.yaml +21 -0
  943. package/rules/invisible-character.yaml +63 -0
  944. package/rules/katakana-long-vowel.yaml +99 -0
  945. package/rules/kutoten-consistency.yaml +53 -0
  946. package/rules/latin-spacing.yaml +30 -4
  947. package/rules/max-kanji-continuous.yaml +17 -0
  948. package/rules/max-paragraph-length.yaml +34 -0
  949. package/rules/max-sentence-length.yaml +58 -0
  950. package/rules/modal-conflict.yaml +106 -0
  951. package/rules/name-variant.yaml +88 -0
  952. package/rules/ngram-repetition.yaml +29 -2
  953. package/rules/no-doubled-joshi.yaml +17 -0
  954. package/rules/no-em-dash.yaml +49 -0
  955. package/rules/no-mixed-desumasu.yaml +28 -2
  956. package/rules/no-nakaguro-parallel.yaml +20 -0
  957. package/rules/nominalization.yaml +89 -0
  958. package/rules/numbering-gap.yaml +53 -1
  959. package/rules/outside-announced-list.yaml +80 -0
  960. package/rules/oxford-comma-consistency.yaml +18 -0
  961. package/rules/padded-intro.yaml +44 -0
  962. package/rules/paragraph-length-variance.yaml +73 -0
  963. package/rules/percent-sum-mismatch.yaml +58 -0
  964. package/rules/preamble-length.yaml +56 -0
  965. package/rules/preferred-term.yaml +28 -0
  966. package/rules/proper-noun-density.yaml +37 -2
  967. package/rules/ra-nuki.yaml +43 -0
  968. package/rules/repeated-conjunction.yaml +47 -0
  969. package/rules/repeated-sentence-head.yaml +23 -0
  970. package/rules/required-sections.yaml +49 -0
  971. package/rules/requirement-modal.yaml +94 -0
  972. package/rules/requirement-smell.yaml +70 -0
  973. package/rules/risk-disclosure.yaml +22 -0
  974. package/rules/rule-of-three.yaml +143 -0
  975. package/rules/sasete-itadaku.yaml +18 -0
  976. package/rules/section-length-uniformity.yaml +113 -0
  977. package/rules/sentence-initial-conjunction-run.yaml +18 -0
  978. package/rules/sentence-rhythm.yaml +51 -0
  979. package/rules/space-before-punctuation.yaml +41 -0
  980. package/rules/spelling-consistency.yaml +47 -0
  981. package/rules/stock-transition.yaml +86 -0
  982. package/rules/stray-space.yaml +18 -0
  983. package/rules/taigen-dome-in-prose.yaml +33 -0
  984. package/rules/title-case-consistency.yaml +42 -0
  985. package/rules/total-mismatch.yaml +38 -1
  986. package/rules/unbalanced-bracket.yaml +56 -0
  987. package/rules/undefined-acronym.yaml +23 -0
  988. package/rules/unfilled-placeholder.yaml +50 -0
  989. package/rules/unqualified-superlative.yaml +20 -0
  990. package/rules/unsourced-number.yaml +16 -0
  991. package/rules/unused-definition.yaml +75 -0
  992. package/rules/url-run-on.yaml +45 -0
  993. package/rules/use-before-definition.yaml +77 -0
  994. package/rules/vague-figure-reference.yaml +66 -0
  995. package/skills/chaff/SKILL.md +171 -1
  996. package/src/acronym-expansions.ts +106 -0
  997. package/src/announced-count.ts +190 -0
  998. package/src/announced-list.ts +120 -0
  999. package/src/api.ts +154 -0
  1000. package/src/bare-url.ts +35 -0
  1001. package/src/baseline.ts +17 -1
  1002. package/src/body-section.ts +7 -0
  1003. package/src/calendar-number.ts +18 -4
  1004. package/src/cli-args.ts +6 -0
  1005. package/src/cli-text.ts +14 -15
  1006. package/src/cli.ts +93 -92
  1007. package/src/closing-paragraph.ts +24 -0
  1008. package/src/commands/compare.ts +73 -0
  1009. package/src/commands/document-commands.ts +19 -0
  1010. package/src/commands/eval.ts +22 -10
  1011. package/src/commands/facts.ts +33 -0
  1012. package/src/commands/feedback.ts +45 -7
  1013. package/src/commands/fix-plan.ts +53 -0
  1014. package/src/commands/outline.ts +49 -0
  1015. package/src/commands/read-document.ts +24 -0
  1016. package/src/commands/suppressions.ts +19 -0
  1017. package/src/commands/test.ts +3 -5
  1018. package/src/commands/tree.ts +41 -5
  1019. package/src/compare/atom.ts +33 -0
  1020. package/src/compare/clock-time.ts +89 -0
  1021. package/src/compare/distinct.ts +13 -0
  1022. package/src/compare/extract.ts +80 -0
  1023. package/src/compare/fact-key.ts +31 -0
  1024. package/src/compare/fact-text.ts +87 -0
  1025. package/src/compare/facts-render.ts +63 -0
  1026. package/src/compare/facts-text.ts +41 -0
  1027. package/src/compare/markup-atoms.ts +29 -0
  1028. package/src/compare/match.ts +105 -0
  1029. package/src/compare/outcome.ts +80 -0
  1030. package/src/compare/proper-nouns.ts +65 -0
  1031. package/src/compare/render.ts +102 -0
  1032. package/src/compare/spans.ts +17 -0
  1033. package/src/compare/text-atoms.ts +96 -0
  1034. package/src/compare/text.ts +121 -0
  1035. package/src/compare/tree-atoms.ts +80 -0
  1036. package/src/compare/written-names.ts +26 -0
  1037. package/src/config/load.ts +30 -0
  1038. package/src/config/option-problems.ts +72 -0
  1039. package/src/config/read.ts +8 -0
  1040. package/src/config/rule-problems.ts +12 -2
  1041. package/src/config/style.ts +55 -0
  1042. package/src/config/warnings.ts +13 -0
  1043. package/src/config/write.ts +18 -4
  1044. package/src/custom/bounded-match.ts +58 -0
  1045. package/src/custom/load.ts +23 -0
  1046. package/src/custom/module-path.ts +23 -0
  1047. package/src/custom/parse.ts +323 -0
  1048. package/src/custom/problems.ts +111 -0
  1049. package/src/custom/regex-safety.ts +118 -0
  1050. package/src/custom/token-pattern.ts +84 -0
  1051. package/src/detect-language.ts +1 -1
  1052. package/src/detect.ts +35 -2
  1053. package/src/detectors/acronym-context.ts +16 -4
  1054. package/src/detectors/ai-phrasing.ts +141 -0
  1055. package/src/detectors/announced-count.ts +25 -0
  1056. package/src/detectors/bold-label.ts +55 -0
  1057. package/src/detectors/broken-link.ts +90 -0
  1058. package/src/detectors/cited-name.ts +6 -5
  1059. package/src/detectors/cited-title.ts +96 -0
  1060. package/src/detectors/concrete-evidence.ts +3 -2
  1061. package/src/detectors/contrast-frame.ts +54 -0
  1062. package/src/detectors/custom.ts +89 -0
  1063. package/src/detectors/dangling-figure.ts +26 -0
  1064. package/src/detectors/definition-use.ts +41 -0
  1065. package/src/detectors/doubled-punctuation.ts +52 -0
  1066. package/src/detectors/doubled-word.ts +19 -4
  1067. package/src/detectors/duplicate-heading.ts +47 -0
  1068. package/src/detectors/empty-section.ts +21 -0
  1069. package/src/detectors/enumerated-runs.ts +13 -4
  1070. package/src/detectors/fullwidth-alnum.ts +118 -0
  1071. package/src/detectors/gram-furniture.ts +30 -0
  1072. package/src/detectors/gram-place.ts +9 -5
  1073. package/src/detectors/gram-windows.ts +31 -0
  1074. package/src/detectors/hankaku-kana.ts +38 -0
  1075. package/src/detectors/heading-case.ts +30 -2
  1076. package/src/detectors/heading-code-words.ts +35 -0
  1077. package/src/detectors/heading-echo.ts +8 -4
  1078. package/src/detectors/heading-level-skip.ts +19 -0
  1079. package/src/detectors/image-alt-text.ts +11 -0
  1080. package/src/detectors/index.ts +79 -1
  1081. package/src/detectors/invisible-character.ts +190 -0
  1082. package/src/detectors/kutoten-consistency.ts +96 -0
  1083. package/src/detectors/lead-in.ts +3 -1
  1084. package/src/detectors/lexicon-match.ts +41 -2
  1085. package/src/detectors/lexicon.ts +40 -13
  1086. package/src/detectors/list-item.ts +122 -0
  1087. package/src/detectors/list-items.ts +163 -0
  1088. package/src/detectors/list-lead-in.ts +33 -0
  1089. package/src/detectors/list-sentence.ts +198 -0
  1090. package/src/detectors/list-view.ts +157 -0
  1091. package/src/detectors/long-vowel.ts +82 -0
  1092. package/src/detectors/markup-finding.ts +39 -0
  1093. package/src/detectors/modal-conflict.ts +26 -0
  1094. package/src/detectors/name-numeral.ts +4 -2
  1095. package/src/detectors/name-variant.ts +15 -0
  1096. package/src/detectors/nominalization.ts +73 -0
  1097. package/src/detectors/orthography.ts +97 -41
  1098. package/src/detectors/outside-announced-list.ts +25 -0
  1099. package/src/detectors/oxford-comma.ts +179 -283
  1100. package/src/detectors/phrase-match.ts +27 -7
  1101. package/src/detectors/place-run.ts +7 -4
  1102. package/src/detectors/placeholder-text.ts +27 -0
  1103. package/src/detectors/quote-around.ts +9 -0
  1104. package/src/detectors/ra-nuki.ts +38 -0
  1105. package/src/detectors/register.ts +37 -10
  1106. package/src/detectors/requirement-modal.ts +67 -0
  1107. package/src/detectors/requirement-smell.ts +52 -0
  1108. package/src/detectors/roman-numeral.ts +3 -0
  1109. package/src/detectors/sentence-ending.ts +14 -7
  1110. package/src/detectors/sentence-length.ts +16 -5
  1111. package/src/detectors/signals.ts +80 -46
  1112. package/src/detectors/space-before-punctuation.ts +32 -0
  1113. package/src/detectors/spelling-variety.ts +81 -0
  1114. package/src/detectors/structure-tree.ts +47 -1
  1115. package/src/detectors/structure.ts +20 -7
  1116. package/src/detectors/superlative-comparison.ts +47 -0
  1117. package/src/detectors/superlative-name.ts +7 -4
  1118. package/src/detectors/superlative-scope.ts +8 -3
  1119. package/src/detectors/token-column.ts +149 -0
  1120. package/src/detectors/unbalanced-bracket.ts +153 -0
  1121. package/src/detectors/url-run-on.ts +33 -0
  1122. package/src/detectors/vague-figure-pointer.ts +58 -0
  1123. package/src/detectors/word-list.ts +6 -1
  1124. package/src/document-sections.ts +46 -0
  1125. package/src/document.ts +188 -173
  1126. package/src/email-parts.ts +269 -0
  1127. package/src/eval.ts +14 -4
  1128. package/src/extension/document-view.ts +109 -0
  1129. package/src/extension/failure-text.ts +46 -0
  1130. package/src/extension/import-default.ts +13 -0
  1131. package/src/extension/load.ts +97 -0
  1132. package/src/extension/module-detector.ts +61 -0
  1133. package/src/extension/plugin-load.ts +82 -0
  1134. package/src/extension/plugin-name.ts +26 -0
  1135. package/src/extension/plugin-parse.ts +229 -0
  1136. package/src/extension/problem-text.ts +103 -0
  1137. package/src/extension/real-path.ts +10 -0
  1138. package/src/extension/returned-findings.ts +62 -0
  1139. package/src/extension/rule-export.ts +23 -0
  1140. package/src/feedback/draft.ts +6 -0
  1141. package/src/figure-references.ts +173 -0
  1142. package/src/files.ts +5 -0
  1143. package/src/finding-order.ts +3 -0
  1144. package/src/fix-plan/mode.ts +34 -0
  1145. package/src/fix-plan/plan.ts +181 -0
  1146. package/src/fix-plan/render.ts +128 -0
  1147. package/src/fix-plan/text.ts +133 -0
  1148. package/src/heading-label.ts +55 -0
  1149. package/src/in-page-nav.ts +48 -19
  1150. package/src/joined-view.ts +1 -0
  1151. package/src/language-sample.ts +48 -0
  1152. package/src/levels.ts +14 -1
  1153. package/src/line-paragraphs.ts +52 -9
  1154. package/src/link-line.ts +13 -0
  1155. package/src/long-vowel.ts +109 -0
  1156. package/src/markdown-node.ts +19 -0
  1157. package/src/markdown-read.ts +44 -0
  1158. package/src/markup.ts +212 -0
  1159. package/src/mask.ts +8 -8
  1160. package/src/name-variants.ts +217 -0
  1161. package/src/node-version.ts +22 -0
  1162. package/src/not-run.ts +16 -0
  1163. package/src/number-name.ts +151 -24
  1164. package/src/orthography.ts +50 -14
  1165. package/src/outline/render.ts +85 -0
  1166. package/src/outline/shape.ts +72 -0
  1167. package/src/outline/text.ts +50 -0
  1168. package/src/page-furniture.ts +11 -2
  1169. package/src/plain-source.ts +2 -1
  1170. package/src/plugin.ts +120 -3
  1171. package/src/profile/for-file.ts +3 -1
  1172. package/src/quoted-span.ts +9 -3
  1173. package/src/reasons.ts +12 -0
  1174. package/src/reference-lists.ts +91 -0
  1175. package/src/render/compact.ts +13 -3
  1176. package/src/render/explain.ts +75 -14
  1177. package/src/render/friendly.ts +20 -9
  1178. package/src/render/options.ts +58 -0
  1179. package/src/render/rules-json.ts +140 -18
  1180. package/src/render/rules-table.ts +91 -0
  1181. package/src/render/sarif.ts +4 -4
  1182. package/src/render/semantic.ts +3 -3
  1183. package/src/render/severity-name.ts +10 -0
  1184. package/src/render/suppressions.ts +30 -2
  1185. package/src/render/text.ts +21 -7
  1186. package/src/resolve-genre.ts +4 -1
  1187. package/src/rule-genres.ts +25 -0
  1188. package/src/rule-guide.ts +173 -0
  1189. package/src/rule-load.ts +91 -34
  1190. package/src/rule-options.ts +131 -0
  1191. package/src/run-semantic.ts +2 -1
  1192. package/src/run.ts +105 -22
  1193. package/src/sentence-shape.ts +4 -5
  1194. package/src/setting-problems.ts +9 -1
  1195. package/src/spacing-minority.ts +27 -0
  1196. package/src/span-cut.ts +28 -0
  1197. package/src/stet-block.ts +60 -0
  1198. package/src/stet.ts +41 -15
  1199. package/src/structure/aside-depth.ts +67 -0
  1200. package/src/structure/build.ts +38 -19
  1201. package/src/structure/closed-pairs.ts +20 -0
  1202. package/src/structure/date-range.ts +117 -0
  1203. package/src/structure/definition-use.ts +130 -0
  1204. package/src/structure/known-mentions.ts +96 -0
  1205. package/src/structure/lazy-tree.ts +15 -0
  1206. package/src/structure/modal-conflict.ts +86 -0
  1207. package/src/structure/numbered-clauses.ts +11 -0
  1208. package/src/structure/numbering.ts +9 -5
  1209. package/src/structure/of.ts +11 -3
  1210. package/src/structure/percent-sum.ts +135 -0
  1211. package/src/structure/quoted-number.ts +36 -0
  1212. package/src/structure/relative-find.ts +34 -47
  1213. package/src/structure/relative-resolve.ts +77 -30
  1214. package/src/structure/runs.ts +2 -2
  1215. package/src/structure/sexp.ts +17 -5
  1216. package/src/structure/total.ts +2 -2
  1217. package/src/structure/universal.ts +33 -5
  1218. package/src/structure/wrapped-tail.ts +38 -13
  1219. package/src/style-load.ts +28 -0
  1220. package/src/style-parse.ts +112 -0
  1221. package/src/subheading-line.ts +106 -0
  1222. package/src/tag-coverage.ts +13 -0
  1223. package/src/template-syntax.ts +164 -0
  1224. package/src/text-above.ts +49 -0
  1225. package/src/text-figures.ts +147 -0
  1226. package/src/trailing-aside.ts +50 -0
  1227. package/src/tree-walk.ts +48 -0
  1228. package/styles/bunkacho.yaml +25 -0
  1229. package/styles/ieice.yaml +30 -0
  1230. package/styles/jis-z8301-2011.yaml +28 -0
  1231. package/styles/jis-z8301-2019.yaml +31 -0
  1232. package/styles/koyobun.yaml +35 -0
  1233. package/dist/legal-address.d.ts +0 -2
  1234. package/dist/legal-address.d.ts.map +0 -1
  1235. package/dist/legal-address.js +0 -16
  1236. package/dist/legal-address.js.map +0 -1
package/src/plugin.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  // 言語アダプタと genre pack が依存してよい唯一の面。spec §6。
2
2
  // ここに実装を置かない。型だけを置く。
3
3
 
4
+ import type { RuleGuide } from "./rule-guide.ts";
5
+
4
6
  export type Span = { readonly start: number; readonly end: number };
5
7
 
6
8
  /**
@@ -17,8 +19,15 @@ export type Sentence = {
17
19
  * tokens は全角どうしに挟まれた段落内の改行を除いた文字列から作るので、改行をまたぐ語の span は改行ごと覆い、surface より長い。
18
20
  */
19
21
  readonly wrapBreaks?: readonly Span[];
22
+ /**
23
+ * 文書と違う言語で書いた文(和文の中の英文、英文の中の和文)。adapter が入れる。無ければ文書の言語の文。
24
+ * 長さの rule はこの単位で数え、この言語の上限と比べる。
25
+ */
26
+ readonly embeddedLanguage?: EmbeddedLanguage;
20
27
  };
21
28
 
29
+ export type EmbeddedLanguage = { readonly id: string; readonly lengthUnit: LengthUnit };
30
+
22
31
  /**
23
32
  * 品詞は Universal Dependencies の UPOS に統一する。アダプタ独自の体系を露出させない。
24
33
  * features は UD の FEATS。「受動か」のように品詞だけでは足りず、かつ言語ごとに
@@ -53,6 +62,10 @@ export type LexiconEntry = {
53
62
  readonly instead_of?: string | undefined;
54
63
  /** 語が、かかる語のどちら側に立つか。語順が言語で違うものを語彙表が言う(範囲の「で」は前、"in" は後ろ)。 */
55
64
  readonly position?: "before" | "after" | undefined;
65
+ /** How to rewrite this one phrase, in the lexicon's language. chaff fix-plan prints it next to the rule's own direction. */
66
+ readonly rewrite?: string | undefined;
67
+ /** 語の組の名前。同じ組の語どうしだけを比べる rule が使う(対応する OS を言う語と、対応する言語を言う語を分ける)。 */
68
+ readonly group?: string | undefined;
56
69
  /** pattern を adapter が語に分けたもの。品詞が読めるときだけ core が入れる。語彙表を書く側は書かない。 */
57
70
  readonly tokens?: readonly Token[] | undefined;
58
71
  };
@@ -72,7 +85,11 @@ export type AdapterCapabilities = {
72
85
  };
73
86
 
74
87
  /** prepare に渡す要求。動く rule が要らないものの代金を払わせない。 */
75
- export type AdapterNeeds = { readonly pos: boolean };
88
+ export type AdapterNeeds = {
89
+ readonly pos: boolean;
90
+ /** Token features that cost the adapter extra work (LongVowelEnding asks the dictionary about each katakana word). Only the running rules' are asked for. */
91
+ readonly features?: readonly string[];
92
+ };
76
93
 
77
94
  export type LanguageAdapter = {
78
95
  readonly kind: "language";
@@ -175,8 +192,15 @@ export type StructurePatterns = {
175
192
  readonly continuesSentence?: (number: string, rest: string) => boolean;
176
193
  /** 数の書き方(「二十二」「3」)を数にする。相対の参照の「前二項」「前条第二項」が使う。 */
177
194
  readonly number?: (text: string) => number | undefined;
195
+ /** text の at のすぐ前に書いた文書の名前(「民法の」「…(平成二十年厚生労働省告示第五十九号)」「この規則の」)。名前が無ければ undefined。 */
196
+ readonly namedDocument?: DocumentNamer;
178
197
  };
179
198
 
199
+ /** 位置のすぐ前に書いた文書の名前。self はこの文書を指す名前(「この規則」「本規約」)。 */
200
+ export type NamedDocument = { readonly name: string; readonly self: boolean };
201
+
202
+ export type DocumentNamer = (text: string, at: number) => NamedDocument | undefined;
203
+
180
204
  export type StructureKind = "doc" | "section" | "chapter" | "article" | "item" | "definition" | "reference" | "obligation" | "quantity" | "date";
181
205
 
182
206
  /** 番地の付いた木の節点。すべて元の文書の位置(UTF-16)と行を持つ。 */
@@ -206,6 +230,8 @@ export type Section = {
206
230
  readonly heading: string;
207
231
  /** 見出しを文と同じ解析器で語に分けたもの。文が tokens を持つときだけ入る。 */
208
232
  readonly headingTokens?: readonly Token[];
233
+ /** 見出しの頭の番号の札(「例 3:」「1.」「第2章」「Step 3:」)を除いた題。札が無ければ見出しのまま。 */
234
+ readonly unlabeledHeading?: string;
209
235
  readonly span: Span;
210
236
  readonly sentences: readonly Sentence[];
211
237
  /** この節に含まれる強調(Markdown の ** **)の数。 */
@@ -216,8 +242,8 @@ export type Section = {
216
242
 
217
243
  export type Paragraph = { readonly span: Span; readonly sentences: readonly Sentence[] };
218
244
 
219
- /** 箇条書き 1 つ。項目は項目の文字数で持つ。長さのばらつきしか見ないため。 */
220
- export type BulletList = { readonly span: Span; readonly items: readonly number[] };
245
+ /** 箇条書き 1 つ。items は項目の文字数(空白を除く)、itemSpans は同じ順の項目の範囲。 */
246
+ export type BulletList = { readonly span: Span; readonly items: readonly number[]; readonly itemSpans: readonly Span[] };
221
247
 
222
248
  /**
223
249
  * detector に渡る唯一の入り口。core が I/O を済ませてから呼ぶ。
@@ -324,6 +350,36 @@ export type ProseDocument = {
324
350
  readonly profile?: DocumentProfile | undefined;
325
351
  /** 本文でないもの(コード・HTML・強調の印)を同じ長さの空白で覆った source。位置は source と同じ。 */
326
352
  readonly prose?: string | undefined;
353
+ /** 位置のすぐ前に書いた文書の名前を読む。言語パッケージが読めなければ無い。 */
354
+ readonly namedDocument?: DocumentNamer | undefined;
355
+ /** メールの引用した返信(前置きの行と「> 」の行)。ほかの人の言葉なので、見出しにも木にも入れない。 */
356
+ readonly replyQuotes?: readonly Span[] | undefined;
357
+ /** 記法の手がかり(見出し・画像・リンク)。記法を読む rule だけが触れ、触れたときに作る。 */
358
+ readonly markup?: Markup | undefined;
359
+ };
360
+
361
+ /** 見出し 1 つ。text は属性(`{#id}`)を外した言葉。 */
362
+ export type MarkupHeading = { readonly depth: number; readonly text: string; readonly start: number; readonly end: number };
363
+
364
+ /** 画像 1 つ。alt は代替テキスト。HTML の `<img>` で alt 属性が無ければ undefined。 */
365
+ export type MarkupImage = { readonly alt: string | undefined; readonly start: number; readonly end: number };
366
+
367
+ /** リンクの行き先 1 つ(`[text](url)` と、参照の定義 `[label]: url`)。 */
368
+ export type MarkupLink = { readonly destination: string; readonly start: number; readonly end: number };
369
+
370
+ /**
371
+ * 文書の記法。Markdown でない文書(.txt)は markdown が false で、見出し・画像・リンクを持たず、texts が文書全体。
372
+ * 位置はすべて doc.source の上。
373
+ */
374
+ export type Markup = {
375
+ readonly markdown: boolean;
376
+ readonly headings: readonly MarkupHeading[];
377
+ readonly images: readonly MarkupImage[];
378
+ readonly links: readonly MarkupLink[];
379
+ /** 書き手が付けたページ内の名前(見出しの `{#id}`、HTML の id と name)。 */
380
+ readonly ids: ReadonlySet<string>;
381
+ /** 読み手に字のまま見える範囲(リンクの外のテキスト)。 */
382
+ readonly texts: readonly Span[];
327
383
  };
328
384
 
329
385
  export type Severity = "error" | "warning" | "info";
@@ -350,6 +406,29 @@ export type DetectorOptions = {
350
406
  readonly where?: string | undefined;
351
407
  /** 普通の長さの文 1 つの長さ(adapter の単位)。段落の長さを文の数と一緒に見る rule だけが持つ。 */
352
408
  readonly fullSentence?: number | undefined;
409
+ /** 文書と違う言語で書いた文の上限。その言語の段から解決済み。rule がその言語の段を持たなければ無い。 */
410
+ readonly embeddedLimits?: Readonly<Record<string, number>> | undefined;
411
+ /** The rule's options (RuleDefinition.options), each at the value the settings chose or its default. Only a rule with options has them. */
412
+ readonly settings?: Readonly<Record<string, OptionValue>> | undefined;
413
+ /** A custom rule's spec (RuleDefinition.custom). */
414
+ readonly custom?: CustomSpec | undefined;
415
+ };
416
+
417
+ /** The value of one rule option: a choice, a count, or a list of words. */
418
+ export type OptionValue = string | number | readonly string[];
419
+
420
+ /**
421
+ * One option a rule takes, beyond its level. The rule's YAML declares it; a team sets it under options in chaff.yaml.
422
+ * choice takes one of choices, count a whole number of 1 or more, words a list of words.
423
+ */
424
+ export type RuleOption = {
425
+ readonly kind: "choice" | "count" | "words";
426
+ readonly choices: readonly string[];
427
+ readonly default: OptionValue;
428
+ /** What the option decides, in plain words. */
429
+ readonly about: Localized;
430
+ /** What each choice means, in plain words. Only a choice has them. */
431
+ readonly choiceNames: Readonly<Record<string, Localized>>;
353
432
  };
354
433
 
355
434
  export type Detector = (doc: ProseDocument, options: DetectorOptions) => Finding[];
@@ -360,6 +439,10 @@ export type Level = "strict" | "normal" | "relaxed" | "off";
360
439
 
361
440
  export type LevelTable = Readonly<Partial<Record<Exclude<Level, "off">, number>>>;
362
441
 
442
+ export type LevelSets = "limit" | "severity";
443
+
444
+ export type LanguageLevels = { readonly levels: LevelTable; readonly by_genre: Readonly<Record<string, LevelTable>> };
445
+
363
446
  export type RuleDefinition = {
364
447
  readonly id: string;
365
448
  readonly layer: "L1" | "L2" | "L3" | "L4";
@@ -370,11 +453,17 @@ export type RuleDefinition = {
370
453
  readonly message: Localized;
371
454
  /** 見つけ方ごとの message(Finding の variant で引く)。ほとんどの rule は持たない。 */
372
455
  readonly messages: Readonly<Record<string, Localized>>;
456
+ /** How a placeholder in name, why or how_to_fix reads where no finding fills it (explain, the rule reference). */
457
+ readonly placeholders?: Readonly<Record<string, Localized>>;
373
458
  /** 4 語と数値の対応。2 つ以上。未定義の段は normal に落ちる。spec §18.1。
374
459
  * 言語別の閾値を持つ rule(max-sentence-length)は、読み込み時に言語で平坦化済み。 */
375
460
  readonly levels: LevelTable;
461
+ /** What a level changes: the limit a detector counts to, or, for a rule with nothing to count, the severity of its findings. */
462
+ readonly level_sets: LevelSets;
376
463
  /** ジャンル別の上書き。"business" は business/* 全部に効き、"business/email" が勝つ。spec §9。 */
377
464
  readonly by_genre: Readonly<Record<string, LevelTable>>;
465
+ /** 読み込んだ言語以外の levels と by_genre。文書と違う言語で書いた文(和文の中の英文)の上限に使う。 */
466
+ readonly other_languages?: Readonly<Record<string, LanguageLevels>>;
378
467
  readonly how_to_find: string;
379
468
  readonly word_list: string | undefined;
380
469
  /** word_list のほかに detector が名前で引く語彙表。どれかが無い言語では rule を動かさない。 */
@@ -388,10 +477,38 @@ export type RuleDefinition = {
388
477
  readonly requires: readonly string[];
389
478
  /** 使えるなら用意してほしい capability("pos")。requires と違い、満たせなくても動かす(品詞が無ければ文字だけで見る)。 */
390
479
  readonly uses: readonly string[];
480
+ /** Token features the rule reads that the adapter computes only when asked (AdapterNeeds.features). */
481
+ readonly token_features?: readonly string[];
391
482
  /** 複合シグナル。ここに並べた rule のうち何本が出たかを見る。spec §20.2。 */
392
483
  readonly from: readonly string[];
393
484
  /** 動かす言語。未指定は全言語。「ですます調」のように言語に固有の rule が使う。 */
394
485
  readonly languages: readonly string[] | undefined;
395
486
  readonly use_for: readonly string[];
396
487
  readonly severity: Severity;
488
+ /** Options beyond the level (the direction and length for katakana-long-vowel). Most rules have none. */
489
+ readonly options?: Readonly<Record<string, RuleOption>>;
490
+ /** A rule a team defined under custom_rules in chaff.yaml, or a plugin ships: what it looks for. Built-in rules have none. */
491
+ readonly custom?: CustomSpec;
492
+ /** The name of the plugin that ships the rule, which is also its id's prefix (foo in foo/rule-id). Only a plugin's rules have it. */
493
+ readonly plugin?: string;
494
+ /** What the rule reference tells a reader who is not an engineer: its group, one line, a before and after. */
495
+ readonly guide?: RuleGuide;
496
+ };
497
+
498
+ /** One token's condition in a custom rule's run of tokens. Each part written must hold; pos lists the tags that match. */
499
+ export type TokenCondition = {
500
+ readonly pos?: readonly string[] | undefined;
501
+ readonly base?: string | undefined;
502
+ readonly surface?: string | undefined;
397
503
  };
504
+
505
+ /**
506
+ * What a team's rule looks for. words: spellings to avoid, each with the one to use (or none, to only point at it).
507
+ * pattern: a regular expression, checked before it runs. tokens: a run of tokens from the language adapter.
508
+ * module: a detector the team wrote in JavaScript; module as written in chaff.yaml, file where it resolved to.
509
+ */
510
+ export type CustomSpec =
511
+ | { readonly type: "words"; readonly words: readonly { readonly avoid: string; readonly use: string }[] }
512
+ | { readonly type: "pattern"; readonly pattern: string; readonly flags: string }
513
+ | { readonly type: "tokens"; readonly tokens: readonly TokenCondition[] }
514
+ | { readonly type: "module"; readonly module: string; readonly file: string };
@@ -4,6 +4,7 @@ import type { DocumentProfile } from "../plugin.ts";
4
4
  import { presetProfile } from "../genre-load.ts";
5
5
  import { loadProfiles } from "./load.ts";
6
6
  import { chooseProfile } from "./select.ts";
7
+ import { plainSource } from "../plain-source.ts";
7
8
 
8
9
  type ProfileSettings = Pick<Config, "profile" | "byPath" | "baseDir">;
9
10
 
@@ -13,6 +14,7 @@ export const profileFor = (config: ProfileSettings, path: string, source: string
13
14
  byPath: applyByPath(config.byPath, config.baseDir, path).profile,
14
15
  config: config.profile,
15
16
  genre: genre === undefined ? undefined : presetProfile(genre),
16
- source,
17
+ // 行頭で数える検出は、CR だけの改行では 1 行に見える。
18
+ source: plainSource(source),
17
19
  language,
18
20
  })?.profile;
@@ -13,15 +13,21 @@ const KAGI_MARKS: Marks = { "「": "」", "『": "』" };
13
13
  export const QUOTATION_MARKS: Marks = { ...KAGI_MARKS, "“": "”", '"': '"' };
14
14
 
15
15
  type Open = { readonly closer: string; readonly at: number };
16
- type Scan = { readonly open: readonly Open[]; readonly spans: readonly Span[] };
16
+ /** 1 回の読みの中だけで足し引きする。字ごとに配列を作り直すと、括弧が何万もある文で二乗に遅くなる。 */
17
+ type Scan = { readonly open: Open[]; readonly spans: Span[] };
17
18
 
18
19
  const step =
19
20
  (marks: Marks) =>
20
21
  (scan: Scan, char: string, at: number): Scan => {
21
22
  const last = scan.open.at(-1);
22
- if (last !== undefined && last.closer === char) return { open: scan.open.slice(0, -1), spans: [...scan.spans, { start: last.at + 1, end: at }] };
23
+ if (last !== undefined && last.closer === char) {
24
+ scan.open.pop();
25
+ scan.spans.push({ start: last.at + 1, end: at });
26
+ return scan;
27
+ }
23
28
  const closer = marks[char];
24
- return closer === undefined ? scan : { open: [...scan.open, { closer, at }], spans: scan.spans };
29
+ if (closer !== undefined) scan.open.push({ closer, at });
30
+ return scan;
25
31
  };
26
32
 
27
33
  /**
package/src/reasons.ts CHANGED
@@ -6,6 +6,7 @@ export type Reasons = {
6
6
  readonly otherLanguage: (language: string) => string;
7
7
  readonly noCapability: (capability: string) => string;
8
8
  readonly noTags: string;
9
+ readonly unreadTags: string;
9
10
  readonly semantic: string;
10
11
  readonly experimental: string;
11
12
  readonly turnedOff: string;
@@ -14,6 +15,9 @@ export type Reasons = {
14
15
  readonly unreadStructure: (clauses: number, units: number) => string;
15
16
  readonly noDetector: (name: string) => string;
16
17
  readonly noLexicon: (language: string, list: string) => string;
18
+ readonly noHeadings: string;
19
+ readonly patternTimeout: (budgetMs: number) => string;
20
+ readonly notMarkdown: string;
17
21
  };
18
22
 
19
23
  const CAPABILITY_NAME: Texts<Readonly<Record<string, string>>> = {
@@ -26,6 +30,7 @@ export const REASONS: Texts<Reasons> = {
26
30
  otherLanguage: (language) => `${language} 向けの rule ではないため`,
27
31
  noCapability: (capability) => `この言語では${CAPABILITY_NAME.ja[capability] ?? capability}が使えないため`,
28
32
  noTags: "アダプタが品詞を返さなかったため",
33
+ unreadTags: "言語のパッケージがこの文書を読めなかったため(品詞の取れない段落があります)",
29
34
  semantic: "意味を読む検査のため(npx chaff test で動きます)",
30
35
  experimental: "まだ試験中のため",
31
36
  turnedOff: "設定で止めているため",
@@ -35,11 +40,15 @@ export const REASONS: Texts<Reasons> = {
35
40
  `条項の番号が本文に ${String(clauses)} 個あるのに、番号として読めたのは ${String(units)} 個のため(深い字下げや、行が本文につながった文書)`,
36
41
  noDetector: (name) => `検出器 ${name} がないため`,
37
42
  noLexicon: (language, list) => `${language} の語彙表 ${list} が無いため`,
43
+ noHeadings: "表題より下の見出しが無いため",
44
+ patternTimeout: (budgetMs) => `正規表現が ${String(budgetMs)} ms で終わらなかったため(chaff.yaml の pattern を単純にしてください)`,
45
+ notMarkdown: "Markdown の文書ではないため",
38
46
  },
39
47
  en: {
40
48
  otherLanguage: (language) => `not a rule for ${language}`,
41
49
  noCapability: (capability) => `${CAPABILITY_NAME.en[capability] ?? capability} is not available for this language`,
42
50
  noTags: "the language package returned no parts of speech",
51
+ unreadTags: "the language package could not read this document (some paragraphs have no parts of speech)",
43
52
  semantic: "it reads meaning; npx chaff test runs it",
44
53
  experimental: "still experimental",
45
54
  turnedOff: "turned off in the settings",
@@ -49,5 +58,8 @@ export const REASONS: Texts<Reasons> = {
49
58
  `the text has ${String(clauses)} clause numbers but only ${String(units)} ${formFor(units, "was read as a numbered line", "were read as numbered lines")} (deep indents, or lines run into the text)`,
50
59
  noDetector: (name) => `no detector named ${name}`,
51
60
  noLexicon: (language, list) => `the ${language} package has no word list ${list}`,
61
+ noHeadings: "the document has no headings below its title",
62
+ patternTimeout: (budgetMs) => `the pattern did not finish within ${String(budgetMs)} ms (simplify the pattern in chaff.yaml)`,
63
+ notMarkdown: "the document is not Markdown",
52
64
  },
53
65
  };
@@ -0,0 +1,91 @@
1
+ import type { Span } from "./plugin.ts";
2
+
3
+ /**
4
+ * 文献一覧の範囲。見出しの語(参考文献、References)で見つけ、構造で範囲を決める。
5
+ * Markdown の見出しなら、次の同じ深さか浅い見出しまで。見出しの語だけの段落(HTML から写した文書)なら、すぐ後に続く箇条書きだけ。
6
+ * 箇条書きが続かなければ文献一覧とは言えないので、何も返さない。
7
+ */
8
+ type Line = { readonly text: string; readonly start: number; readonly end: number };
9
+
10
+ const ATX_HEADING = /^ {0,3}(#{1,6})(?:[ \t](.*))?$/u;
11
+ // 文献の番号(- [1]、1.、[1])で始まる行。
12
+ const LIST_ITEM = /^ {0,3}(?:[-*+]|\d{1,4}[.)]|\[\d{1,4}\])[ \t]/u;
13
+ const CONTINUATION = /^[ \t]+\S/u;
14
+ // 見出しの前の節番号(7.、7.1、VII.)、周りの強調、後ろの閉じの # とコロン。
15
+ const SECTION_NUMBER = /^(?:\d+(?:\.\d+)*\.?|[IVXLC]+\.)\s+/u;
16
+ const EMPHASIS_MARKS = ["**", "__"] as const;
17
+ const CLOSING = new Set([" ", "\t", "#", ":", ":"]);
18
+
19
+ const withoutClosing = (text: string): string => {
20
+ const characters = [...text];
21
+ return characters.slice(0, characters.findLastIndex((character) => !CLOSING.has(character)) + 1).join("");
22
+ };
23
+
24
+ const linesOf = (source: string): Line[] =>
25
+ source.split("\n").reduce<Line[]>((lines, text) => {
26
+ const start = (lines.at(-1)?.end ?? -1) + 1;
27
+ lines.push({ text, start, end: start + text.length });
28
+ return lines;
29
+ }, []);
30
+
31
+ const withoutEmphasis = (text: string): string => {
32
+ const mark = EMPHASIS_MARKS.find((candidate) => text.length > candidate.length * 2 && text.startsWith(candidate) && text.endsWith(candidate));
33
+ return mark === undefined ? text : text.slice(mark.length, -mark.length);
34
+ };
35
+
36
+ const isBlank = (line: Line | undefined): boolean => line === undefined || line.text.trim() === "";
37
+
38
+ const headingWord = (text: string): string => {
39
+ const plain = withoutEmphasis(withoutClosing(text).trim());
40
+ return withoutClosing(plain.replace(SECTION_NUMBER, "")).trim().toLowerCase();
41
+ };
42
+
43
+ const levelOf = (line: Line): number | undefined => ATX_HEADING.exec(line.text)?.[1]?.length;
44
+
45
+ /** from 以降で最初に test を満たす行。無ければ lines.length。先頭から数え直すと、見出しの多い文書で行数の 2 乗になる。 */
46
+ const firstFrom = (lines: readonly Line[], from: number, test: (line: Line) => boolean): number => {
47
+ for (let index = from; index < lines.length; index += 1) {
48
+ const line = lines[index];
49
+ if (line !== undefined && test(line)) return index;
50
+ }
51
+ return lines.length;
52
+ };
53
+
54
+ /** Markdown の見出しの節の終わり: 次の同じ深さか浅い見出しの手前。無ければ文書の終わり。 */
55
+ const sectionEnd = (lines: readonly Line[], at: number, level: number): number =>
56
+ firstFrom(lines, at + 1, (line) => (levelOf(line) ?? Number.POSITIVE_INFINITY) <= level);
57
+
58
+ const isOutsideList = (line: Line): boolean => !isBlank(line) && !LIST_ITEM.test(line.text) && !CONTINUATION.test(line.text);
59
+
60
+ /** from の後の最初の中身の行から続く箇条書きの終わり(最後の中身の行の次)。最初の中身が項目でなければ from。 */
61
+ const listEnd = (lines: readonly Line[], from: number): number => {
62
+ const first = firstFrom(lines, from, (line) => !isBlank(line));
63
+ if (!LIST_ITEM.test(lines[first]?.text ?? "")) return from;
64
+ const stop = firstFrom(lines, first + 1, isOutsideList);
65
+ return first + lines.slice(first, stop).findLastIndex((line) => !isBlank(line)) + 1;
66
+ };
67
+
68
+ const standsAlone = (lines: readonly Line[], at: number): boolean => (at === 0 || isBlank(lines[at - 1])) && isBlank(lines[at + 1]);
69
+
70
+ /** 見出しの行 at から、文献一覧の終わりの行(含まない)。文献一覧の見出しでなければ undefined。 */
71
+ const blockEnd = (lines: readonly Line[], at: number, headings: ReadonlySet<string>): number | undefined => {
72
+ const line = lines[at];
73
+ if (line === undefined) return undefined;
74
+ const level = levelOf(line);
75
+ if (level !== undefined) return headings.has(headingWord(ATX_HEADING.exec(line.text)?.[2] ?? "")) ? sectionEnd(lines, at, level) : undefined;
76
+ if (!headings.has(headingWord(line.text)) || !standsAlone(lines, at)) return undefined;
77
+ const end = listEnd(lines, at + 1);
78
+ return end === at + 1 ? undefined : end;
79
+ };
80
+
81
+ export const referenceListSpans = (source: string, headingWords: readonly string[]): Span[] => {
82
+ const headings = new Set(headingWords.map((word) => word.toLowerCase()));
83
+ const lines = linesOf(source);
84
+ const spans: Span[] = [];
85
+ lines.forEach((line, at) => {
86
+ if ((spans.at(-1)?.end ?? -1) >= line.start) return;
87
+ const end = blockEnd(lines, at, headings);
88
+ if (end !== undefined) spans.push({ start: line.start, end: lines[end - 1]?.end ?? line.end });
89
+ });
90
+ return spans;
91
+ };
@@ -1,4 +1,4 @@
1
- import type { RuleDefinition } from "../plugin.ts";
1
+ import type { Finding, RuleDefinition } from "../plugin.ts";
2
2
  import type { RunResult } from "../run.ts";
3
3
  import { messageOf } from "./text.ts";
4
4
  import { counted } from "./plural.ts";
@@ -12,14 +12,24 @@ const TALLY: Texts<{ readonly findings: (n: number) => string; readonly notRun:
12
12
  en: { findings: (n) => counted(n, "finding"), notRun: (n) => `${counted(n, "rule")} not run`, separator: ", " },
13
13
  };
14
14
 
15
+ const POSITION_MIN_WIDTH = 8;
16
+ const SEVERITY_WIDTH = 8;
17
+
18
+ const positionOf = (finding: Finding): string => `${String(finding.line)}:${String(finding.column)}`;
19
+
20
+ /** 「行:桁」の列の幅。一番長い位置の後ろにも空白を 1 つ残す。grep や awk が重さの語と区切れるように。 */
21
+ export const positionWidthOf = (findings: readonly Finding[]): number =>
22
+ findings.reduce((width, finding) => Math.max(width, positionOf(finding).length + 1), POSITION_MIN_WIDTH);
23
+
15
24
  /** エンジニア向け。1 件 2 行。 */
16
25
  export const renderCompact = (header: string, result: RunResult, rules: readonly RuleDefinition[], language: string): string => {
17
26
  const byId = new Map(rules.map((rule) => [rule.id, rule]));
27
+ const width = positionWidthOf(result.findings);
18
28
  const lines = result.findings.flatMap((finding) => {
19
29
  const rule = byId.get(finding.rule);
20
30
  if (rule === undefined) return [];
21
- const at = `${finding.line}:${finding.column}`.padEnd(8);
22
- return [` ${at}${finding.severity.padEnd(8)}${messageOf(rule, finding, language)}`, ` ${" ".repeat(8)}${finding.rule}`];
31
+ const message = ` ${positionOf(finding).padEnd(width)}${finding.severity.padEnd(SEVERITY_WIDTH)}${messageOf(rule, finding, language)}`;
32
+ return [message, ` ${" ".repeat(width + SEVERITY_WIDTH)}${finding.rule}`];
23
33
  });
24
34
  const text = TALLY[uiLanguageOf(language)];
25
35
  const tail = [text.findings(result.findings.length), result.skipped.length > 0 ? text.notRun(result.skipped.length) : undefined].filter(
@@ -1,7 +1,10 @@
1
- import { definedLevels, resolve } from "../levels.ts";
2
- import { localized } from "./text.ts";
1
+ import { definedLevels, resolve, severityAt } from "../levels.ts";
2
+ import { fill, localized, readableText } from "./text.ts";
3
+ import { SEVERITY_NAME } from "./severity-name.ts";
3
4
  import { uiLanguageOf, type Texts } from "../ui.ts";
4
5
  import type { Level, RuleDefinition } from "../plugin.ts";
6
+ import { optionLines } from "./options.ts";
7
+ import type { OptionLayer } from "../rule-options.ts";
5
8
 
6
9
  const TEXT: Texts<{
7
10
  readonly off: string;
@@ -9,8 +12,14 @@ const TEXT: Texts<{
9
12
  readonly genreNote: (genre: string, others: string) => string;
10
13
  readonly experimental: string;
11
14
  readonly howToFix: string;
12
- readonly values: (unit: string) => string;
15
+ readonly example: string;
16
+ readonly definedIn: (plugin: string | undefined) => string;
17
+ readonly values: string;
18
+ readonly times: string;
19
+ readonly severities: string;
13
20
  readonly now: (level: string) => string;
21
+ readonly nowNumber: (limit: string) => string;
22
+ readonly from: (source: string) => string;
14
23
  readonly change: (id: string) => string;
15
24
  }> = {
16
25
  ja: {
@@ -19,8 +28,15 @@ const TEXT: Texts<{
19
28
  genreNote: (genre, others) => `この数字は ${genre} のものです。ほかに ${others} で別の数字を持っています。`,
20
29
  experimental: "このルールはまだ試験中で、既定では動きません(--experimental で動きます)。",
21
30
  howToFix: "直しかた",
22
- values: (unit) => `設定できる値(単位: ${unit}):`,
31
+ example: "例",
32
+ definedIn: (plugin) =>
33
+ plugin === undefined ? "このルールはチームが chaff.yaml の custom_rules で決めたものです。" : `このルールはプラグイン ${plugin} のものです。`,
34
+ values: "設定できる値:",
35
+ times: "回",
36
+ severities: "設定できる値(数える上限は無く、指摘の重さが変わります):",
23
37
  now: (level) => `いまは ${level} です。`,
38
+ nowNumber: (limit) => `いまは段階ではなく数です: ${limit}。`,
39
+ from: (source) => `(${source} で決めています)`,
24
40
  change: (id) => `変える: npx chaff relax ${id} --why "理由"`,
25
41
  },
26
42
  en: {
@@ -29,16 +45,39 @@ const TEXT: Texts<{
29
45
  genreNote: (genre, others) => `These numbers are for ${genre}. ${others} have numbers of their own.`,
30
46
  experimental: "This rule is still experimental and does not run by default (--experimental runs it).",
31
47
  howToFix: "How to fix",
32
- values: (unit) => `Levels (unit: ${unit}):`,
48
+ example: "Example",
49
+ definedIn: (plugin) =>
50
+ plugin === undefined ? "The team defined this rule under custom_rules in chaff.yaml." : `This rule comes from the plugin ${plugin}.`,
51
+ values: "Levels:",
52
+ times: "times",
53
+ severities: "Levels (there is no limit to count to; a level sets how a finding is marked):",
33
54
  now: (level) => `Now: ${level}.`,
55
+ nowNumber: (limit) => `Now: ${limit}, set as a number rather than a level.`,
56
+ from: (source) => ` (set by ${source})`,
34
57
  change: (id) => `Change it: npx chaff relax ${id} --why "reason"`,
35
58
  },
36
59
  };
37
60
 
38
- const levelLine = (rule: RuleDefinition, level: Level, current: Level, genre: string | undefined, off: string): string => {
61
+ /**
62
+ * A limit in the rule's words for what it counts ("up to 8 emoji per 1000 words"), as the rule reference shows it.
63
+ * A rule that says nothing (a team's custom rule) counts matches, so its limit is a number of times.
64
+ */
65
+ const limitText = (rule: RuleDefinition, limit: number, language: string): string => {
66
+ const meaning = localized(rule.guide?.levelMeaning ?? {}, language);
67
+ return meaning === "" ? `${String(limit)} ${TEXT[uiLanguageOf(language)].times}` : fill(meaning, { limit });
68
+ };
69
+
70
+ /** What a level holds: the limit a detector counts to, or the severity a rule with nothing to count gives. */
71
+ const valueAt = (rule: RuleDefinition, level: Exclude<Level, "off">, genre: string | undefined, language: string): string =>
72
+ rule.level_sets === "severity"
73
+ ? SEVERITY_NAME[uiLanguageOf(language)][severityAt(rule, level, genre)]
74
+ : limitText(rule, resolve(rule, level, genre).limit, language);
75
+
76
+ /** current is undefined when a number, not a level, sets the limit: no level is marked. */
77
+ const levelLine = (rule: RuleDefinition, level: Level, current: Level | undefined, genre: string | undefined, language: string): string => {
39
78
  const mark = level === current ? "→" : " ";
40
79
  const name = level.padEnd(9);
41
- return level === "off" ? ` ${mark} ${name}${off}` : ` ${mark} ${name}${resolve(rule, level, genre).limit}`;
80
+ return level === "off" ? ` ${mark} ${name}${TEXT[uiLanguageOf(language)].off}` : ` ${mark} ${name}${valueAt(rule, level, genre, language)}`;
42
81
  };
43
82
 
44
83
  /** ジャンルで数字が変わる rule は、それを言わないと「設定したのに効かない」に見える。 */
@@ -48,23 +87,45 @@ const genreNote = (rule: RuleDefinition, genre: string | undefined, text: (typeo
48
87
  return ["", ` ${text.genreNote(genre ?? text.defaultGenre, others.join(" / "))}`];
49
88
  };
50
89
 
90
+ /** A team's rule shows its example, before and after, and says where it was defined. */
91
+ const exampleLines = (rule: RuleDefinition, language: string, text: (typeof TEXT)["ja"]): string[] => {
92
+ const examples = rule.guide?.examples ?? {};
93
+ const example = examples[language] ?? examples["en"] ?? Object.values(examples)[0];
94
+ if (rule.custom === undefined || example === undefined) return [];
95
+ return ["", ` ${text.example}: ${example.before}`, ` → ${example.after}`, "", ` ${text.definedIn(rule.plugin)}`];
96
+ };
97
+
98
+ /** Where the rule's settings come from: the option layers, strongest first, and the source of its level when a style set it. */
99
+ /** limit: a number chaff.yaml or its style set for the rule (rules: { id: 80 }, a style's limits), which a level does not show. */
100
+ export type ExplainSettings = {
101
+ readonly optionLayers?: readonly OptionLayer[];
102
+ readonly levelFrom?: string | undefined;
103
+ readonly limit?: number | undefined;
104
+ };
105
+
51
106
  /** rule の意図と根拠を読む。指摘に納得できないときの入口。 */
52
- export const renderExplain = (rule: RuleDefinition, current: Level, language: string, unit: string, genre?: string): string => {
107
+ export const renderExplain = (rule: RuleDefinition, current: Level, language: string, genre?: string, settings: ExplainSettings = {}): string => {
108
+ const { optionLayers = [], levelFrom } = settings;
109
+ // A rule with nothing to count has no number to set; chaff.yaml's number on it is reported as a problem and ignored.
110
+ const limit = rule.level_sets === "severity" ? undefined : settings.limit;
111
+ const marked = limit === undefined ? current : undefined;
53
112
  const text = TEXT[uiLanguageOf(language)];
54
113
  const experimental = rule.status === "experimental" ? [` ${text.experimental}`] : [];
55
114
  return [
56
115
  "",
57
- ` ${localized(rule.name, language)} (${rule.id})`,
116
+ ` ${readableText(rule, rule.name, language)} (${rule.id})`,
58
117
  "",
59
- ` ${localized(rule.why, language)}`,
118
+ ` ${readableText(rule, rule.why, language)}`,
60
119
  "",
61
- ` ${text.howToFix}: ${localized(rule.how_to_fix, language)}`,
120
+ ` ${text.howToFix}: ${readableText(rule, rule.how_to_fix, language)}`,
121
+ ...exampleLines(rule, language, text),
62
122
  "",
63
- ` ${text.values(unit)}`,
64
- ...definedLevels(rule).map((level) => levelLine(rule, level, current, genre, text.off)),
123
+ ` ${rule.level_sets === "severity" ? text.severities : text.values}`,
124
+ ...definedLevels(rule).map((level) => levelLine(rule, level, marked, genre, language)),
65
125
  ...genreNote(rule, genre, text),
126
+ ...optionLines(rule, optionLayers, language),
66
127
  "",
67
- ` ${text.now(current)}`,
128
+ ` ${limit === undefined ? text.now(current) : text.nowNumber(limitText(rule, limit, language))}${levelFrom === undefined ? "" : text.from(levelFrom)}`,
68
129
  ...experimental,
69
130
  "",
70
131
  ` ${text.change(rule.id)}`,
@@ -1,6 +1,6 @@
1
1
  import type { Finding, RuleDefinition } from "../plugin.ts";
2
2
  import type { RunResult } from "../run.ts";
3
- import { MARK, localized, messageOf } from "./text.ts";
3
+ import { MARK, filledText, messageOf } from "./text.ts";
4
4
  import { tally } from "./summary.ts";
5
5
  import { counted } from "./plural.ts";
6
6
  import { uiLanguageOf, type Texts } from "../ui.ts";
@@ -45,29 +45,39 @@ const QUOTE_LIMIT = 120;
45
45
 
46
46
  const indent = (text: string, pad: string): string[] => text.split("\n").map((line) => `${pad}${line}`);
47
47
 
48
- const quoteOf = (finding: Finding): string[] => {
49
- const text = finding.quote.replace(/\s+/gu, " ").trim();
48
+ const quoteOf = (quote: string): string[] => {
49
+ const text = quote.replace(/\s+/gu, " ").trim();
50
50
  if (text.length === 0) return [];
51
51
  return ["", ...indent(text.length > QUOTE_LIMIT ? `${text.slice(0, QUOTE_LIMIT)}…` : text, " ")];
52
52
  };
53
53
 
54
+ /** 一つの文から出た指摘は同じ文を引く。長い文に指摘が多いとき、指摘ごとに文を整え直さない。 */
55
+ const quotesOf = (): ((quote: string) => readonly string[]) => {
56
+ const known = new Map<string, readonly string[]>();
57
+ return (quote) => {
58
+ const lines = known.get(quote) ?? quoteOf(quote);
59
+ known.set(quote, lines);
60
+ return lines;
61
+ };
62
+ };
63
+
54
64
  /**
55
65
  * 1 件につき 4 つを出す。どれが欠けても、書いた人は動けない。
56
66
  * 引用 / 何が起きているか / なぜ問題か / どう直すか
57
67
  * rule の id は「ゆるめる」コマンドの中にだけ出す。最初に読むのは name。
58
68
  */
59
- const block = (finding: Finding, rule: RuleDefinition, language: string): string[] => [
69
+ const block = (finding: Finding, rule: RuleDefinition, language: string, quoted: readonly string[]): string[] => [
60
70
  "",
61
71
  // "12 行目" and "line 12" take the same width on a terminal, so the rule ends in the same column in both.
62
72
  `─── ${TEXT[uiLanguageOf(language)].line(finding.line)} ${"─".repeat(Math.max(0, RULE - String(finding.line).length - 8))}`,
63
- ...quoteOf(finding),
73
+ ...quoted,
64
74
  "",
65
- ` ${MARK[finding.severity] ?? "·"} ${localized(rule.name, language)}`,
75
+ ` ${MARK[finding.severity] ?? "·"} ${filledText(rule.name, finding, language)}`,
66
76
  "",
67
77
  ...indent(messageOf(rule, finding, language), " "),
68
- ...indent(localized(rule.why, language), " "),
78
+ ...indent(filledText(rule.why, finding, language), " "),
69
79
  "",
70
- ...indent(`→ ${localized(rule.how_to_fix, language)}`, " "),
80
+ ...indent(`→ ${filledText(rule.how_to_fix, finding, language)}`, " "),
71
81
  "",
72
82
  ` ${TEXT[uiLanguageOf(language)].relax}: npx chaff relax ${finding.rule}`,
73
83
  "",
@@ -82,9 +92,10 @@ export const renderFriendly = (
82
92
  notes: readonly string[] = [],
83
93
  ): string => {
84
94
  const byId = new Map(rules.map((rule) => [rule.id, rule]));
95
+ const quoted = quotesOf();
85
96
  const blocks = result.findings.flatMap((finding) => {
86
97
  const rule = byId.get(finding.rule);
87
- return rule === undefined ? [] : block(finding, rule, language);
98
+ return rule === undefined ? [] : block(finding, rule, language, quoted(finding.quote));
88
99
  });
89
100
  const text = TEXT[uiLanguageOf(language)];
90
101
  const closing = [