chaffjs 0.34.0 → 0.36.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 (976) hide show
  1. package/README.ja.md +12 -0
  2. package/README.md +15 -0
  3. package/dist/announced-count.d.ts +2 -0
  4. package/dist/announced-count.d.ts.map +1 -1
  5. package/dist/announced-count.js +29 -7
  6. package/dist/announced-count.js.map +1 -1
  7. package/dist/capitals-passage.d.ts +3 -0
  8. package/dist/capitals-passage.d.ts.map +1 -0
  9. package/dist/capitals-passage.js +26 -0
  10. package/dist/capitals-passage.js.map +1 -0
  11. package/dist/chronology-rows.d.ts +9 -0
  12. package/dist/chronology-rows.d.ts.map +1 -0
  13. package/dist/chronology-rows.js +79 -0
  14. package/dist/chronology-rows.js.map +1 -0
  15. package/dist/coined-hyphen-name.d.ts +13 -0
  16. package/dist/coined-hyphen-name.d.ts.map +1 -0
  17. package/dist/coined-hyphen-name.js +21 -0
  18. package/dist/coined-hyphen-name.js.map +1 -0
  19. package/dist/company-name-run.d.ts +8 -0
  20. package/dist/company-name-run.d.ts.map +1 -0
  21. package/dist/company-name-run.js +30 -0
  22. package/dist/company-name-run.js.map +1 -0
  23. package/dist/company-names.d.ts +6 -1
  24. package/dist/company-names.d.ts.map +1 -1
  25. package/dist/company-names.js +22 -3
  26. package/dist/company-names.js.map +1 -1
  27. package/dist/compound-head.d.ts +7 -0
  28. package/dist/compound-head.d.ts.map +1 -0
  29. package/dist/compound-head.js +19 -0
  30. package/dist/compound-head.js.map +1 -0
  31. package/dist/date-format.d.ts +8 -3
  32. package/dist/date-format.d.ts.map +1 -1
  33. package/dist/date-format.js +36 -3
  34. package/dist/date-format.js.map +1 -1
  35. package/dist/derived/count-per-period.d.ts +23 -0
  36. package/dist/derived/count-per-period.d.ts.map +1 -0
  37. package/dist/derived/count-per-period.js +14 -0
  38. package/dist/derived/count-per-period.js.map +1 -0
  39. package/dist/detectors/acronym-context.d.ts +5 -1
  40. package/dist/detectors/acronym-context.d.ts.map +1 -1
  41. package/dist/detectors/acronym-context.js +32 -4
  42. package/dist/detectors/acronym-context.js.map +1 -1
  43. package/dist/detectors/acronym-definition.d.ts +13 -0
  44. package/dist/detectors/acronym-definition.d.ts.map +1 -0
  45. package/dist/detectors/acronym-definition.js +90 -0
  46. package/dist/detectors/acronym-definition.js.map +1 -0
  47. package/dist/detectors/acronym-expansion.d.ts +5 -1
  48. package/dist/detectors/acronym-expansion.d.ts.map +1 -1
  49. package/dist/detectors/acronym-expansion.js +35 -3
  50. package/dist/detectors/acronym-expansion.js.map +1 -1
  51. package/dist/detectors/acronym-known.d.ts +19 -0
  52. package/dist/detectors/acronym-known.d.ts.map +1 -0
  53. package/dist/detectors/acronym-known.js +32 -0
  54. package/dist/detectors/acronym-known.js.map +1 -0
  55. package/dist/detectors/acronym-link.d.ts +14 -0
  56. package/dist/detectors/acronym-link.d.ts.map +1 -0
  57. package/dist/detectors/acronym-link.js +32 -0
  58. package/dist/detectors/acronym-link.js.map +1 -0
  59. package/dist/detectors/acronym-lone.d.ts +13 -0
  60. package/dist/detectors/acronym-lone.d.ts.map +1 -0
  61. package/dist/detectors/acronym-lone.js +22 -0
  62. package/dist/detectors/acronym-lone.js.map +1 -0
  63. package/dist/detectors/acronym-name.d.ts +62 -0
  64. package/dist/detectors/acronym-name.d.ts.map +1 -0
  65. package/dist/detectors/acronym-name.js +94 -0
  66. package/dist/detectors/acronym-name.js.map +1 -0
  67. package/dist/detectors/addressee-edge.d.ts +13 -0
  68. package/dist/detectors/addressee-edge.d.ts.map +1 -0
  69. package/dist/detectors/addressee-edge.js +13 -0
  70. package/dist/detectors/addressee-edge.js.map +1 -0
  71. package/dist/detectors/announced-count.d.ts.map +1 -1
  72. package/dist/detectors/announced-count.js +1 -0
  73. package/dist/detectors/announced-count.js.map +1 -1
  74. package/dist/detectors/bare-comparative.d.ts +4 -0
  75. package/dist/detectors/bare-comparative.d.ts.map +1 -1
  76. package/dist/detectors/bare-comparative.js +28 -3
  77. package/dist/detectors/bare-comparative.js.map +1 -1
  78. package/dist/detectors/blank-structure.d.ts +7 -1
  79. package/dist/detectors/blank-structure.d.ts.map +1 -1
  80. package/dist/detectors/blank-structure.js +13 -8
  81. package/dist/detectors/blank-structure.js.map +1 -1
  82. package/dist/detectors/bracket-specified.d.ts +6 -0
  83. package/dist/detectors/bracket-specified.d.ts.map +1 -0
  84. package/dist/detectors/bracket-specified.js +23 -0
  85. package/dist/detectors/bracket-specified.js.map +1 -0
  86. package/dist/detectors/broken-link.d.ts +6 -0
  87. package/dist/detectors/broken-link.d.ts.map +1 -1
  88. package/dist/detectors/broken-link.js +23 -2
  89. package/dist/detectors/broken-link.js.map +1 -1
  90. package/dist/detectors/capitalised-term.d.ts +14 -2
  91. package/dist/detectors/capitalised-term.d.ts.map +1 -1
  92. package/dist/detectors/capitalised-term.js +115 -4
  93. package/dist/detectors/capitalised-term.js.map +1 -1
  94. package/dist/detectors/caps-caption.d.ts +12 -0
  95. package/dist/detectors/caps-caption.d.ts.map +1 -0
  96. package/dist/detectors/caps-caption.js +89 -0
  97. package/dist/detectors/caps-caption.js.map +1 -0
  98. package/dist/detectors/caps-phrase.d.ts +6 -0
  99. package/dist/detectors/caps-phrase.d.ts.map +1 -0
  100. package/dist/detectors/caps-phrase.js +16 -0
  101. package/dist/detectors/caps-phrase.js.map +1 -0
  102. package/dist/detectors/char-shape.d.ts +1 -0
  103. package/dist/detectors/char-shape.d.ts.map +1 -1
  104. package/dist/detectors/char-shape.js +72 -30
  105. package/dist/detectors/char-shape.js.map +1 -1
  106. package/dist/detectors/cited-title.d.ts +3 -2
  107. package/dist/detectors/cited-title.d.ts.map +1 -1
  108. package/dist/detectors/cited-title.js +14 -3
  109. package/dist/detectors/cited-title.js.map +1 -1
  110. package/dist/detectors/clause-shape.d.ts +1 -1
  111. package/dist/detectors/clause-shape.d.ts.map +1 -1
  112. package/dist/detectors/clause-shape.js +9 -4
  113. package/dist/detectors/clause-shape.js.map +1 -1
  114. package/dist/detectors/concrete-evidence.d.ts +13 -1
  115. package/dist/detectors/concrete-evidence.d.ts.map +1 -1
  116. package/dist/detectors/concrete-evidence.js +59 -0
  117. package/dist/detectors/concrete-evidence.js.map +1 -1
  118. package/dist/detectors/contraction-minority.d.ts +11 -0
  119. package/dist/detectors/contraction-minority.d.ts.map +1 -0
  120. package/dist/detectors/contraction-minority.js +10 -0
  121. package/dist/detectors/contraction-minority.js.map +1 -0
  122. package/dist/detectors/counter-edge.d.ts +7 -1
  123. package/dist/detectors/counter-edge.d.ts.map +1 -1
  124. package/dist/detectors/counter-edge.js +40 -2
  125. package/dist/detectors/counter-edge.js.map +1 -1
  126. package/dist/detectors/date-any-year.d.ts +12 -5
  127. package/dist/detectors/date-any-year.d.ts.map +1 -1
  128. package/dist/detectors/date-any-year.js +69 -12
  129. package/dist/detectors/date-any-year.js.map +1 -1
  130. package/dist/detectors/date-format.d.ts.map +1 -1
  131. package/dist/detectors/date-format.js +2 -1
  132. package/dist/detectors/date-format.js.map +1 -1
  133. package/dist/detectors/date-heading-year.d.ts +18 -0
  134. package/dist/detectors/date-heading-year.d.ts.map +1 -0
  135. package/dist/detectors/date-heading-year.js +38 -0
  136. package/dist/detectors/date-heading-year.js.map +1 -0
  137. package/dist/detectors/date-year.d.ts +19 -3
  138. package/dist/detectors/date-year.d.ts.map +1 -1
  139. package/dist/detectors/date-year.js +69 -8
  140. package/dist/detectors/date-year.js.map +1 -1
  141. package/dist/detectors/deadline-unit.d.ts +20 -0
  142. package/dist/detectors/deadline-unit.d.ts.map +1 -0
  143. package/dist/detectors/deadline-unit.js +19 -0
  144. package/dist/detectors/deadline-unit.js.map +1 -0
  145. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  146. package/dist/detectors/defined-term-form.js +59 -12
  147. package/dist/detectors/defined-term-form.js.map +1 -1
  148. package/dist/detectors/definition-use.d.ts.map +1 -1
  149. package/dist/detectors/definition-use.js +6 -3
  150. package/dist/detectors/definition-use.js.map +1 -1
  151. package/dist/detectors/derived-numbers.d.ts.map +1 -1
  152. package/dist/detectors/derived-numbers.js +17 -4
  153. package/dist/detectors/derived-numbers.js.map +1 -1
  154. package/dist/detectors/doubled-across-aside.d.ts +9 -0
  155. package/dist/detectors/doubled-across-aside.d.ts.map +1 -0
  156. package/dist/detectors/doubled-across-aside.js +27 -0
  157. package/dist/detectors/doubled-across-aside.js.map +1 -0
  158. package/dist/detectors/doubled-punctuation.d.ts +3 -3
  159. package/dist/detectors/doubled-punctuation.d.ts.map +1 -1
  160. package/dist/detectors/doubled-punctuation.js +23 -4
  161. package/dist/detectors/doubled-punctuation.js.map +1 -1
  162. package/dist/detectors/doubled-word.d.ts.map +1 -1
  163. package/dist/detectors/doubled-word.js +2 -1
  164. package/dist/detectors/doubled-word.js.map +1 -1
  165. package/dist/detectors/due-date.d.ts.map +1 -1
  166. package/dist/detectors/due-date.js +6 -0
  167. package/dist/detectors/due-date.js.map +1 -1
  168. package/dist/detectors/ellipsis.d.ts.map +1 -1
  169. package/dist/detectors/ellipsis.js +13 -1
  170. package/dist/detectors/ellipsis.js.map +1 -1
  171. package/dist/detectors/email-letter.d.ts +31 -1
  172. package/dist/detectors/email-letter.d.ts.map +1 -1
  173. package/dist/detectors/email-letter.js +76 -14
  174. package/dist/detectors/email-letter.js.map +1 -1
  175. package/dist/detectors/en-shape.d.ts.map +1 -1
  176. package/dist/detectors/en-shape.js +5 -1
  177. package/dist/detectors/en-shape.js.map +1 -1
  178. package/dist/detectors/fact-consistency.d.ts.map +1 -1
  179. package/dist/detectors/fact-consistency.js +3 -2
  180. package/dist/detectors/fact-consistency.js.map +1 -1
  181. package/dist/detectors/field-label.d.ts +7 -0
  182. package/dist/detectors/field-label.d.ts.map +1 -0
  183. package/dist/detectors/field-label.js +23 -0
  184. package/dist/detectors/field-label.js.map +1 -0
  185. package/dist/detectors/footnote-mismatch.d.ts +6 -1
  186. package/dist/detectors/footnote-mismatch.d.ts.map +1 -1
  187. package/dist/detectors/footnote-mismatch.js +28 -7
  188. package/dist/detectors/footnote-mismatch.js.map +1 -1
  189. package/dist/detectors/graded-step.d.ts +20 -0
  190. package/dist/detectors/graded-step.d.ts.map +1 -0
  191. package/dist/detectors/graded-step.js +33 -0
  192. package/dist/detectors/graded-step.js.map +1 -0
  193. package/dist/detectors/gram-openers.d.ts +8 -0
  194. package/dist/detectors/gram-openers.d.ts.map +1 -0
  195. package/dist/detectors/gram-openers.js +16 -0
  196. package/dist/detectors/gram-openers.js.map +1 -0
  197. package/dist/detectors/gram-passages.d.ts +11 -0
  198. package/dist/detectors/gram-passages.d.ts.map +1 -0
  199. package/dist/detectors/gram-passages.js +26 -0
  200. package/dist/detectors/gram-passages.js.map +1 -0
  201. package/dist/detectors/gram-place.d.ts +3 -1
  202. package/dist/detectors/gram-place.d.ts.map +1 -1
  203. package/dist/detectors/gram-place.js +8 -0
  204. package/dist/detectors/gram-place.js.map +1 -1
  205. package/dist/detectors/gram-predicate.d.ts.map +1 -1
  206. package/dist/detectors/gram-predicate.js +37 -3
  207. package/dist/detectors/gram-predicate.js.map +1 -1
  208. package/dist/detectors/heading-echo.d.ts.map +1 -1
  209. package/dist/detectors/heading-echo.js +28 -2
  210. package/dist/detectors/heading-echo.js.map +1 -1
  211. package/dist/detectors/heading-end-mark.d.ts +8 -3
  212. package/dist/detectors/heading-end-mark.d.ts.map +1 -1
  213. package/dist/detectors/heading-end-mark.js +18 -8
  214. package/dist/detectors/heading-end-mark.js.map +1 -1
  215. package/dist/detectors/heading-names.d.ts +7 -0
  216. package/dist/detectors/heading-names.d.ts.map +1 -0
  217. package/dist/detectors/heading-names.js +24 -0
  218. package/dist/detectors/heading-names.js.map +1 -0
  219. package/dist/detectors/heading-numbering.d.ts.map +1 -1
  220. package/dist/detectors/heading-numbering.js +7 -2
  221. package/dist/detectors/heading-numbering.js.map +1 -1
  222. package/dist/detectors/ime-residue.d.ts +1 -1
  223. package/dist/detectors/ime-residue.d.ts.map +1 -1
  224. package/dist/detectors/ime-residue.js +4 -3
  225. package/dist/detectors/ime-residue.js.map +1 -1
  226. package/dist/detectors/inch-mark.d.ts +10 -0
  227. package/dist/detectors/inch-mark.d.ts.map +1 -0
  228. package/dist/detectors/inch-mark.js +48 -0
  229. package/dist/detectors/inch-mark.js.map +1 -0
  230. package/dist/detectors/kanji-compound-slip.d.ts +3 -0
  231. package/dist/detectors/kanji-compound-slip.d.ts.map +1 -0
  232. package/dist/detectors/kanji-compound-slip.js +50 -0
  233. package/dist/detectors/kanji-compound-slip.js.map +1 -0
  234. package/dist/detectors/kutoten-consistency.d.ts +10 -2
  235. package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
  236. package/dist/detectors/kutoten-consistency.js +76 -12
  237. package/dist/detectors/kutoten-consistency.js.map +1 -1
  238. package/dist/detectors/lexicon.d.ts +0 -1
  239. package/dist/detectors/lexicon.d.ts.map +1 -1
  240. package/dist/detectors/lexicon.js +37 -25
  241. package/dist/detectors/lexicon.js.map +1 -1
  242. package/dist/detectors/link-shape.d.ts.map +1 -1
  243. package/dist/detectors/link-shape.js +9 -3
  244. package/dist/detectors/link-shape.js.map +1 -1
  245. package/dist/detectors/list-item-ending.d.ts +18 -0
  246. package/dist/detectors/list-item-ending.d.ts.map +1 -0
  247. package/dist/detectors/list-item-ending.js +35 -0
  248. package/dist/detectors/list-item-ending.js.map +1 -0
  249. package/dist/detectors/list-parallel.d.ts +18 -5
  250. package/dist/detectors/list-parallel.d.ts.map +1 -1
  251. package/dist/detectors/list-parallel.js +116 -36
  252. package/dist/detectors/list-parallel.js.map +1 -1
  253. package/dist/detectors/list-sentence.d.ts +4 -0
  254. package/dist/detectors/list-sentence.d.ts.map +1 -1
  255. package/dist/detectors/list-sentence.js +1 -1
  256. package/dist/detectors/list-sentence.js.map +1 -1
  257. package/dist/detectors/mark-shape.d.ts +15 -5
  258. package/dist/detectors/mark-shape.d.ts.map +1 -1
  259. package/dist/detectors/mark-shape.js +64 -10
  260. package/dist/detectors/mark-shape.js.map +1 -1
  261. package/dist/detectors/mentioned-phrase.d.ts +9 -0
  262. package/dist/detectors/mentioned-phrase.d.ts.map +1 -0
  263. package/dist/detectors/mentioned-phrase.js +25 -0
  264. package/dist/detectors/mentioned-phrase.js.map +1 -0
  265. package/dist/detectors/middle-dot.d.ts +2 -2
  266. package/dist/detectors/middle-dot.d.ts.map +1 -1
  267. package/dist/detectors/middle-dot.js +4 -2
  268. package/dist/detectors/middle-dot.js.map +1 -1
  269. package/dist/detectors/modal-conflict.d.ts.map +1 -1
  270. package/dist/detectors/modal-conflict.js +5 -2
  271. package/dist/detectors/modal-conflict.js.map +1 -1
  272. package/dist/detectors/name-variant-apart.d.ts +27 -0
  273. package/dist/detectors/name-variant-apart.d.ts.map +1 -0
  274. package/dist/detectors/name-variant-apart.js +51 -0
  275. package/dist/detectors/name-variant-apart.js.map +1 -0
  276. package/dist/detectors/name-variant.d.ts.map +1 -1
  277. package/dist/detectors/name-variant.js +18 -11
  278. package/dist/detectors/name-variant.js.map +1 -1
  279. package/dist/detectors/notice-paragraph.d.ts +9 -0
  280. package/dist/detectors/notice-paragraph.d.ts.map +1 -0
  281. package/dist/detectors/notice-paragraph.js +21 -0
  282. package/dist/detectors/notice-paragraph.js.map +1 -0
  283. package/dist/detectors/number-style.d.ts.map +1 -1
  284. package/dist/detectors/number-style.js +15 -2
  285. package/dist/detectors/number-style.js.map +1 -1
  286. package/dist/detectors/number-unit.d.ts.map +1 -1
  287. package/dist/detectors/number-unit.js +24 -1
  288. package/dist/detectors/number-unit.js.map +1 -1
  289. package/dist/detectors/numeral-opener.d.ts +6 -0
  290. package/dist/detectors/numeral-opener.d.ts.map +1 -1
  291. package/dist/detectors/numeral-opener.js +24 -1
  292. package/dist/detectors/numeral-opener.js.map +1 -1
  293. package/dist/detectors/numeral-word.d.ts +15 -0
  294. package/dist/detectors/numeral-word.d.ts.map +1 -0
  295. package/dist/detectors/numeral-word.js +26 -0
  296. package/dist/detectors/numeral-word.js.map +1 -0
  297. package/dist/detectors/obligation-without-deadline.d.ts +5 -1
  298. package/dist/detectors/obligation-without-deadline.d.ts.map +1 -1
  299. package/dist/detectors/obligation-without-deadline.js +44 -23
  300. package/dist/detectors/obligation-without-deadline.js.map +1 -1
  301. package/dist/detectors/open-end-class.d.ts +16 -0
  302. package/dist/detectors/open-end-class.d.ts.map +1 -0
  303. package/dist/detectors/open-end-class.js +65 -0
  304. package/dist/detectors/open-end-class.js.map +1 -0
  305. package/dist/detectors/open-end-condition.d.ts +7 -0
  306. package/dist/detectors/open-end-condition.d.ts.map +1 -0
  307. package/dist/detectors/open-end-condition.js +35 -0
  308. package/dist/detectors/open-end-condition.js.map +1 -0
  309. package/dist/detectors/open-end-names.d.ts +9 -3
  310. package/dist/detectors/open-end-names.d.ts.map +1 -1
  311. package/dist/detectors/open-end-names.js +5 -2
  312. package/dist/detectors/open-end-names.js.map +1 -1
  313. package/dist/detectors/open-end-question.d.ts +15 -0
  314. package/dist/detectors/open-end-question.d.ts.map +1 -0
  315. package/dist/detectors/open-end-question.js +37 -0
  316. package/dist/detectors/open-end-question.js.map +1 -0
  317. package/dist/detectors/open-end-scope.d.ts +16 -0
  318. package/dist/detectors/open-end-scope.d.ts.map +1 -0
  319. package/dist/detectors/open-end-scope.js +47 -0
  320. package/dist/detectors/open-end-scope.js.map +1 -0
  321. package/dist/detectors/opening-date.d.ts +10 -0
  322. package/dist/detectors/opening-date.d.ts.map +1 -0
  323. package/dist/detectors/opening-date.js +33 -0
  324. package/dist/detectors/opening-date.js.map +1 -0
  325. package/dist/detectors/ordinary-phrase.d.ts +20 -0
  326. package/dist/detectors/ordinary-phrase.d.ts.map +1 -0
  327. package/dist/detectors/ordinary-phrase.js +54 -0
  328. package/dist/detectors/ordinary-phrase.js.map +1 -0
  329. package/dist/detectors/organisation-run.d.ts +18 -0
  330. package/dist/detectors/organisation-run.d.ts.map +1 -0
  331. package/dist/detectors/organisation-run.js +80 -0
  332. package/dist/detectors/organisation-run.js.map +1 -0
  333. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  334. package/dist/detectors/orthographic-variant.js +65 -21
  335. package/dist/detectors/orthographic-variant.js.map +1 -1
  336. package/dist/detectors/orthography.d.ts.map +1 -1
  337. package/dist/detectors/orthography.js +6 -1
  338. package/dist/detectors/orthography.js.map +1 -1
  339. package/dist/detectors/outline-label.d.ts +14 -0
  340. package/dist/detectors/outline-label.d.ts.map +1 -0
  341. package/dist/detectors/outline-label.js +32 -0
  342. package/dist/detectors/outline-label.js.map +1 -0
  343. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  344. package/dist/detectors/oxford-comma.js +38 -1
  345. package/dist/detectors/oxford-comma.js.map +1 -1
  346. package/dist/detectors/page-marker.d.ts +6 -0
  347. package/dist/detectors/page-marker.d.ts.map +1 -0
  348. package/dist/detectors/page-marker.js +19 -0
  349. package/dist/detectors/page-marker.js.map +1 -0
  350. package/dist/detectors/parallel-definition.d.ts +16 -0
  351. package/dist/detectors/parallel-definition.d.ts.map +1 -0
  352. package/dist/detectors/parallel-definition.js +51 -0
  353. package/dist/detectors/parallel-definition.js.map +1 -0
  354. package/dist/detectors/person-consistency.d.ts +2 -1
  355. package/dist/detectors/person-consistency.d.ts.map +1 -1
  356. package/dist/detectors/person-consistency.js +5 -3
  357. package/dist/detectors/person-consistency.js.map +1 -1
  358. package/dist/detectors/phrase-match.d.ts +2 -0
  359. package/dist/detectors/phrase-match.d.ts.map +1 -1
  360. package/dist/detectors/phrase-match.js +11 -4
  361. package/dist/detectors/phrase-match.js.map +1 -1
  362. package/dist/detectors/placeholder-text.d.ts.map +1 -1
  363. package/dist/detectors/placeholder-text.js +18 -3
  364. package/dist/detectors/placeholder-text.js.map +1 -1
  365. package/dist/detectors/placeholder.d.ts +3 -1
  366. package/dist/detectors/placeholder.d.ts.map +1 -1
  367. package/dist/detectors/placeholder.js +8 -3
  368. package/dist/detectors/placeholder.js.map +1 -1
  369. package/dist/detectors/postcode-end.d.ts +3 -0
  370. package/dist/detectors/postcode-end.d.ts.map +1 -0
  371. package/dist/detectors/postcode-end.js +15 -0
  372. package/dist/detectors/postcode-end.js.map +1 -0
  373. package/dist/detectors/prose-total-words.d.ts +5 -0
  374. package/dist/detectors/prose-total-words.d.ts.map +1 -0
  375. package/dist/detectors/prose-total-words.js +14 -0
  376. package/dist/detectors/prose-total-words.js.map +1 -0
  377. package/dist/detectors/reference-text.d.ts.map +1 -1
  378. package/dist/detectors/reference-text.js +1 -0
  379. package/dist/detectors/reference-text.js.map +1 -1
  380. package/dist/detectors/registry/kanji-compound-slip.d.ts +3 -0
  381. package/dist/detectors/registry/kanji-compound-slip.d.ts.map +1 -0
  382. package/dist/detectors/registry/kanji-compound-slip.js +3 -0
  383. package/dist/detectors/registry/kanji-compound-slip.js.map +1 -0
  384. package/dist/detectors/registry/phrase-in-use.d.ts +3 -0
  385. package/dist/detectors/registry/phrase-in-use.d.ts.map +1 -0
  386. package/dist/detectors/registry/phrase-in-use.js +3 -0
  387. package/dist/detectors/registry/phrase-in-use.js.map +1 -0
  388. package/dist/detectors/registry/unfilled-placeholder.d.ts.map +1 -1
  389. package/dist/detectors/registry/unfilled-placeholder.js +2 -2
  390. package/dist/detectors/registry/unfilled-placeholder.js.map +1 -1
  391. package/dist/detectors/registry/vague-density.js +1 -1
  392. package/dist/detectors/registry/vague-density.js.map +1 -1
  393. package/dist/detectors/request-owner.d.ts +6 -2
  394. package/dist/detectors/request-owner.d.ts.map +1 -1
  395. package/dist/detectors/request-owner.js +57 -7
  396. package/dist/detectors/request-owner.js.map +1 -1
  397. package/dist/detectors/requirement-smell.d.ts.map +1 -1
  398. package/dist/detectors/requirement-smell.js +39 -7
  399. package/dist/detectors/requirement-smell.js.map +1 -1
  400. package/dist/detectors/scaled-figure-unit.d.ts +28 -0
  401. package/dist/detectors/scaled-figure-unit.d.ts.map +1 -0
  402. package/dist/detectors/scaled-figure-unit.js +78 -0
  403. package/dist/detectors/scaled-figure-unit.js.map +1 -0
  404. package/dist/detectors/sentence-counts.d.ts +2 -0
  405. package/dist/detectors/sentence-counts.d.ts.map +1 -1
  406. package/dist/detectors/sentence-counts.js +18 -7
  407. package/dist/detectors/sentence-counts.js.map +1 -1
  408. package/dist/detectors/sentence-ending.d.ts +2 -0
  409. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  410. package/dist/detectors/sentence-ending.js +10 -3
  411. package/dist/detectors/sentence-ending.js.map +1 -1
  412. package/dist/detectors/sentence-length.d.ts.map +1 -1
  413. package/dist/detectors/sentence-length.js +24 -16
  414. package/dist/detectors/sentence-length.js.map +1 -1
  415. package/dist/detectors/sentence-load.d.ts +4 -1
  416. package/dist/detectors/sentence-load.d.ts.map +1 -1
  417. package/dist/detectors/sentence-load.js +9 -2
  418. package/dist/detectors/sentence-load.js.map +1 -1
  419. package/dist/detectors/sentence-rhythm.d.ts.map +1 -1
  420. package/dist/detectors/sentence-rhythm.js +6 -3
  421. package/dist/detectors/sentence-rhythm.js.map +1 -1
  422. package/dist/detectors/series-label.d.ts +2 -1
  423. package/dist/detectors/series-label.d.ts.map +1 -1
  424. package/dist/detectors/series-label.js +10 -4
  425. package/dist/detectors/series-label.js.map +1 -1
  426. package/dist/detectors/signals.d.ts +4 -0
  427. package/dist/detectors/signals.d.ts.map +1 -1
  428. package/dist/detectors/signals.js +91 -52
  429. package/dist/detectors/signals.js.map +1 -1
  430. package/dist/detectors/structure-tree.d.ts.map +1 -1
  431. package/dist/detectors/structure-tree.js +21 -19
  432. package/dist/detectors/structure-tree.js.map +1 -1
  433. package/dist/detectors/structure.d.ts.map +1 -1
  434. package/dist/detectors/structure.js +2 -1
  435. package/dist/detectors/structure.js.map +1 -1
  436. package/dist/detectors/subject-name-line.d.ts +8 -0
  437. package/dist/detectors/subject-name-line.d.ts.map +1 -0
  438. package/dist/detectors/subject-name-line.js +53 -0
  439. package/dist/detectors/subject-name-line.js.map +1 -0
  440. package/dist/detectors/table-header.d.ts.map +1 -1
  441. package/dist/detectors/table-header.js +13 -1
  442. package/dist/detectors/table-header.js.map +1 -1
  443. package/dist/detectors/technical-docs.d.ts.map +1 -1
  444. package/dist/detectors/technical-docs.js +4 -1
  445. package/dist/detectors/technical-docs.js.map +1 -1
  446. package/dist/detectors/template-sections.d.ts +14 -0
  447. package/dist/detectors/template-sections.d.ts.map +1 -0
  448. package/dist/detectors/template-sections.js +25 -0
  449. package/dist/detectors/template-sections.js.map +1 -0
  450. package/dist/detectors/term-mention-sentence.d.ts +4 -0
  451. package/dist/detectors/term-mention-sentence.d.ts.map +1 -0
  452. package/dist/detectors/term-mention-sentence.js +28 -0
  453. package/dist/detectors/term-mention-sentence.js.map +1 -0
  454. package/dist/detectors/titled-run.d.ts +23 -0
  455. package/dist/detectors/titled-run.d.ts.map +1 -0
  456. package/dist/detectors/titled-run.js +39 -0
  457. package/dist/detectors/titled-run.js.map +1 -0
  458. package/dist/detectors/token-shape.d.ts.map +1 -1
  459. package/dist/detectors/token-shape.js +13 -5
  460. package/dist/detectors/token-shape.js.map +1 -1
  461. package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
  462. package/dist/detectors/unbalanced-bracket.js +4 -0
  463. package/dist/detectors/unbalanced-bracket.js.map +1 -1
  464. package/dist/detectors/undefined-term.d.ts.map +1 -1
  465. package/dist/detectors/undefined-term.js +8 -0
  466. package/dist/detectors/undefined-term.js.map +1 -1
  467. package/dist/detectors/unfilled-placeholder.d.ts +4 -0
  468. package/dist/detectors/unfilled-placeholder.d.ts.map +1 -0
  469. package/dist/detectors/unfilled-placeholder.js +9 -0
  470. package/dist/detectors/unfilled-placeholder.js.map +1 -0
  471. package/dist/detectors/vague-density.d.ts +8 -0
  472. package/dist/detectors/vague-density.d.ts.map +1 -0
  473. package/dist/detectors/vague-density.js +65 -0
  474. package/dist/detectors/vague-density.js.map +1 -0
  475. package/dist/document-paragraphs.d.ts +4 -0
  476. package/dist/document-paragraphs.d.ts.map +1 -0
  477. package/dist/document-paragraphs.js +24 -0
  478. package/dist/document-paragraphs.js.map +1 -0
  479. package/dist/document.d.ts.map +1 -1
  480. package/dist/document.js +2 -19
  481. package/dist/document.js.map +1 -1
  482. package/dist/facts/fact-scope.d.ts +10 -1
  483. package/dist/facts/fact-scope.d.ts.map +1 -1
  484. package/dist/facts/fact-scope.js +34 -3
  485. package/dist/facts/fact-scope.js.map +1 -1
  486. package/dist/facts/table-facts.d.ts +12 -2
  487. package/dist/facts/table-facts.d.ts.map +1 -1
  488. package/dist/facts/table-facts.js +22 -4
  489. package/dist/facts/table-facts.js.map +1 -1
  490. package/dist/figure-references.d.ts +3 -0
  491. package/dist/figure-references.d.ts.map +1 -1
  492. package/dist/figure-references.js +6 -2
  493. package/dist/figure-references.js.map +1 -1
  494. package/dist/format-template.d.ts +3 -0
  495. package/dist/format-template.d.ts.map +1 -0
  496. package/dist/format-template.js +13 -0
  497. package/dist/format-template.js.map +1 -0
  498. package/dist/formula-brackets.d.ts +7 -0
  499. package/dist/formula-brackets.d.ts.map +1 -0
  500. package/dist/formula-brackets.js +29 -0
  501. package/dist/formula-brackets.js.map +1 -0
  502. package/dist/grade-api.d.ts +9 -2
  503. package/dist/grade-api.d.ts.map +1 -1
  504. package/dist/grade-api.js +31 -15
  505. package/dist/grade-api.js.map +1 -1
  506. package/dist/heading-numbering.d.ts +5 -2
  507. package/dist/heading-numbering.d.ts.map +1 -1
  508. package/dist/heading-numbering.js +27 -6
  509. package/dist/heading-numbering.js.map +1 -1
  510. package/dist/html/html-markdown.d.ts.map +1 -1
  511. package/dist/html/html-markdown.js +2 -1
  512. package/dist/html/html-markdown.js.map +1 -1
  513. package/dist/html/html-site-chrome.d.ts +5 -0
  514. package/dist/html/html-site-chrome.d.ts.map +1 -0
  515. package/dist/html/html-site-chrome.js +33 -0
  516. package/dist/html/html-site-chrome.js.map +1 -0
  517. package/dist/joined-view.d.ts.map +1 -1
  518. package/dist/joined-view.js +1 -0
  519. package/dist/joined-view.js.map +1 -1
  520. package/dist/kanji-compound-slip.d.ts +32 -0
  521. package/dist/kanji-compound-slip.d.ts.map +1 -0
  522. package/dist/kanji-compound-slip.js +63 -0
  523. package/dist/kanji-compound-slip.js.map +1 -0
  524. package/dist/latin-company-form.d.ts +6 -0
  525. package/dist/latin-company-form.d.ts.map +1 -0
  526. package/dist/latin-company-form.js +32 -0
  527. package/dist/latin-company-form.js.map +1 -0
  528. package/dist/latin-word-boundary.d.ts +15 -0
  529. package/dist/latin-word-boundary.d.ts.map +1 -0
  530. package/dist/latin-word-boundary.js +40 -0
  531. package/dist/latin-word-boundary.js.map +1 -0
  532. package/dist/lexicon-genres.d.ts +2 -0
  533. package/dist/lexicon-genres.d.ts.map +1 -1
  534. package/dist/lexicon-genres.js +1 -1
  535. package/dist/lexicon-genres.js.map +1 -1
  536. package/dist/link-shape.d.ts +5 -0
  537. package/dist/link-shape.d.ts.map +1 -1
  538. package/dist/link-shape.js +18 -0
  539. package/dist/link-shape.js.map +1 -1
  540. package/dist/link-title.d.ts +4 -0
  541. package/dist/link-title.d.ts.map +1 -0
  542. package/dist/link-title.js +33 -0
  543. package/dist/link-title.js.map +1 -0
  544. package/dist/list-item-paragraphs.d.ts +15 -0
  545. package/dist/list-item-paragraphs.d.ts.map +1 -0
  546. package/dist/list-item-paragraphs.js +19 -0
  547. package/dist/list-item-paragraphs.js.map +1 -0
  548. package/dist/literal-quote.d.ts +12 -0
  549. package/dist/literal-quote.d.ts.map +1 -0
  550. package/dist/literal-quote.js +43 -0
  551. package/dist/literal-quote.js.map +1 -0
  552. package/dist/nado-closed-list.d.ts.map +1 -1
  553. package/dist/nado-closed-list.js +39 -5
  554. package/dist/nado-closed-list.js.map +1 -1
  555. package/dist/name-end-letter.d.ts +5 -0
  556. package/dist/name-end-letter.d.ts.map +1 -1
  557. package/dist/name-end-letter.js +8 -0
  558. package/dist/name-end-letter.js.map +1 -1
  559. package/dist/name-given-before.d.ts +15 -0
  560. package/dist/name-given-before.d.ts.map +1 -0
  561. package/dist/name-given-before.js +30 -0
  562. package/dist/name-given-before.js.map +1 -0
  563. package/dist/name-separator.d.ts +2 -2
  564. package/dist/name-separator.d.ts.map +1 -1
  565. package/dist/name-separator.js +79 -5
  566. package/dist/name-separator.js.map +1 -1
  567. package/dist/name-variants.d.ts +3 -1
  568. package/dist/name-variants.d.ts.map +1 -1
  569. package/dist/name-variants.js +8 -7
  570. package/dist/name-variants.js.map +1 -1
  571. package/dist/name-word-order.d.ts +9 -5
  572. package/dist/name-word-order.d.ts.map +1 -1
  573. package/dist/name-word-order.js +47 -15
  574. package/dist/name-word-order.js.map +1 -1
  575. package/dist/nominal-stem.d.ts +26 -0
  576. package/dist/nominal-stem.d.ts.map +1 -0
  577. package/dist/nominal-stem.js +70 -0
  578. package/dist/nominal-stem.js.map +1 -0
  579. package/dist/person-forms.d.ts +8 -0
  580. package/dist/person-forms.d.ts.map +1 -1
  581. package/dist/person-forms.js +12 -0
  582. package/dist/person-forms.js.map +1 -1
  583. package/dist/plugin.d.ts +5 -0
  584. package/dist/plugin.d.ts.map +1 -1
  585. package/dist/preamble-paragraphs.d.ts +3 -2
  586. package/dist/preamble-paragraphs.d.ts.map +1 -1
  587. package/dist/preamble-paragraphs.js +8 -2
  588. package/dist/preamble-paragraphs.js.map +1 -1
  589. package/dist/sentence-load.d.ts +2 -1
  590. package/dist/sentence-load.d.ts.map +1 -1
  591. package/dist/sentence-load.js +6 -2
  592. package/dist/sentence-load.js.map +1 -1
  593. package/dist/spacing-code.d.ts +1 -0
  594. package/dist/spacing-code.d.ts.map +1 -1
  595. package/dist/spacing-code.js +4 -1
  596. package/dist/spacing-code.js.map +1 -1
  597. package/dist/split-noun.d.ts +10 -0
  598. package/dist/split-noun.d.ts.map +1 -0
  599. package/dist/split-noun.js +50 -0
  600. package/dist/split-noun.js.map +1 -0
  601. package/dist/structure/attached-parts.d.ts +11 -0
  602. package/dist/structure/attached-parts.d.ts.map +1 -0
  603. package/dist/structure/attached-parts.js +31 -0
  604. package/dist/structure/attached-parts.js.map +1 -0
  605. package/dist/structure/build.d.ts.map +1 -1
  606. package/dist/structure/build.js +7 -4
  607. package/dist/structure/build.js.map +1 -1
  608. package/dist/structure/cited-document-section.d.ts +7 -0
  609. package/dist/structure/cited-document-section.d.ts.map +1 -0
  610. package/dist/structure/cited-document-section.js +33 -0
  611. package/dist/structure/cited-document-section.js.map +1 -0
  612. package/dist/structure/contents-lines.d.ts +7 -0
  613. package/dist/structure/contents-lines.d.ts.map +1 -0
  614. package/dist/structure/contents-lines.js +51 -0
  615. package/dist/structure/contents-lines.js.map +1 -0
  616. package/dist/structure/defining-names.d.ts +37 -0
  617. package/dist/structure/defining-names.d.ts.map +1 -0
  618. package/dist/structure/defining-names.js +122 -0
  619. package/dist/structure/defining-names.js.map +1 -0
  620. package/dist/structure/definition-use.d.ts +3 -2
  621. package/dist/structure/definition-use.d.ts.map +1 -1
  622. package/dist/structure/definition-use.js +99 -31
  623. package/dist/structure/definition-use.js.map +1 -1
  624. package/dist/structure/html-text-blocks.d.ts +8 -0
  625. package/dist/structure/html-text-blocks.d.ts.map +1 -0
  626. package/dist/structure/html-text-blocks.js +47 -0
  627. package/dist/structure/html-text-blocks.js.map +1 -0
  628. package/dist/structure/issues.d.ts +5 -2
  629. package/dist/structure/issues.d.ts.map +1 -1
  630. package/dist/structure/issues.js +24 -6
  631. package/dist/structure/issues.js.map +1 -1
  632. package/dist/structure/labelled-date-order.d.ts +4 -1
  633. package/dist/structure/labelled-date-order.d.ts.map +1 -1
  634. package/dist/structure/labelled-date-order.js +2 -2
  635. package/dist/structure/labelled-date-order.js.map +1 -1
  636. package/dist/structure/labelled-order.d.ts +3 -0
  637. package/dist/structure/labelled-order.d.ts.map +1 -1
  638. package/dist/structure/labelled-order.js +8 -3
  639. package/dist/structure/labelled-order.js.map +1 -1
  640. package/dist/structure/list-lead-in.d.ts +19 -0
  641. package/dist/structure/list-lead-in.d.ts.map +1 -0
  642. package/dist/structure/list-lead-in.js +85 -0
  643. package/dist/structure/list-lead-in.js.map +1 -0
  644. package/dist/structure/list-numbering.d.ts +20 -4
  645. package/dist/structure/list-numbering.d.ts.map +1 -1
  646. package/dist/structure/list-numbering.js +65 -9
  647. package/dist/structure/list-numbering.js.map +1 -1
  648. package/dist/structure/listed-paragraph.d.ts +16 -0
  649. package/dist/structure/listed-paragraph.d.ts.map +1 -0
  650. package/dist/structure/listed-paragraph.js +37 -0
  651. package/dist/structure/listed-paragraph.js.map +1 -0
  652. package/dist/structure/modal-conflict.d.ts +7 -2
  653. package/dist/structure/modal-conflict.d.ts.map +1 -1
  654. package/dist/structure/modal-conflict.js +36 -7
  655. package/dist/structure/modal-conflict.js.map +1 -1
  656. package/dist/structure/negated-act.d.ts +17 -0
  657. package/dist/structure/negated-act.d.ts.map +1 -0
  658. package/dist/structure/negated-act.js +32 -0
  659. package/dist/structure/negated-act.js.map +1 -0
  660. package/dist/structure/numbering.d.ts +5 -2
  661. package/dist/structure/numbering.d.ts.map +1 -1
  662. package/dist/structure/numbering.js +49 -12
  663. package/dist/structure/numbering.js.map +1 -1
  664. package/dist/structure/prose-total.d.ts +4 -0
  665. package/dist/structure/prose-total.d.ts.map +1 -1
  666. package/dist/structure/prose-total.js +16 -6
  667. package/dist/structure/prose-total.js.map +1 -1
  668. package/dist/structure/reference-text.d.ts +9 -1
  669. package/dist/structure/reference-text.d.ts.map +1 -1
  670. package/dist/structure/reference-text.js +21 -3
  671. package/dist/structure/reference-text.js.map +1 -1
  672. package/dist/structure/repeated-number.d.ts +24 -0
  673. package/dist/structure/repeated-number.d.ts.map +1 -0
  674. package/dist/structure/repeated-number.js +89 -0
  675. package/dist/structure/repeated-number.js.map +1 -0
  676. package/dist/structure/rounded-amount.d.ts +8 -0
  677. package/dist/structure/rounded-amount.d.ts.map +1 -0
  678. package/dist/structure/rounded-amount.js +48 -0
  679. package/dist/structure/rounded-amount.js.map +1 -0
  680. package/dist/structure/section-names.d.ts +12 -0
  681. package/dist/structure/section-names.d.ts.map +1 -0
  682. package/dist/structure/section-names.js +26 -0
  683. package/dist/structure/section-names.js.map +1 -0
  684. package/dist/structure/side-step.d.ts +8 -0
  685. package/dist/structure/side-step.d.ts.map +1 -0
  686. package/dist/structure/side-step.js +21 -0
  687. package/dist/structure/side-step.js.map +1 -0
  688. package/dist/structure/spanned-label-blank.d.ts +8 -0
  689. package/dist/structure/spanned-label-blank.d.ts.map +1 -0
  690. package/dist/structure/spanned-label-blank.js +37 -0
  691. package/dist/structure/spanned-label-blank.js.map +1 -0
  692. package/dist/structure/universal.d.ts +3 -1
  693. package/dist/structure/universal.d.ts.map +1 -1
  694. package/dist/structure/universal.js +9 -2
  695. package/dist/structure/universal.js.map +1 -1
  696. package/dist/structure/unspaced-heading.d.ts +10 -0
  697. package/dist/structure/unspaced-heading.d.ts.map +1 -0
  698. package/dist/structure/unspaced-heading.js +24 -0
  699. package/dist/structure/unspaced-heading.js.map +1 -0
  700. package/dist/structure/versioned-label.d.ts +16 -0
  701. package/dist/structure/versioned-label.d.ts.map +1 -0
  702. package/dist/structure/versioned-label.js +48 -0
  703. package/dist/structure/versioned-label.js.map +1 -0
  704. package/dist/structure/written-headings.d.ts +31 -0
  705. package/dist/structure/written-headings.d.ts.map +1 -0
  706. package/dist/structure/written-headings.js +119 -0
  707. package/dist/structure/written-headings.js.map +1 -0
  708. package/dist/structure/written-list-path.d.ts +10 -0
  709. package/dist/structure/written-list-path.d.ts.map +1 -0
  710. package/dist/structure/written-list-path.js +37 -0
  711. package/dist/structure/written-list-path.js.map +1 -0
  712. package/dist/structure/written-resolve.d.ts +12 -0
  713. package/dist/structure/written-resolve.d.ts.map +1 -0
  714. package/dist/structure/written-resolve.js +55 -0
  715. package/dist/structure/written-resolve.js.map +1 -0
  716. package/dist/title-line.d.ts +21 -0
  717. package/dist/title-line.d.ts.map +1 -0
  718. package/dist/title-line.js +27 -0
  719. package/dist/title-line.js.map +1 -0
  720. package/package.json +3 -3
  721. package/rules/all-caps-shouting.yaml +2 -2
  722. package/rules/announced-count-mismatch.yaml +2 -2
  723. package/rules/bare-url-mix.yaml +2 -2
  724. package/rules/bracket-nesting.yaml +2 -2
  725. package/rules/bracket-width-consistency.yaml +2 -2
  726. package/rules/broken-link.yaml +2 -2
  727. package/rules/cliche.yaml +4 -3
  728. package/rules/code-fence-language-mix.yaml +2 -2
  729. package/rules/comparative-without-baseline.yaml +2 -2
  730. package/rules/concrete-evidence-density.yaml +2 -2
  731. package/rules/contraction-consistency.yaml +13 -13
  732. package/rules/dangling-figure-reference.yaml +2 -2
  733. package/rules/dangling-reference.yaml +2 -2
  734. package/rules/date-without-year.yaml +10 -2
  735. package/rules/defined-name-repeated.yaml +2 -2
  736. package/rules/defined-term-form.yaml +2 -2
  737. package/rules/doubled-punctuation.yaml +4 -4
  738. package/rules/doubled-word.yaml +2 -2
  739. package/rules/duplicate-definition.yaml +2 -2
  740. package/rules/duration-mismatch.yaml +2 -2
  741. package/rules/email-greeting-closing.yaml +2 -2
  742. package/rules/email-subject-length.yaml +2 -2
  743. package/rules/empty-table-cell.yaml +2 -2
  744. package/rules/fact-conflict.yaml +2 -2
  745. package/rules/footnote-mismatch.yaml +2 -2
  746. package/rules/heading-echo.yaml +2 -2
  747. package/rules/heading-end-punctuation-mix.yaml +2 -2
  748. package/rules/heading-numbering-mix.yaml +2 -2
  749. package/rules/ime-residue.yaml +2 -2
  750. package/rules/kanji-compound-slip.yaml +67 -0
  751. package/rules/kutoten-consistency.yaml +4 -4
  752. package/rules/latin-spacing.yaml +4 -4
  753. package/rules/list-item-form-mix.yaml +2 -2
  754. package/rules/max-kanji-continuous.yaml +7 -3
  755. package/rules/max-sentence-length.yaml +3 -2
  756. package/rules/modal-conflict.yaml +1 -0
  757. package/rules/nado-closed-list.yaml +2 -2
  758. package/rules/name-variant.yaml +2 -2
  759. package/rules/ngram-repetition.yaml +2 -2
  760. package/rules/no-doubled-joshi.yaml +2 -2
  761. package/rules/no-mixed-desumasu.yaml +3 -3
  762. package/rules/no-nakaguro-parallel.yaml +2 -0
  763. package/rules/number-without-unit.yaml +9 -4
  764. package/rules/numbering-gap.yaml +7 -2
  765. package/rules/numeral-sentence-start.yaml +2 -2
  766. package/rules/obligation-without-deadline.yaml +2 -2
  767. package/rules/orthographic-variant.yaml +2 -2
  768. package/rules/oxford-comma-consistency.yaml +3 -3
  769. package/rules/preamble-length.yaml +2 -2
  770. package/rules/reference-title-mismatch.yaml +2 -2
  771. package/rules/repeated-sentence-ending.yaml +3 -2
  772. package/rules/request-without-deadline.yaml +2 -2
  773. package/rules/requirement-smell.yaml +3 -3
  774. package/rules/sentence-rhythm.yaml +2 -2
  775. package/rules/table-header-variant.yaml +2 -2
  776. package/rules/teki-overuse.yaml +3 -2
  777. package/rules/title-case-consistency.yaml +2 -2
  778. package/rules/total-mismatch.yaml +2 -2
  779. package/rules/translationese-density.yaml +2 -2
  780. package/rules/unbalanced-bracket.yaml +2 -2
  781. package/rules/undefined-acronym.yaml +15 -4
  782. package/rules/undefined-term.yaml +2 -2
  783. package/rules/unfilled-placeholder.yaml +4 -4
  784. package/rules/use-before-definition.yaml +2 -2
  785. package/rules/vague-word-density.yaml +2 -2
  786. package/skills/chaff/SKILL.md +7 -1
  787. package/src/announced-count.ts +35 -8
  788. package/src/capitals-passage.ts +31 -0
  789. package/src/chronology-rows.ts +86 -0
  790. package/src/coined-hyphen-name.ts +27 -0
  791. package/src/company-name-run.ts +37 -0
  792. package/src/company-names.ts +24 -3
  793. package/src/compound-head.ts +25 -0
  794. package/src/date-format.ts +43 -4
  795. package/src/derived/count-per-period.ts +28 -0
  796. package/src/detectors/acronym-context.ts +34 -6
  797. package/src/detectors/acronym-definition.ts +123 -0
  798. package/src/detectors/acronym-expansion.ts +47 -6
  799. package/src/detectors/acronym-known.ts +40 -0
  800. package/src/detectors/acronym-link.ts +37 -0
  801. package/src/detectors/acronym-lone.ts +26 -0
  802. package/src/detectors/acronym-name.ts +140 -0
  803. package/src/detectors/addressee-edge.ts +16 -0
  804. package/src/detectors/announced-count.ts +1 -0
  805. package/src/detectors/bare-comparative.ts +44 -3
  806. package/src/detectors/blank-structure.ts +21 -10
  807. package/src/detectors/bracket-specified.ts +25 -0
  808. package/src/detectors/broken-link.ts +26 -2
  809. package/src/detectors/capitalised-term.ts +154 -4
  810. package/src/detectors/caps-caption.ts +103 -0
  811. package/src/detectors/caps-phrase.ts +17 -0
  812. package/src/detectors/char-shape.ts +99 -26
  813. package/src/detectors/cited-title.ts +15 -3
  814. package/src/detectors/clause-shape.ts +14 -4
  815. package/src/detectors/concrete-evidence.ts +77 -1
  816. package/src/detectors/contraction-minority.ts +11 -0
  817. package/src/detectors/counter-edge.ts +40 -2
  818. package/src/detectors/date-any-year.ts +79 -12
  819. package/src/detectors/date-format.ts +2 -1
  820. package/src/detectors/date-heading-year.ts +55 -0
  821. package/src/detectors/date-year.ts +107 -14
  822. package/src/detectors/deadline-unit.ts +40 -0
  823. package/src/detectors/defined-term-form.ts +58 -17
  824. package/src/detectors/definition-use.ts +7 -3
  825. package/src/detectors/derived-numbers.ts +19 -4
  826. package/src/detectors/doubled-across-aside.ts +36 -0
  827. package/src/detectors/doubled-punctuation.ts +28 -7
  828. package/src/detectors/doubled-word.ts +2 -1
  829. package/src/detectors/due-date.ts +10 -1
  830. package/src/detectors/ellipsis.ts +16 -1
  831. package/src/detectors/email-letter.ts +97 -21
  832. package/src/detectors/en-shape.ts +5 -1
  833. package/src/detectors/fact-consistency.ts +3 -2
  834. package/src/detectors/field-label.ts +25 -0
  835. package/src/detectors/footnote-mismatch.ts +39 -7
  836. package/src/detectors/graded-step.ts +52 -0
  837. package/src/detectors/gram-openers.ts +21 -0
  838. package/src/detectors/gram-passages.ts +36 -0
  839. package/src/detectors/gram-place.ts +10 -1
  840. package/src/detectors/gram-predicate.ts +43 -3
  841. package/src/detectors/heading-echo.ts +31 -3
  842. package/src/detectors/heading-end-mark.ts +23 -10
  843. package/src/detectors/heading-names.ts +31 -0
  844. package/src/detectors/heading-numbering.ts +7 -2
  845. package/src/detectors/ime-residue.ts +4 -3
  846. package/src/detectors/inch-mark.ts +49 -0
  847. package/src/detectors/kanji-compound-slip.ts +61 -0
  848. package/src/detectors/kutoten-consistency.ts +93 -14
  849. package/src/detectors/lexicon.ts +44 -24
  850. package/src/detectors/link-shape.ts +10 -3
  851. package/src/detectors/list-item-ending.ts +51 -0
  852. package/src/detectors/list-parallel.ts +158 -33
  853. package/src/detectors/list-sentence.ts +5 -1
  854. package/src/detectors/mark-shape.ts +70 -10
  855. package/src/detectors/mentioned-phrase.ts +38 -0
  856. package/src/detectors/middle-dot.ts +7 -2
  857. package/src/detectors/modal-conflict.ts +5 -2
  858. package/src/detectors/name-variant-apart.ts +63 -0
  859. package/src/detectors/name-variant.ts +30 -12
  860. package/src/detectors/notice-paragraph.ts +33 -0
  861. package/src/detectors/number-style.ts +14 -2
  862. package/src/detectors/number-unit.ts +28 -1
  863. package/src/detectors/numeral-opener.ts +27 -1
  864. package/src/detectors/numeral-word.ts +33 -0
  865. package/src/detectors/obligation-without-deadline.ts +29 -4
  866. package/src/detectors/open-end-class.ts +78 -0
  867. package/src/detectors/open-end-condition.ts +40 -0
  868. package/src/detectors/open-end-names.ts +9 -3
  869. package/src/detectors/open-end-question.ts +50 -0
  870. package/src/detectors/open-end-scope.ts +62 -0
  871. package/src/detectors/opening-date.ts +47 -0
  872. package/src/detectors/ordinary-phrase.ts +62 -0
  873. package/src/detectors/organisation-run.ts +97 -0
  874. package/src/detectors/orthographic-variant.ts +103 -27
  875. package/src/detectors/orthography.ts +10 -1
  876. package/src/detectors/outline-label.ts +48 -0
  877. package/src/detectors/oxford-comma.ts +40 -1
  878. package/src/detectors/page-marker.ts +26 -0
  879. package/src/detectors/parallel-definition.ts +64 -0
  880. package/src/detectors/person-consistency.ts +5 -3
  881. package/src/detectors/phrase-match.ts +16 -5
  882. package/src/detectors/placeholder-text.ts +18 -3
  883. package/src/detectors/placeholder.ts +10 -3
  884. package/src/detectors/postcode-end.ts +16 -0
  885. package/src/detectors/prose-total-words.ts +18 -0
  886. package/src/detectors/reference-text.ts +1 -0
  887. package/src/detectors/registry/kanji-compound-slip.ts +4 -0
  888. package/src/detectors/registry/phrase-in-use.ts +4 -0
  889. package/src/detectors/registry/unfilled-placeholder.ts +2 -2
  890. package/src/detectors/registry/vague-density.ts +1 -1
  891. package/src/detectors/request-owner.ts +71 -8
  892. package/src/detectors/requirement-smell.ts +53 -7
  893. package/src/detectors/scaled-figure-unit.ts +103 -0
  894. package/src/detectors/sentence-counts.ts +24 -8
  895. package/src/detectors/sentence-ending.ts +12 -3
  896. package/src/detectors/sentence-length.ts +14 -6
  897. package/src/detectors/sentence-load.ts +9 -2
  898. package/src/detectors/sentence-rhythm.ts +8 -4
  899. package/src/detectors/series-label.ts +13 -4
  900. package/src/detectors/signals.ts +105 -55
  901. package/src/detectors/structure-tree.ts +22 -20
  902. package/src/detectors/structure.ts +2 -1
  903. package/src/detectors/subject-name-line.ts +66 -0
  904. package/src/detectors/table-header.ts +15 -1
  905. package/src/detectors/technical-docs.ts +5 -1
  906. package/src/detectors/template-sections.ts +37 -0
  907. package/src/detectors/term-mention-sentence.ts +31 -0
  908. package/src/detectors/titled-run.ts +48 -0
  909. package/src/detectors/token-shape.ts +14 -5
  910. package/src/detectors/unbalanced-bracket.ts +3 -0
  911. package/src/detectors/undefined-term.ts +8 -0
  912. package/src/detectors/unfilled-placeholder.ts +10 -0
  913. package/src/detectors/vague-density.ts +84 -0
  914. package/src/document-paragraphs.ts +27 -0
  915. package/src/document.ts +3 -23
  916. package/src/facts/fact-scope.ts +53 -4
  917. package/src/facts/table-facts.ts +43 -6
  918. package/src/figure-references.ts +7 -2
  919. package/src/format-template.ts +15 -0
  920. package/src/formula-brackets.ts +36 -0
  921. package/src/grade-api.ts +38 -16
  922. package/src/heading-numbering.ts +35 -8
  923. package/src/html/html-markdown.ts +2 -1
  924. package/src/html/html-site-chrome.ts +47 -0
  925. package/src/joined-view.ts +1 -0
  926. package/src/kanji-compound-slip.ts +98 -0
  927. package/src/latin-company-form.ts +38 -0
  928. package/src/latin-word-boundary.ts +46 -0
  929. package/src/lexicon-genres.ts +1 -1
  930. package/src/link-shape.ts +19 -0
  931. package/src/link-title.ts +38 -0
  932. package/src/list-item-paragraphs.ts +22 -0
  933. package/src/literal-quote.ts +55 -0
  934. package/src/nado-closed-list.ts +48 -5
  935. package/src/name-end-letter.ts +9 -0
  936. package/src/name-given-before.ts +40 -0
  937. package/src/name-separator.ts +91 -5
  938. package/src/name-variants.ts +21 -11
  939. package/src/name-word-order.ts +62 -17
  940. package/src/nominal-stem.ts +93 -0
  941. package/src/person-forms.ts +15 -0
  942. package/src/plugin.ts +5 -0
  943. package/src/preamble-paragraphs.ts +13 -3
  944. package/src/sentence-load.ts +7 -2
  945. package/src/spacing-code.ts +5 -1
  946. package/src/split-noun.ts +63 -0
  947. package/src/structure/attached-parts.ts +32 -0
  948. package/src/structure/build.ts +7 -4
  949. package/src/structure/cited-document-section.ts +42 -0
  950. package/src/structure/contents-lines.ts +63 -0
  951. package/src/structure/defining-names.ts +155 -0
  952. package/src/structure/definition-use.ts +116 -25
  953. package/src/structure/html-text-blocks.ts +45 -0
  954. package/src/structure/issues.ts +26 -7
  955. package/src/structure/labelled-date-order.ts +5 -2
  956. package/src/structure/labelled-order.ts +12 -3
  957. package/src/structure/list-lead-in.ts +94 -0
  958. package/src/structure/list-numbering.ts +100 -11
  959. package/src/structure/listed-paragraph.ts +45 -0
  960. package/src/structure/modal-conflict.ts +42 -7
  961. package/src/structure/negated-act.ts +49 -0
  962. package/src/structure/numbering.ts +70 -26
  963. package/src/structure/prose-total.ts +20 -6
  964. package/src/structure/reference-text.ts +25 -3
  965. package/src/structure/repeated-number.ts +110 -0
  966. package/src/structure/rounded-amount.ts +55 -0
  967. package/src/structure/section-names.ts +32 -0
  968. package/src/structure/side-step.ts +21 -0
  969. package/src/structure/spanned-label-blank.ts +39 -0
  970. package/src/structure/universal.ts +11 -2
  971. package/src/structure/unspaced-heading.ts +27 -0
  972. package/src/structure/versioned-label.ts +52 -0
  973. package/src/structure/written-headings.ts +137 -0
  974. package/src/structure/written-list-path.ts +46 -0
  975. package/src/structure/written-resolve.ts +64 -0
  976. package/src/title-line.ts +52 -0
@@ -11,6 +11,9 @@ export const REQUEST_LEXICONS = {
11
11
  owner: "request-owner",
12
12
  pointer: "request-pointer",
13
13
  offer: "request-offer",
14
+ timing: "request-timing",
15
+ invitation: "request-invitation",
16
+ contact: "request-contact",
14
17
  };
15
18
  /** A clock time (14:00, 14時, 2pm) says when as much as a date does; a duration (3時間) does not. */
16
19
  const CLOCK = /\d{1,2}\s*(?:[::]\d{2}|時(?!間)|\s?[ap]\.?m\.?(?![a-z]))/iu;
@@ -23,6 +26,9 @@ const wordsOf = (doc) => ({
23
26
  owner: patternsOf(doc.lexicons[REQUEST_LEXICONS.owner]),
24
27
  pointer: patternsOf(doc.lexicons[REQUEST_LEXICONS.pointer]),
25
28
  offer: patternsOf(doc.lexicons[REQUEST_LEXICONS.offer]),
29
+ timing: patternsOf(doc.lexicons[REQUEST_LEXICONS.timing]),
30
+ invitation: patternsOf(doc.lexicons[REQUEST_LEXICONS.invitation]),
31
+ contact: patternsOf(doc.lexicons[REQUEST_LEXICONS.contact]),
26
32
  });
27
33
  /** How far apart, in characters, the action word and the request ending may be: the action must be what is requested. */
28
34
  const ACTION_REACH = 12;
@@ -39,16 +45,36 @@ const placesOf = (text, patterns) => {
39
45
  };
40
46
  export const containsAny = (text, patterns) => placesOf(text, patterns).length > 0;
41
47
  const gapBetween = (left, right) => Math.max(left.start - right.end, right.start - left.end, 0);
48
+ /** An invitation verb right at the request ending (「ご相談ください」 "please come"): the reader may come, nothing is to be finished. */
49
+ const INVITATION_REACH = 1;
50
+ /** A comma or semicolon between an action and the invitation: the action is a request of its own (「申請書を提出し、会場へお越しください」). */
51
+ const CLAUSE_BREAK = /[、,,;;]/u;
52
+ /** A label and a colon (「電話:」 "Fax:"): a contact line, whose request is how to reach the writer. */
53
+ const LABEL_COLON = /^\s*[::]/u;
54
+ /** Whether the action is what the invitation is for (「登録をしにお越しください」「入力用にご使用ください」), not a request beside it. */
55
+ const invitedTo = (comparable, action, invitation) => {
56
+ const [left, right] = action.start <= invitation.start ? [action, invitation] : [invitation, action];
57
+ return !CLAUSE_BREAK.test(comparable.slice(left.end, right.start));
58
+ };
59
+ const holdsContactLine = (text, words) => {
60
+ const comparable = comparableWords(text);
61
+ return placesOf(comparable, words.contact).some((label) => LABEL_COLON.test(comparable.slice(label.end)));
62
+ };
42
63
  /**
43
64
  * A request for an action: an action word next to a request ending (「確認してください」「please send」), not a condition
44
65
  * (「ご不明な点があれば…ください」 is an offer), not an open offer to take the reader's questions (「ご質問はメールでお送りください」),
45
- * and not a pointer to where to read more (「詳細は資料をご確認ください」).
66
+ * not a pointer to where to read more (「詳細は資料をご確認ください」), not what an invitation is for (「登録をしにお越しください」),
67
+ * and not the way to reach the writer on a contact line (「ファックス番号:… 送信後、ご連絡ください」).
46
68
  * The action has to be close to the ending, or a noun like 検討会 or 履修登録 earlier in the sentence would make one.
47
69
  */
48
70
  export const isRequest = (text, words) => {
71
+ const comparable = comparableWords(text);
49
72
  const endings = placesOf(text, words.ending);
50
- const asked = placesOf(text, words.action).some((action) => endings.some((ending) => gapBetween(action, ending) <= ACTION_REACH));
51
- return asked && ![words.condition, words.offer, words.pointer].some((patterns) => containsAny(text, patterns));
73
+ const invitations = placesOf(text, words.invitation).filter((invitation) => endings.some((ending) => gapBetween(invitation, ending) <= INVITATION_REACH));
74
+ const asked = placesOf(text, words.action).some((action) => endings.some((ending) => gapBetween(action, ending) <= ACTION_REACH) && !invitations.some((invitation) => invitedTo(comparable, action, invitation)));
75
+ if (!asked || holdsContactLine(text, words))
76
+ return false;
77
+ return ![words.condition, words.offer, words.pointer].some((patterns) => containsAny(text, patterns));
52
78
  };
53
79
  const NAMED = new Set(["PROPN"]);
54
80
  /** A proper noun in the request itself (「Ito, please share」) names who; one in the next sentence may be a product or a place. */
@@ -81,17 +107,39 @@ const holdsWord = (sentence, patterns) => {
81
107
  const bounds = wordBounds(comparable, sentence);
82
108
  return placesOf(comparable, patterns).some((place) => bounds === undefined || (bounds.starts.has(place.start) && bounds.ends.has(place.end)));
83
109
  };
84
- /** Whether a sentence says when (a date, a clock time, a deadline word) or who (a role; a name in the request itself). */
110
+ /**
111
+ * Whether a sentence says when or who (a role). The request itself may also say when relative to something else
112
+ * (「提出いただく前に」 "before you submit") or name the person; the next sentence's timing or name may be about something else.
113
+ */
85
114
  const saysWhenOrWho = (sentence, words, dates, isRequestItself) => datedWithin(dates, sentence.span) ||
86
115
  CLOCK.test(proseText(sentence)) ||
87
116
  holdsWord(sentence, words.deadline) ||
88
117
  holdsWord(sentence, words.owner) ||
89
- (isRequestItself && namesSomeone(sentence));
118
+ (isRequestItself && (holdsWord(sentence, words.timing) || namesSomeone(sentence)));
90
119
  /** A paragraph break or a new list item between two sentences: the second does not continue the first. */
91
120
  const BREAK = /\n[^\S\n]*\n|\n[^\S\n]*(?:[-*+]|\d+[.)])[^\S\n]/u;
92
121
  const continues = (source, sentence, next) => next !== undefined && !BREAK.test(source.slice(sentence.span.end, next.span.start));
93
122
  const dateSpans = (tree) => tree === undefined ? [] : inDocumentOrder(tree).flatMap((node) => (node.kind === "date" ? [node.span] : []));
94
- /** The request sentences with neither a deadline nor a person in them or in the sentence after, in the same paragraph or item. */
123
+ /** A section's heading, read as a sentence so the deadline words match it the same way. */
124
+ const headingOf = (section) => ({
125
+ span: section.span,
126
+ text: section.heading,
127
+ ...(section.headingTokens === undefined ? {} : { tokens: section.headingTokens }),
128
+ });
129
+ /** The headings an offset sits under: its own section's, then each enclosing one's up to the title. */
130
+ const enclosingHeadings = (sections, offset) => {
131
+ const own = sections.findLastIndex((section) => section.span.start <= offset);
132
+ const chain = sections
133
+ .slice(0, own + 1)
134
+ .reduceRight((walk, section) => (section.depth < walk.depth ? { depth: section.depth, found: [...walk.found, section] } : walk), { depth: Number.POSITIVE_INFINITY, found: [] }).found;
135
+ return chain.filter((section) => section.depth > 0 && section.heading.trim() !== "").map(headingOf);
136
+ };
137
+ /**
138
+ * A notice whose heading names its deadline (「見積提出期限:10月26日」「【随時受付】」): every request under it inherits it.
139
+ * A date alone in a heading is more often the day the notice was issued or the event it announces, so it is not enough.
140
+ */
141
+ const underDeadlineHeading = (sections, sentence, words) => enclosingHeadings(sections, sentence.span.start).some((heading) => holdsWord(heading, words.deadline));
142
+ /** The request sentences with neither a deadline nor a person in them, in the sentence after (same paragraph or item), or in a heading above. */
95
143
  export const ownerlessRequests = (doc) => {
96
144
  const words = wordsOf(doc);
97
145
  const dates = dateSpans(doc.structure);
@@ -99,7 +147,9 @@ export const ownerlessRequests = (doc) => {
99
147
  if (!isRequest(proseText(sentence), words) || saysWhenOrWho(sentence, words, dates, true))
100
148
  return false;
101
149
  const next = doc.sentences[index + 1];
102
- return !continues(doc.source, sentence, next) || !saysWhenOrWho(next, words, dates, false);
150
+ if (continues(doc.source, sentence, next) && saysWhenOrWho(next, words, dates, false))
151
+ return false;
152
+ return !underDeadlineHeading(doc.sections, sentence, words);
103
153
  });
104
154
  };
105
155
  export const requestWithoutDeadline = (doc) => ownerlessRequests(doc).map((sentence) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"request-owner.js","sourceRoot":"","sources":["../../src/detectors/request-owner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,oFAAoF;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,gBAAgB;IACxB,SAAS,EAAE,mBAAmB;IAC9B,QAAQ,EAAE,kBAAkB;IAC5B,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,eAAe;CACd,CAAC;AAIX,kGAAkG;AAClG,MAAM,KAAK,GAAG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QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAa,CAAC,GAAkB,EAAa,EAAE,CAChF,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACxC,IAAI,EAAE,0BAA0B;IAChC,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC;IAC1B,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE;CACxC,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"requirement-smell.d.ts","sourceRoot":"","sources":["../../src/detectors/requirement-smell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,OAAO,EAA+B,QAAQ,EAAE,MAAM,cAAc,CAAC;AA0BtG,eAAO,MAAM,aAAa,GAAI,UAAU,QAAQ,EAAE,SAAS,OAAO,EAAE,YAAY,OAAO,KAAG,OACwB,CAAC;AAoCnH,eAAO,MAAM,gBAAgB,EAAE,QAQ9B,CAAC"}
1
+ {"version":3,"file":"requirement-smell.d.ts","sourceRoot":"","sources":["../../src/detectors/requirement-smell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,OAAO,EAA+B,QAAQ,EAAE,MAAM,cAAc,CAAC;AAsCtG,eAAO,MAAM,aAAa,GAAI,UAAU,QAAQ,EAAE,SAAS,OAAO,EAAE,YAAY,OAAO,KAAG,OACwB,CAAC;AAsEnH,eAAO,MAAM,gBAAgB,EAAE,QAQ9B,CAAC"}
@@ -1,12 +1,24 @@
1
1
  import { entryCloses, entryIn, entryRanges } from "./lexicon-match.js";
2
+ import { classWordsOf, isClassCue, namesClassAfter } from "./open-end-class.js";
3
+ import { glossesCondition } from "./open-end-condition.js";
2
4
  import { openEndAt, openEndNames } from "./open-end-names.js";
5
+ import { asksAfter, questionWordsOf } from "./open-end-question.js";
6
+ import { isScopeCue, openOnPurpose, scopeWordsOf } from "./open-end-scope.js";
7
+ import { statesConcrete } from "./vague-deadline.js";
3
8
  // Requirements smells (Femmer et al. 2017; Berry et al. 2003; ISO/IEC/IEEE 29148): a loophole, an open-ended list and
4
9
  // "and/or", in a sentence that states a requirement. What makes a sentence a requirement, and each smell's words, come
5
10
  // from the language's lexicons; this file knows neither language.
6
11
  const OPEN_END = "requirement-open-end";
12
+ const LOOPHOLE = "requirement-loophole";
13
+ /** The words of a question that an open list gives example answers to. */
14
+ const OPEN_QUESTION = "requirement-open-question";
15
+ /** The words of a condition whose bracketed examples an open list may give. */
16
+ const OPEN_CONDITION = "requirement-open-condition";
17
+ const TIME = "time";
18
+ const CONCRETE_DEADLINE = "concrete-deadline";
7
19
  /** Each smell: the lexicon of its words, and the finding's variant (the rule's messages). */
8
20
  const SMELLS = [
9
- { lexicon: "requirement-loophole", variant: "loophole" },
21
+ { lexicon: LOOPHOLE, variant: "loophole" },
10
22
  { lexicon: OPEN_END, variant: "open-end" },
11
23
  { lexicon: "requirement-either", variant: "either" },
12
24
  ];
@@ -32,18 +44,38 @@ const findingOf = (sentence, entry, variant, offset) => ({
32
44
  variant,
33
45
  values: { matched: entry.pattern, offset },
34
46
  });
35
- /** Where the word stands as a smell. An open-end word inside a name the document gives (業務執行取締役等) is none; without tokens it cannot be told apart. */
47
+ /** A loophole about when (group: time) that the sentence bounds with a stated limit ("as soon as possible, but no later than two days after"). */
48
+ const boundedInTime = (doc, sentence, entry, lexicon) => lexicon === LOOPHOLE &&
49
+ entry.group === TIME &&
50
+ statesConcrete({ start: sentence.span.start, text: sentence.text }, (doc.lexicons[CONCRETE_DEADLINE] ?? []).map((limit) => limit.pattern));
51
+ /** A lexicon's words; the open-end lexicon also holds the cues of a class named after the list and of what holds it, which are no smell. */
52
+ const smellWords = (doc, lexicon) => (doc.lexicons[lexicon] ?? []).filter((entry) => !isClassCue(entry) && !isScopeCue(entry));
53
+ /**
54
+ * Where the word stands as a smell. An open-end word inside a name the document gives (業務執行取締役等), giving examples
55
+ * of a class named right after it (印刷等、二次的に利用), or ending a list a condition, a permission or a prohibition holds
56
+ * (転載等をしてはならない), is none; without tokens none of these can be told apart.
57
+ */
36
58
  const smellAt = (doc, sentence, entry, lexicon, names) => {
37
- if (!entryIn(sentence, entry))
59
+ if (!entryIn(sentence, entry) || boundedInTime(doc, sentence, entry, lexicon))
38
60
  return undefined;
39
61
  const tokenized = sentence.tokens !== undefined && (entry.tokens?.length ?? 0) > 0;
40
- return lexicon === OPEN_END && tokenized ? openEndAt(doc, sentence, entry, names()) : offsetOf(sentence, entry);
62
+ if (lexicon !== OPEN_END || !tokenized)
63
+ return offsetOf(sentence, entry);
64
+ const classWords = classWordsOf(doc.lexicons[OPEN_END] ?? []);
65
+ const scopeWords = scopeWordsOf(doc.lexicons[OPEN_END] ?? []);
66
+ return openEndAt(doc, sentence, entry, names(), (tokens, range) => namesClassAfter(tokens, range, classWords) || openOnPurpose(tokens, range, scopeWords));
41
67
  };
68
+ /** An open list right before a question the reader answers (…措置など、どのような措置を求めるのか): its items are example answers. */
69
+ const answersQuestion = (doc, sentence, entry, lexicon, offset) => lexicon === OPEN_END && asksAfter(sentence, offset + entry.pattern.length, questionWordsOf(doc.lexicons[OPEN_QUESTION] ?? []));
70
+ /** An open list in brackets right after a condition word (場合(単一テーブルへの SELECT 等)): examples of when, not of what. */
71
+ const glossesConditionAt = (doc, sentence, lexicon, offset) => lexicon === OPEN_END &&
72
+ glossesCondition(sentence, offset, (doc.lexicons[OPEN_CONDITION] ?? []).map((entry) => entry.pattern));
42
73
  /** The first word of each smell in one requirement sentence: one finding per smell, not per word. */
43
- const smellsIn = (doc, sentence, names) => SMELLS.flatMap(({ lexicon, variant }) => (doc.lexicons[lexicon] ?? [])
74
+ const smellsIn = (doc, sentence, names) => SMELLS.flatMap(({ lexicon, variant }) => smellWords(doc, lexicon)
44
75
  .flatMap((entry) => {
45
76
  const offset = smellAt(doc, sentence, entry, lexicon, names);
46
- return offset === undefined ? [] : [findingOf(sentence, entry, variant, offset)];
77
+ const examples = offset !== undefined && (answersQuestion(doc, sentence, entry, lexicon, offset) || glossesConditionAt(doc, sentence, lexicon, offset));
78
+ return offset === undefined || examples ? [] : [findingOf(sentence, entry, variant, offset)];
47
79
  })
48
80
  .slice(0, 1));
49
81
  export const requirementSmell = (doc) => {
@@ -52,7 +84,7 @@ export const requirementSmell = (doc) => {
52
84
  const statements = (doc.lexicons[STATEMENTS] ?? []).map((entry) => entry.pattern);
53
85
  // Read once, and only when a requirement has an open-end word to tell apart from a name.
54
86
  const cache = {};
55
- const names = () => (cache.names ??= openEndNames(doc, doc.lexicons[OPEN_END] ?? [], statements));
87
+ const names = () => (cache.names ??= openEndNames(doc, smellWords(doc, OPEN_END), statements));
56
88
  return doc.sentences.filter((sentence) => isRequirement(sentence, markers, notMarkers)).flatMap((sentence) => smellsIn(doc, sentence, names));
57
89
  };
58
90
  //# sourceMappingURL=requirement-smell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"requirement-smell.js","sourceRoot":"","sources":["../../src/detectors/requirement-smell.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AAEjF,sHAAsH;AACtH,uHAAuH;AACvH,kEAAkE;AAElE,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AAExC,6FAA6F;AAC7F,MAAM,MAAM,GAAG;IACb,EAAE,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,UAAU,EAAE;IACxD,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE;IAC1C,EAAE,OAAO,EAAE,oBAAoB,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AAE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAChJ,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { CurrencyForm } from "./currency-notation.ts";
2
+ /** A number with a word of scale: from its currency mark (if any) to the end of its unit, and the unit ("" when bare). */
3
+ export type ScaledFigure = {
4
+ readonly offset: number;
5
+ readonly end: number;
6
+ readonly written: string;
7
+ readonly scale: string;
8
+ readonly unit: string;
9
+ };
10
+ export type ScaleWords = {
11
+ readonly scales: readonly string[];
12
+ readonly forms: readonly CurrencyForm[];
13
+ readonly joiners: readonly string[];
14
+ };
15
+ export type ScaleGap = {
16
+ readonly figure: ScaledFigure;
17
+ readonly unit: string;
18
+ };
19
+ /** How many numbers must carry the unit before the one without it reads as a slip rather than a way of writing. */
20
+ export declare const MIN_WITH_UNIT = 5;
21
+ /** Every number with a word of scale in a text, in order; one that runs on into another number (1億2,000万円) is left out. */
22
+ export declare const scaledFiguresIn: (text: string, words: ScaleWords) => ScaledFigure[];
23
+ /**
24
+ * The one bare number of a word of scale whose other numbers all carry one unit, at least MIN_WITH_UNIT times. Two bare
25
+ * numbers, or two units (百万円 and 百万株), and the document is read as writing the word that way on purpose.
26
+ */
27
+ export declare const scaleGaps: (text: string, figures: readonly ScaledFigure[], joiners: readonly string[]) => ScaleGap[];
28
+ //# sourceMappingURL=scaled-figure-unit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaled-figure-unit.d.ts","sourceRoot":"","sources":["../../src/detectors/scaled-figure-unit.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,0HAA0H;AAC1H,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtJ,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE9I,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,mHAAmH;AACnH,eAAO,MAAM,aAAa,IAAI,CAAC;AAiD/B,2HAA2H;AAC3H,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,OAAO,UAAU,KAAG,YAAY,EAC2D,CAAC;AAqB1I;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,SAAS,SAAS,YAAY,EAAE,EAAE,SAAS,SAAS,MAAM,EAAE,KAAG,QAAQ,EAW9G,CAAC"}
@@ -0,0 +1,78 @@
1
+ // number-without-unit, in prose: a number written with a word of scale and no unit (83,494百万, 83 million) where the
2
+ // document writes that word of scale with one unit many times and without one nowhere else (83,494百万円, $83 million).
3
+ // Pure; the words of scale, the currency marks and the joiners come from the language's lexicons.
4
+ import { escapeRegExp } from "../orthography.js";
5
+ import { AMOUNT } from "./currency-notation.js";
6
+ /** How many numbers must carry the unit before the one without it reads as a slip rather than a way of writing. */
7
+ export const MIN_WITH_UNIT = 5;
8
+ const LATIN = /[A-Za-z]/u;
9
+ const longestFirst = (words) => words.toSorted((left, right) => right.length - left.length);
10
+ const figurePattern = (scales) => {
11
+ const scale = longestFirst(scales)
12
+ .map((word) => `${escapeRegExp(word)}${LATIN.test(word) ? "(?![A-Za-z])" : ""}`)
13
+ .join("|");
14
+ return new RegExp(`(?<![\\w.,,.0-9])${AMOUNT}\\s?(?:${scale})`, "gu");
15
+ };
16
+ const formMatches = (text, pattern, side) => {
17
+ if (side === "before")
18
+ return text.endsWith(pattern) && !(LATIN.test(pattern.charAt(0)) && LATIN.test(text.charAt(text.length - pattern.length - 1)));
19
+ return text.startsWith(pattern) && !(LATIN.test(pattern.at(-1) ?? "") && LATIN.test(text.charAt(pattern.length)));
20
+ };
21
+ /** The currency mark written before a number ($, US$, ¥), with the one space it may have. */
22
+ const markBefore = (text, offset, forms) => {
23
+ const before = text.slice(Math.max(0, offset - 8), offset);
24
+ const spaced = before.endsWith(" ") ? before.slice(0, -1) : before;
25
+ const form = longestFirst(forms.filter((entry) => entry.position === "before").map((entry) => entry.pattern)).find((pattern) => formMatches(spaced, pattern, "before"));
26
+ if (form === undefined)
27
+ return "";
28
+ return spaced === before ? form : `${form} `;
29
+ };
30
+ /** What follows a word of scale as its unit: a currency word (円, dollars), else the next word ("people", 人, ドル); "" when none. */
31
+ const unitAfter = (rest, forms) => {
32
+ const spaced = rest.startsWith(" ") ? rest.slice(1) : rest;
33
+ const form = longestFirst(forms.filter((entry) => entry.position === "after").map((entry) => entry.pattern)).find((pattern) => formMatches(spaced, pattern, "after"));
34
+ const word = form ?? /^(?:[A-Za-z]+|[\p{Script=Katakana}ー]+|\p{Script=Han})/u.exec(spaced)?.[0];
35
+ if (word === undefined)
36
+ return "";
37
+ return spaced === rest ? word : ` ${word}`;
38
+ };
39
+ const figureAt = (text, match, words) => {
40
+ const end = match.index + match[0].length;
41
+ const rest = text.slice(end);
42
+ if (/^\s?[0-90-9]/u.test(rest))
43
+ return undefined;
44
+ const mark = markBefore(text, match.index, words.forms);
45
+ const after = mark === "" ? unitAfter(rest, words.forms) : "";
46
+ const scale = longestFirst(words.scales).find((word) => match[0].endsWith(word)) ?? "";
47
+ return { offset: match.index - mark.length, end: end + after.length, written: match[0], scale, unit: (mark || after).trim() };
48
+ };
49
+ /** Every number with a word of scale in a text, in order; one that runs on into another number (1億2,000万円) is left out. */
50
+ export const scaledFiguresIn = (text, words) => words.scales.length === 0 ? [] : [...text.matchAll(figurePattern(words.scales))].flatMap((match) => figureAt(text, match, words) ?? []);
51
+ /** A bare number joined to its neighbour by a range or list word, so that one unit serves both (100百万〜200百万円). */
52
+ const sharesUnit = (text, left, right, joiners) => {
53
+ if (left === undefined || right === undefined)
54
+ return false;
55
+ const gap = text.slice(left.end, right.offset).trim();
56
+ return gap === "" || joiners.includes(gap) || joiners.includes(gap.toLowerCase());
57
+ };
58
+ const gapOfScale = (text, figures, joiners) => {
59
+ const bare = figures.filter((figure, index) => figure.unit === "" && !sharesUnit(text, figure, figures[index + 1], joiners) && !sharesUnit(text, figures[index - 1], figure, joiners));
60
+ const withUnit = figures.filter((figure) => figure.unit !== "");
61
+ const units = new Set(withUnit.map((figure) => figure.unit));
62
+ const [unit] = units;
63
+ const [figure] = bare;
64
+ if (figure === undefined || unit === undefined || bare.length !== 1 || units.size !== 1 || withUnit.length < MIN_WITH_UNIT)
65
+ return [];
66
+ return [{ figure, unit }];
67
+ };
68
+ /**
69
+ * The one bare number of a word of scale whose other numbers all carry one unit, at least MIN_WITH_UNIT times. Two bare
70
+ * numbers, or two units (百万円 and 百万株), and the document is read as writing the word that way on purpose.
71
+ */
72
+ export const scaleGaps = (text, figures, joiners) => {
73
+ const scales = [...new Set(figures.map((figure) => figure.scale))];
74
+ return scales
75
+ .flatMap((scale) => gapOfScale(text, figures.filter((figure) => figure.scale === scale), joiners))
76
+ .toSorted((left, right) => left.figure.offset - right.figure.offset);
77
+ };
78
+ //# sourceMappingURL=scaled-figure-unit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaled-figure-unit.js","sourceRoot":"","sources":["../../src/detectors/scaled-figure-unit.ts"],"names":[],"mappings":"AAAA,oHAA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M,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnE,OAAO,MAAM;SACV,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACjB,UAAU,CACR,IAAI,EACJ,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,EAClD,OAAO,CACR,CACF;SACA,QAAQ,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACzE,CAAC,CAAC"}
@@ -1,4 +1,6 @@
1
1
  import type { Detector, Lexicon, Sentence, Token } from "../plugin.ts";
2
+ /** The terms whose counted word belongs to the term itself (電磁的方法), not to the writer's style. */
3
+ export declare const FIXED_TERM_LEXICON = "teki-fixed-term";
2
4
  /** A sentence holding more than limit tokens written as one of the lexicon's words (the suffix 的). */
3
5
  export declare const sentenceWordCount: Detector;
4
6
  /** A comma between two nouns separates listed items (名前、会社名、連絡先), not clauses. A bracketed note after an item is part of it. */
@@ -1 +1 @@
1
- {"version":3,"file":"sentence-counts.d.ts","sourceRoot":"","sources":["../../src/detectors/sentence-counts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA4B,OAAO,EAAiB,QAAQ,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AA6BhH,sGAAsG;AACtG,eAAO,MAAM,iBAAiB,EAAE,QAG/B,CAAC;AAsBF,gIAAgI;AAChI,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,EAAE,QAAQ,SAAS,KAAK,EAAE,KAAG,OACyB,CAAC;AAEhG,mHAAmH;AACnH,eAAO,MAAM,kBAAkB,EAAE,QAGhC,CAAC;AAIF,yIAAyI;AACzI,e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S,OAAO,EAAE,aAAY,OAAY,KAAG,MAAM,EAAE,EAW5E,CAAC;AAcrC,mHAAmH;AACnH,eAAO,MAAM,SAAS,EAAE,QAQvB,CAAC"}
@@ -1,10 +1,21 @@
1
+ import { escapeRegExp } from "../orthography.js";
1
2
  import { isWithinAny, quotedIn } from "../quoted-span.js";
2
3
  import { entryOpens } from "./lexicon-match.js";
3
4
  const wordsOf = (lexicon) => new Set((lexicon ?? []).map((entry) => entry.pattern));
4
- /** The tokens of a sentence that pass the test, outside anything quoted in 「」『』: a quotation is not the writer's to rephrase. */
5
- const countedTokens = (sentence, test) => {
6
- const quoted = quotedIn(sentence);
7
- return (sentence.tokens ?? []).filter((token, at, tokens) => test(token, at, tokens) && !isWithinAny(quoted, token.span));
5
+ /** The terms whose counted word belongs to the term itself (電磁的方法), not to the writer's style. */
6
+ export const FIXED_TERM_LEXICON = "teki-fixed-term";
7
+ /** Where the sentence holds one of the terms, in the document's coordinates. */
8
+ const termSpans = (sentence, terms) => terms.flatMap((entry) => [...sentence.text.matchAll(new RegExp(escapeRegExp(entry.pattern), "gu"))].map((match) => ({
9
+ start: sentence.span.start + match.index,
10
+ end: sentence.span.start + match.index + entry.pattern.length,
11
+ })));
12
+ /**
13
+ * The tokens of a sentence that pass the test, outside anything quoted in 「」『』 and outside the fixed terms: neither a
14
+ * quotation nor a term the law defines (電磁的方法) is the writer's to rephrase.
15
+ */
16
+ const countedTokens = (sentence, test, fixedTerms) => {
17
+ const kept = [...quotedIn(sentence), ...termSpans(sentence, fixedTerms)];
18
+ return (sentence.tokens ?? []).filter((token, at, tokens) => test(token, at, tokens) && !isWithinAny(kept, token.span));
8
19
  };
9
20
  const findingOf = (sentence, counted, limit) => ({
10
21
  rule: "",
@@ -14,14 +25,14 @@ const findingOf = (sentence, counted, limit) => ({
14
25
  quote: sentence.text.trim(),
15
26
  values: { word: counted[0]?.surface ?? "", count: counted.length, limit, offset: sentence.span.start },
16
27
  });
17
- const sentencesOver = (doc, limit, test) => doc.sentences.flatMap((sentence) => {
18
- const counted = countedTokens(sentence, test);
28
+ const sentencesOver = (doc, limit, test, fixedTerms = []) => doc.sentences.flatMap((sentence) => {
29
+ const counted = countedTokens(sentence, test, fixedTerms);
19
30
  return counted.length > limit ? [findingOf(sentence, counted, limit)] : [];
20
31
  });
21
32
  /** A sentence holding more than limit tokens written as one of the lexicon's words (the suffix 的). */
22
33
  export const sentenceWordCount = (doc, options) => {
23
34
  const words = wordsOf(options.lexicon);
24
- return sentencesOver(doc, options.limit, (token) => words.has(token.surface));
35
+ return sentencesOver(doc, options.limit, (token) => words.has(token.surface), doc.lexicons[FIXED_TERM_LEXICON] ?? []);
25
36
  };
26
37
  const NOMINAL = new Set(["NOUN", "PROPN", "NUM"]);
27
38
  const isNominal = (token) => token !== undefined && NOMINAL.has(token.pos);
@@ -1 +1 @@
1
- {"version":3,"file":"sentence-counts.js","sourceRoot":"","sources":["../../src/detectors/sentence-counts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,MAAM,OAAO,GAAG,CAAC,OAA4B,EAAuB,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAE9H,iIAAiI;AACjI,MAAM,aAAa,GAAG,CAAC,QAAkB,EAAE,IAAe,EAAW,EAAE;IACrE,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW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jD,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;SAC3C,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAC1C,CAAC;AACJ,CAAC,CAAC"}
@@ -6,6 +6,8 @@ import type { Detector, LexiconEntry, ProseDocument, Sentence } from "../plugin.
6
6
  * どちらが正しいかは決めない。決めると、方針の違う書き手にそのまま無視される。
7
7
  * 見るのは文書の中での一貫性だけで、少数派のほうを指摘する。spec §12.3 の方針を日本語にも。
8
8
  * 終止符で終わらないもの(見出しの下の `MaaSサービス` のような名前だけの行)と、項目や段落の頭の太字の札(**速く書ける。**)は文として数えない。
9
+ * 年表の行(1921年信号装置の製作を開始する。)も、文書の文体と揃えない書き方なので数えない。
10
+ * 断り書きの段落(…ご了承ください。)も、本文とは別の声で書く決まり文句なので数えない(notice-paragraph.ts)。
9
11
  */
10
12
  type Entry = {
11
13
  readonly sentence: Sentence;
@@ -1 +1 @@
1
- {"version":3,"file":"sentence-ending.d.ts","sourceRoot":"","sources":["../../src/detectors/sentence-ending.ts"],"names":[],"mappings":"AAEA,OAAO,EAA+C,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,KAAK,EAAE,QAAQ,EAAW,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAQ,MAAM,cAAc,CAAC;AAEnG;;;;;;GAMG;AACH,KAAK,KAAK,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAoB9G,2DAA2D;AAC3D,eAAO,MAAM,eAAe,GAAI,KAAK,aAAa,EAAE,QAAQ,SAAS,YAAY,EAAE,KAAG,KAAK,EAa1F,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAY5B,CAAC"}
1
+ {"version":3,"file":"sentence-ending.d.ts","sourceRoot":"","sources":["../../src/detectors/sentence-ending.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2D,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIvG,OAAO,KAAK,EAAE,QAAQ,EAAW,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAQ,MAAM,cAAc,CAAC;AAEnG;;;;;;;;GAQG;AACH,KAAK,KAAK,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAoB9G,2DAA2D;AAC3D,eAAO,MAAM,eAAe,GAAI,KAAK,aAAa,EAAE,QAAQ,SAAS,YAAY,EAAE,KAAG,KAAK,EAkB1F,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAY5B,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import { endingTokens, isClosed } from "../sentence-shape.js";
2
2
  import { enumeratedRuns, enumeratorStarts, numberedStarts } from "./enumerated-runs.js";
3
- import { continuesInto, groupOf, registerOf, slipsOf } from "./register.js";
3
+ import { continuesInto, groupOf, majorityOf, registerOf, slipsOf } from "./register.js";
4
4
  import { isRunInLabel } from "./run-in-label.js";
5
+ import { noticeSentences } from "./notice-paragraph.js";
6
+ import { chronologyRows } from "../chronology-rows.js";
5
7
  const registerOfSentence = (sentence, polite, neutral) => {
6
8
  const ending = endingTokens(sentence);
7
9
  const tokens = sentence.tokens ?? [];
@@ -19,12 +21,17 @@ const runsOf = (doc, registers) => {
19
21
  export const judgedSentences = (doc, polite) => {
20
22
  const neutral = doc.lexicons["neutral-ending"] ?? [];
21
23
  const lists = doc.lists.map((list) => list.span);
22
- const found = doc.sentences.flatMap((sentence, index) => {
23
- if (!isClosed(sentence) || continuesInto(sentence, doc.sentences[index + 1]) || isRunInLabel(doc.source, sentence.span))
24
+ const rows = chronologyRows(doc);
25
+ const all = doc.sentences.flatMap((sentence, index) => {
26
+ if (!isClosed(sentence) || rows.has(sentence) || continuesInto(sentence, doc.sentences[index + 1]) || isRunInLabel(doc.source, sentence.span))
24
27
  return [];
25
28
  const register = registerOfSentence(sentence, polite, neutral);
26
29
  return register === undefined ? [] : [{ sentence, register }];
27
30
  });
31
+ const registers = new Map(all.map((entry) => [entry.sentence, entry.register]));
32
+ const majority = majorityOf(all.map((entry) => ({ register: entry.register, group: undefined })));
33
+ const notices = noticeSentences(doc.paragraphs, doc.lexicons["notice-phrase"] ?? [], (sentence) => registers.get(sentence), majority);
34
+ const found = all.filter((entry) => !notices.has(entry.sentence));
28
35
  const runs = runsOf(doc, found.map((entry) => entry.register));
29
36
  return found.map((entry) => ({ ...entry, group: groupOf(entry.sentence.span.start, lists, runs) }));
30
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sentence-ending.js","sourceRoot":"","sources":["../../src/detectors/sentence-ending.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAYjD,MAAM,kBAAkB,GAAG,CAAC,QAAkB,EAAE,MAA+B,EAAE,OAAgC,EAAwB,EAAE;IACzI,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,C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Ac,EAAE,QAYtB,CAAC"}
1
+ {"version":3,"file":"sentence-length.d.ts","sourceRoot":"","sources":["../../src/detectors/sentence-length.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAkD,MAAM,cAAc,CAAC;AAkB7F,eAAO,MAAM,cAAc,EAAE,QAc5B,CAAC"}