chaffjs 0.45.0 → 0.47.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 (460) hide show
  1. package/dist/announced-list.d.ts +2 -1
  2. package/dist/announced-list.d.ts.map +1 -1
  3. package/dist/announced-list.js +3 -1
  4. package/dist/announced-list.js.map +1 -1
  5. package/dist/body-section.d.ts +7 -0
  6. package/dist/body-section.d.ts.map +1 -1
  7. package/dist/body-section.js +15 -0
  8. package/dist/body-section.js.map +1 -1
  9. package/dist/derived/durations.d.ts +1 -0
  10. package/dist/derived/durations.d.ts.map +1 -1
  11. package/dist/derived/durations.js +2 -2
  12. package/dist/derived/durations.js.map +1 -1
  13. package/dist/derived/marked-dates.d.ts +2 -0
  14. package/dist/derived/marked-dates.d.ts.map +1 -1
  15. package/dist/derived/marked-dates.js +2 -0
  16. package/dist/derived/marked-dates.js.map +1 -1
  17. package/dist/detectors/acronym-capitals.d.ts +6 -0
  18. package/dist/detectors/acronym-capitals.d.ts.map +1 -0
  19. package/dist/detectors/acronym-capitals.js +30 -0
  20. package/dist/detectors/acronym-capitals.js.map +1 -0
  21. package/dist/detectors/bare-comparative.d.ts +1 -0
  22. package/dist/detectors/bare-comparative.d.ts.map +1 -1
  23. package/dist/detectors/bare-comparative.js +9 -2
  24. package/dist/detectors/bare-comparative.js.map +1 -1
  25. package/dist/detectors/bare-word-list.d.ts +7 -0
  26. package/dist/detectors/bare-word-list.d.ts.map +1 -0
  27. package/dist/detectors/bare-word-list.js +43 -0
  28. package/dist/detectors/bare-word-list.js.map +1 -0
  29. package/dist/detectors/bold-field-label.d.ts +8 -0
  30. package/dist/detectors/bold-field-label.d.ts.map +1 -0
  31. package/dist/detectors/bold-field-label.js +31 -0
  32. package/dist/detectors/bold-field-label.js.map +1 -0
  33. package/dist/detectors/bold-label.d.ts +21 -2
  34. package/dist/detectors/bold-label.d.ts.map +1 -1
  35. package/dist/detectors/bold-label.js +66 -13
  36. package/dist/detectors/bold-label.js.map +1 -1
  37. package/dist/detectors/broken-link.d.ts.map +1 -1
  38. package/dist/detectors/broken-link.js +22 -4
  39. package/dist/detectors/broken-link.js.map +1 -1
  40. package/dist/detectors/byline-list.d.ts +4 -0
  41. package/dist/detectors/byline-list.d.ts.map +1 -0
  42. package/dist/detectors/byline-list.js +19 -0
  43. package/dist/detectors/byline-list.js.map +1 -0
  44. package/dist/detectors/caps-screen-label.d.ts +3 -0
  45. package/dist/detectors/caps-screen-label.d.ts.map +1 -0
  46. package/dist/detectors/caps-screen-label.js +13 -0
  47. package/dist/detectors/caps-screen-label.js.map +1 -0
  48. package/dist/detectors/casual-voice.d.ts +8 -0
  49. package/dist/detectors/casual-voice.d.ts.map +1 -0
  50. package/dist/detectors/casual-voice.js +22 -0
  51. package/dist/detectors/casual-voice.js.map +1 -0
  52. package/dist/detectors/char-shape.js +1 -1
  53. package/dist/detectors/char-shape.js.map +1 -1
  54. package/dist/detectors/closing-cliche.d.ts +2 -1
  55. package/dist/detectors/closing-cliche.d.ts.map +1 -1
  56. package/dist/detectors/closing-cliche.js +10 -2
  57. package/dist/detectors/closing-cliche.js.map +1 -1
  58. package/dist/detectors/count-per-section.d.ts.map +1 -1
  59. package/dist/detectors/count-per-section.js +6 -2
  60. package/dist/detectors/count-per-section.js.map +1 -1
  61. package/dist/detectors/dangling-opener.d.ts.map +1 -1
  62. package/dist/detectors/dangling-opener.js +10 -1
  63. package/dist/detectors/dangling-opener.js.map +1 -1
  64. package/dist/detectors/date-year.d.ts.map +1 -1
  65. package/dist/detectors/date-year.js +11 -1
  66. package/dist/detectors/date-year.js.map +1 -1
  67. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  68. package/dist/detectors/defined-term-form.js +17 -3
  69. package/dist/detectors/defined-term-form.js.map +1 -1
  70. package/dist/detectors/document-shape.d.ts +4 -1
  71. package/dist/detectors/document-shape.d.ts.map +1 -1
  72. package/dist/detectors/document-shape.js +12 -2
  73. package/dist/detectors/document-shape.js.map +1 -1
  74. package/dist/detectors/doubled-punctuation.d.ts.map +1 -1
  75. package/dist/detectors/doubled-punctuation.js +24 -1
  76. package/dist/detectors/doubled-punctuation.js.map +1 -1
  77. package/dist/detectors/email-letter.d.ts.map +1 -1
  78. package/dist/detectors/email-letter.js +5 -2
  79. package/dist/detectors/email-letter.js.map +1 -1
  80. package/dist/detectors/email-subject-reference.d.ts +6 -0
  81. package/dist/detectors/email-subject-reference.d.ts.map +1 -0
  82. package/dist/detectors/email-subject-reference.js +31 -0
  83. package/dist/detectors/email-subject-reference.js.map +1 -0
  84. package/dist/detectors/en-shape.d.ts.map +1 -1
  85. package/dist/detectors/en-shape.js +5 -4
  86. package/dist/detectors/en-shape.js.map +1 -1
  87. package/dist/detectors/fact-consistency.js +2 -2
  88. package/dist/detectors/fact-consistency.js.map +1 -1
  89. package/dist/detectors/figure-order.d.ts +1 -1
  90. package/dist/detectors/figure-order.d.ts.map +1 -1
  91. package/dist/detectors/figure-order.js +7 -2
  92. package/dist/detectors/figure-order.js.map +1 -1
  93. package/dist/detectors/fullwidth-alnum.d.ts +4 -0
  94. package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
  95. package/dist/detectors/fullwidth-alnum.js +31 -9
  96. package/dist/detectors/fullwidth-alnum.js.map +1 -1
  97. package/dist/detectors/gram-heading.d.ts.map +1 -1
  98. package/dist/detectors/gram-heading.js +13 -1
  99. package/dist/detectors/gram-heading.js.map +1 -1
  100. package/dist/detectors/heading-case.d.ts.map +1 -1
  101. package/dist/detectors/heading-case.js +6 -1
  102. package/dist/detectors/heading-case.js.map +1 -1
  103. package/dist/detectors/heading-numbering.d.ts.map +1 -1
  104. package/dist/detectors/heading-numbering.js +1 -7
  105. package/dist/detectors/heading-numbering.js.map +1 -1
  106. package/dist/detectors/hyphen-name-suffix.d.ts +3 -0
  107. package/dist/detectors/hyphen-name-suffix.d.ts.map +1 -0
  108. package/dist/detectors/hyphen-name-suffix.js +24 -0
  109. package/dist/detectors/hyphen-name-suffix.js.map +1 -0
  110. package/dist/detectors/katakana-density.d.ts.map +1 -1
  111. package/dist/detectors/katakana-density.js +7 -4
  112. package/dist/detectors/katakana-density.js.map +1 -1
  113. package/dist/detectors/lexicon.d.ts +1 -0
  114. package/dist/detectors/lexicon.d.ts.map +1 -1
  115. package/dist/detectors/lexicon.js +36 -4
  116. package/dist/detectors/lexicon.js.map +1 -1
  117. package/dist/detectors/link-shape.d.ts.map +1 -1
  118. package/dist/detectors/link-shape.js +10 -2
  119. package/dist/detectors/link-shape.js.map +1 -1
  120. package/dist/detectors/list-item-phrase.d.ts +20 -0
  121. package/dist/detectors/list-item-phrase.d.ts.map +1 -0
  122. package/dist/detectors/list-item-phrase.js +73 -0
  123. package/dist/detectors/list-item-phrase.js.map +1 -0
  124. package/dist/detectors/list-layout.d.ts +5 -0
  125. package/dist/detectors/list-layout.d.ts.map +1 -1
  126. package/dist/detectors/list-layout.js +12 -0
  127. package/dist/detectors/list-layout.js.map +1 -1
  128. package/dist/detectors/list-lead-in.d.ts.map +1 -1
  129. package/dist/detectors/list-lead-in.js +1 -17
  130. package/dist/detectors/list-lead-in.js.map +1 -1
  131. package/dist/detectors/list-parallel.d.ts.map +1 -1
  132. package/dist/detectors/list-parallel.js +29 -24
  133. package/dist/detectors/list-parallel.js.map +1 -1
  134. package/dist/detectors/mark-shape.d.ts +1 -1
  135. package/dist/detectors/mark-shape.d.ts.map +1 -1
  136. package/dist/detectors/mark-shape.js +10 -3
  137. package/dist/detectors/mark-shape.js.map +1 -1
  138. package/dist/detectors/measured-facts.d.ts +5 -1
  139. package/dist/detectors/measured-facts.d.ts.map +1 -1
  140. package/dist/detectors/measured-facts.js +7 -3
  141. package/dist/detectors/measured-facts.js.map +1 -1
  142. package/dist/detectors/middle-dot.d.ts +5 -0
  143. package/dist/detectors/middle-dot.d.ts.map +1 -1
  144. package/dist/detectors/middle-dot.js +27 -0
  145. package/dist/detectors/middle-dot.js.map +1 -1
  146. package/dist/detectors/missing-final-period.d.ts.map +1 -1
  147. package/dist/detectors/missing-final-period.js +13 -1
  148. package/dist/detectors/missing-final-period.js.map +1 -1
  149. package/dist/detectors/name-variant.d.ts.map +1 -1
  150. package/dist/detectors/name-variant.js +2 -1
  151. package/dist/detectors/name-variant.js.map +1 -1
  152. package/dist/detectors/number-style.d.ts +2 -0
  153. package/dist/detectors/number-style.d.ts.map +1 -1
  154. package/dist/detectors/number-style.js +19 -4
  155. package/dist/detectors/number-style.js.map +1 -1
  156. package/dist/detectors/numeral-opener.d.ts +1 -1
  157. package/dist/detectors/numeral-opener.d.ts.map +1 -1
  158. package/dist/detectors/numeral-opener.js +4 -2
  159. package/dist/detectors/numeral-opener.js.map +1 -1
  160. package/dist/detectors/open-end-names.d.ts +2 -0
  161. package/dist/detectors/open-end-names.d.ts.map +1 -1
  162. package/dist/detectors/open-end-names.js +8 -1
  163. package/dist/detectors/open-end-names.js.map +1 -1
  164. package/dist/detectors/ordinary-phrase.d.ts +5 -0
  165. package/dist/detectors/ordinary-phrase.d.ts.map +1 -1
  166. package/dist/detectors/ordinary-phrase.js +10 -0
  167. package/dist/detectors/ordinary-phrase.js.map +1 -1
  168. package/dist/detectors/orthographic-variant.js +2 -2
  169. package/dist/detectors/orthographic-variant.js.map +1 -1
  170. package/dist/detectors/output-lead-in.d.ts +3 -0
  171. package/dist/detectors/output-lead-in.d.ts.map +1 -0
  172. package/dist/detectors/output-lead-in.js +26 -0
  173. package/dist/detectors/output-lead-in.js.map +1 -0
  174. package/dist/detectors/outside-announced-list.d.ts.map +1 -1
  175. package/dist/detectors/outside-announced-list.js +6 -1
  176. package/dist/detectors/outside-announced-list.js.map +1 -1
  177. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  178. package/dist/detectors/oxford-comma.js +3 -1
  179. package/dist/detectors/oxford-comma.js.map +1 -1
  180. package/dist/detectors/paragraph-restatement.d.ts +4 -1
  181. package/dist/detectors/paragraph-restatement.d.ts.map +1 -1
  182. package/dist/detectors/paragraph-restatement.js +17 -2
  183. package/dist/detectors/paragraph-restatement.js.map +1 -1
  184. package/dist/detectors/person-consistency.d.ts +2 -1
  185. package/dist/detectors/person-consistency.d.ts.map +1 -1
  186. package/dist/detectors/person-consistency.js +11 -2
  187. package/dist/detectors/person-consistency.js.map +1 -1
  188. package/dist/detectors/quoted-title-line.d.ts +6 -0
  189. package/dist/detectors/quoted-title-line.d.ts.map +1 -0
  190. package/dist/detectors/quoted-title-line.js +14 -0
  191. package/dist/detectors/quoted-title-line.js.map +1 -0
  192. package/dist/detectors/register-interview.d.ts +4 -0
  193. package/dist/detectors/register-interview.d.ts.map +1 -0
  194. package/dist/detectors/register-interview.js +19 -0
  195. package/dist/detectors/register-interview.js.map +1 -0
  196. package/dist/detectors/registry/colloquial-opener-pile.d.ts +3 -0
  197. package/dist/detectors/registry/colloquial-opener-pile.d.ts.map +1 -0
  198. package/dist/detectors/registry/colloquial-opener-pile.js +3 -0
  199. package/dist/detectors/registry/colloquial-opener-pile.js.map +1 -0
  200. package/dist/detectors/repeated-head.d.ts.map +1 -1
  201. package/dist/detectors/repeated-head.js +23 -4
  202. package/dist/detectors/repeated-head.js.map +1 -1
  203. package/dist/detectors/request-owner.d.ts +3 -1
  204. package/dist/detectors/request-owner.d.ts.map +1 -1
  205. package/dist/detectors/request-owner.js +5 -2
  206. package/dist/detectors/request-owner.js.map +1 -1
  207. package/dist/detectors/run-together.d.ts +3 -0
  208. package/dist/detectors/run-together.d.ts.map +1 -0
  209. package/dist/detectors/run-together.js +13 -0
  210. package/dist/detectors/run-together.js.map +1 -0
  211. package/dist/detectors/sentence-counts.d.ts +6 -2
  212. package/dist/detectors/sentence-counts.d.ts.map +1 -1
  213. package/dist/detectors/sentence-counts.js +19 -3
  214. package/dist/detectors/sentence-counts.js.map +1 -1
  215. package/dist/detectors/sentence-ending.d.ts +2 -0
  216. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  217. package/dist/detectors/sentence-ending.js +8 -2
  218. package/dist/detectors/sentence-ending.js.map +1 -1
  219. package/dist/detectors/sentence-parts.d.ts +10 -1
  220. package/dist/detectors/sentence-parts.d.ts.map +1 -1
  221. package/dist/detectors/sentence-parts.js +17 -2
  222. package/dist/detectors/sentence-parts.js.map +1 -1
  223. package/dist/detectors/space-before-punctuation.d.ts +2 -2
  224. package/dist/detectors/space-before-punctuation.d.ts.map +1 -1
  225. package/dist/detectors/space-before-punctuation.js +13 -2
  226. package/dist/detectors/space-before-punctuation.js.map +1 -1
  227. package/dist/detectors/stray-space.js +1 -1
  228. package/dist/detectors/stray-space.js.map +1 -1
  229. package/dist/detectors/structure-tree.d.ts.map +1 -1
  230. package/dist/detectors/structure-tree.js +2 -1
  231. package/dist/detectors/structure-tree.js.map +1 -1
  232. package/dist/detectors/structure.d.ts +1 -0
  233. package/dist/detectors/structure.d.ts.map +1 -1
  234. package/dist/detectors/structure.js +5 -1
  235. package/dist/detectors/structure.js.map +1 -1
  236. package/dist/detectors/superlative-context.d.ts +7 -0
  237. package/dist/detectors/superlative-context.d.ts.map +1 -1
  238. package/dist/detectors/superlative-context.js +6 -0
  239. package/dist/detectors/superlative-context.js.map +1 -1
  240. package/dist/detectors/technical-docs.d.ts.map +1 -1
  241. package/dist/detectors/technical-docs.js +5 -1
  242. package/dist/detectors/technical-docs.js.map +1 -1
  243. package/dist/detectors/token-shape.d.ts.map +1 -1
  244. package/dist/detectors/token-shape.js +16 -3
  245. package/dist/detectors/token-shape.js.map +1 -1
  246. package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
  247. package/dist/detectors/unbalanced-bracket.js +5 -1
  248. package/dist/detectors/unbalanced-bracket.js.map +1 -1
  249. package/dist/detectors/undefined-term.d.ts.map +1 -1
  250. package/dist/detectors/undefined-term.js +5 -1
  251. package/dist/detectors/undefined-term.js.map +1 -1
  252. package/dist/detectors/unknown-word-context.d.ts +8 -0
  253. package/dist/detectors/unknown-word-context.d.ts.map +1 -1
  254. package/dist/detectors/unknown-word-context.js +38 -6
  255. package/dist/detectors/unknown-word-context.js.map +1 -1
  256. package/dist/detectors/unknown-word.d.ts.map +1 -1
  257. package/dist/detectors/unknown-word.js +11 -4
  258. package/dist/detectors/unknown-word.js.map +1 -1
  259. package/dist/detectors/vague-density.d.ts.map +1 -1
  260. package/dist/detectors/vague-density.js +13 -1
  261. package/dist/detectors/vague-density.js.map +1 -1
  262. package/dist/front-matter.d.ts +3 -0
  263. package/dist/front-matter.d.ts.map +1 -0
  264. package/dist/front-matter.js +13 -0
  265. package/dist/front-matter.js.map +1 -0
  266. package/dist/genre-check.js +1 -1
  267. package/dist/genre-check.js.map +1 -1
  268. package/dist/genre.d.ts +0 -2
  269. package/dist/genre.d.ts.map +1 -1
  270. package/dist/genre.js +1 -12
  271. package/dist/genre.js.map +1 -1
  272. package/dist/labelled-note-paragraphs.d.ts +4 -0
  273. package/dist/labelled-note-paragraphs.d.ts.map +1 -0
  274. package/dist/labelled-note-paragraphs.js +21 -0
  275. package/dist/labelled-note-paragraphs.js.map +1 -0
  276. package/dist/list-lead-sentence.d.ts +6 -0
  277. package/dist/list-lead-sentence.d.ts.map +1 -0
  278. package/dist/list-lead-sentence.js +20 -0
  279. package/dist/list-lead-sentence.js.map +1 -0
  280. package/dist/paragraph-runs.d.ts +2 -1
  281. package/dist/paragraph-runs.d.ts.map +1 -1
  282. package/dist/paragraph-runs.js +19 -2
  283. package/dist/paragraph-runs.js.map +1 -1
  284. package/dist/recording-title.d.ts +5 -0
  285. package/dist/recording-title.d.ts.map +1 -0
  286. package/dist/recording-title.js +11 -0
  287. package/dist/recording-title.js.map +1 -0
  288. package/dist/sentence-load.d.ts +2 -1
  289. package/dist/sentence-load.d.ts.map +1 -1
  290. package/dist/sentence-load.js +56 -2
  291. package/dist/sentence-load.js.map +1 -1
  292. package/dist/stray-space.d.ts +5 -2
  293. package/dist/stray-space.d.ts.map +1 -1
  294. package/dist/stray-space.js +24 -2
  295. package/dist/stray-space.js.map +1 -1
  296. package/dist/structure/due-column.d.ts +5 -0
  297. package/dist/structure/due-column.d.ts.map +1 -0
  298. package/dist/structure/due-column.js +30 -0
  299. package/dist/structure/due-column.js.map +1 -0
  300. package/dist/structure/generic-role.d.ts +1 -0
  301. package/dist/structure/generic-role.d.ts.map +1 -1
  302. package/dist/structure/generic-role.js +6 -0
  303. package/dist/structure/generic-role.js.map +1 -1
  304. package/dist/structure/party-role.d.ts.map +1 -1
  305. package/dist/structure/party-role.js +4 -2
  306. package/dist/structure/party-role.js.map +1 -1
  307. package/dist/title-case-name.d.ts +5 -0
  308. package/dist/title-case-name.d.ts.map +1 -1
  309. package/dist/title-case-name.js +14 -0
  310. package/dist/title-case-name.js.map +1 -1
  311. package/package.json +3 -3
  312. package/rules/adverb-overuse.yaml +2 -2
  313. package/rules/ai-tell.yaml +2 -2
  314. package/rules/all-caps-shouting.yaml +2 -2
  315. package/rules/bare-url-mix.yaml +2 -2
  316. package/rules/bold-density.yaml +2 -2
  317. package/rules/bold-label-list.yaml +6 -6
  318. package/rules/clause-chain.yaml +2 -2
  319. package/rules/closing-cliche.yaml +2 -2
  320. package/rules/code-fence-language-mix.yaml +2 -2
  321. package/rules/colloquial-opener.yaml +3 -3
  322. package/rules/comparative-without-baseline.yaml +2 -2
  323. package/rules/dangling-participle.yaml +2 -2
  324. package/rules/date-order.yaml +2 -2
  325. package/rules/date-outside-period.yaml +1 -1
  326. package/rules/defined-term-form.yaml +2 -2
  327. package/rules/doubled-punctuation.yaml +2 -2
  328. package/rules/duration-mismatch.yaml +2 -2
  329. package/rules/email-subject-length.yaml +2 -2
  330. package/rules/empty-intensifier.yaml +2 -2
  331. package/rules/figure-reference-order.yaml +2 -2
  332. package/rules/fullwidth-alnum-consistency.yaml +2 -2
  333. package/rules/hyphen-as-dash.yaml +2 -2
  334. package/rules/katakana-density.yaml +2 -2
  335. package/rules/list-item-form-mix.yaml +2 -2
  336. package/rules/max-kanji-continuous.yaml +4 -3
  337. package/rules/max-ten.yaml +3 -3
  338. package/rules/missing-final-period.yaml +2 -2
  339. package/rules/name-variant.yaml +2 -2
  340. package/rules/ngram-repetition.yaml +2 -2
  341. package/rules/no-lead.yaml +2 -2
  342. package/rules/no-mixed-desumasu.yaml +3 -2
  343. package/rules/no-nakaguro-parallel.yaml +2 -2
  344. package/rules/number-style-consistency.yaml +2 -2
  345. package/rules/numeral-sentence-start.yaml +2 -2
  346. package/rules/one-sentence-paragraph-run.yaml +2 -2
  347. package/rules/orthographic-variant.yaml +2 -2
  348. package/rules/outside-announced-list.yaml +2 -2
  349. package/rules/oxford-comma-consistency.yaml +2 -2
  350. package/rules/paragraph-restatement.yaml +2 -2
  351. package/rules/party-role-name.yaml +2 -2
  352. package/rules/person-consistency.yaml +2 -2
  353. package/rules/preamble-length.yaml +2 -2
  354. package/rules/repeated-conjunction.yaml +2 -2
  355. package/rules/repeated-sentence-head.yaml +2 -2
  356. package/rules/request-without-deadline.yaml +2 -2
  357. package/rules/requirement-smell.yaml +2 -2
  358. package/rules/space-before-punctuation.yaml +2 -2
  359. package/rules/stray-space.yaml +7 -4
  360. package/rules/summary-fact-mismatch.yaml +2 -2
  361. package/rules/taigen-dome-in-prose.yaml +2 -2
  362. package/rules/teki-overuse.yaml +2 -2
  363. package/rules/title-case-consistency.yaml +2 -2
  364. package/rules/title-length.yaml +2 -2
  365. package/rules/total-mismatch.yaml +1 -1
  366. package/rules/unbalanced-bracket.yaml +3 -3
  367. package/rules/undefined-term.yaml +2 -2
  368. package/rules/unknown-word.yaml +2 -2
  369. package/rules/unqualified-superlative.yaml +2 -2
  370. package/rules/vague-word-density.yaml +2 -2
  371. package/rules/very-adjective.yaml +1 -1
  372. package/rules/warning-without-action.yaml +2 -2
  373. package/rules/yori-as-from.yaml +1 -0
  374. package/src/announced-list.ts +12 -3
  375. package/src/body-section.ts +19 -0
  376. package/src/derived/durations.ts +3 -2
  377. package/src/derived/marked-dates.ts +4 -0
  378. package/src/detectors/acronym-capitals.ts +30 -0
  379. package/src/detectors/bare-comparative.ts +12 -2
  380. package/src/detectors/bare-word-list.ts +61 -0
  381. package/src/detectors/bold-field-label.ts +33 -0
  382. package/src/detectors/bold-label.ts +91 -14
  383. package/src/detectors/broken-link.ts +23 -2
  384. package/src/detectors/byline-list.ts +24 -0
  385. package/src/detectors/caps-screen-label.ts +15 -0
  386. package/src/detectors/casual-voice.ts +30 -0
  387. package/src/detectors/char-shape.ts +2 -2
  388. package/src/detectors/closing-cliche.ts +19 -3
  389. package/src/detectors/count-per-section.ts +6 -2
  390. package/src/detectors/dangling-opener.ts +12 -1
  391. package/src/detectors/date-year.ts +12 -1
  392. package/src/detectors/defined-term-form.ts +19 -3
  393. package/src/detectors/document-shape.ts +16 -2
  394. package/src/detectors/doubled-punctuation.ts +26 -1
  395. package/src/detectors/email-letter.ts +5 -3
  396. package/src/detectors/email-subject-reference.ts +36 -0
  397. package/src/detectors/en-shape.ts +5 -4
  398. package/src/detectors/fact-consistency.ts +2 -2
  399. package/src/detectors/figure-order.ts +8 -2
  400. package/src/detectors/fullwidth-alnum.ts +39 -10
  401. package/src/detectors/gram-heading.ts +15 -1
  402. package/src/detectors/heading-case.ts +7 -1
  403. package/src/detectors/heading-numbering.ts +1 -9
  404. package/src/detectors/hyphen-name-suffix.ts +30 -0
  405. package/src/detectors/katakana-density.ts +8 -4
  406. package/src/detectors/lexicon.ts +37 -5
  407. package/src/detectors/link-shape.ts +16 -2
  408. package/src/detectors/list-item-phrase.ts +86 -0
  409. package/src/detectors/list-layout.ts +17 -0
  410. package/src/detectors/list-lead-in.ts +1 -19
  411. package/src/detectors/list-parallel.ts +31 -28
  412. package/src/detectors/mark-shape.ts +13 -3
  413. package/src/detectors/measured-facts.ts +11 -4
  414. package/src/detectors/middle-dot.ts +32 -0
  415. package/src/detectors/missing-final-period.ts +14 -1
  416. package/src/detectors/name-variant.ts +2 -1
  417. package/src/detectors/number-style.ts +26 -4
  418. package/src/detectors/numeral-opener.ts +4 -2
  419. package/src/detectors/open-end-names.ts +11 -1
  420. package/src/detectors/ordinary-phrase.ts +10 -0
  421. package/src/detectors/orthographic-variant.ts +2 -2
  422. package/src/detectors/output-lead-in.ts +28 -0
  423. package/src/detectors/outside-announced-list.ts +6 -1
  424. package/src/detectors/oxford-comma.ts +3 -1
  425. package/src/detectors/paragraph-restatement.ts +17 -2
  426. package/src/detectors/person-consistency.ts +14 -2
  427. package/src/detectors/quoted-title-line.ts +13 -0
  428. package/src/detectors/register-interview.ts +22 -0
  429. package/src/detectors/registry/colloquial-opener-pile.ts +4 -0
  430. package/src/detectors/repeated-head.ts +32 -6
  431. package/src/detectors/request-owner.ts +5 -2
  432. package/src/detectors/run-together.ts +15 -0
  433. package/src/detectors/sentence-counts.ts +18 -3
  434. package/src/detectors/sentence-ending.ts +13 -2
  435. package/src/detectors/sentence-parts.ts +20 -2
  436. package/src/detectors/space-before-punctuation.ts +24 -4
  437. package/src/detectors/stray-space.ts +1 -1
  438. package/src/detectors/structure-tree.ts +12 -9
  439. package/src/detectors/structure.ts +4 -1
  440. package/src/detectors/superlative-context.ts +10 -0
  441. package/src/detectors/technical-docs.ts +5 -3
  442. package/src/detectors/token-shape.ts +19 -4
  443. package/src/detectors/unbalanced-bracket.ts +9 -1
  444. package/src/detectors/undefined-term.ts +5 -1
  445. package/src/detectors/unknown-word-context.ts +44 -6
  446. package/src/detectors/unknown-word.ts +16 -3
  447. package/src/detectors/vague-density.ts +15 -2
  448. package/src/front-matter.ts +14 -0
  449. package/src/genre-check.ts +1 -1
  450. package/src/genre.ts +1 -15
  451. package/src/labelled-note-paragraphs.ts +30 -0
  452. package/src/list-lead-sentence.ts +24 -0
  453. package/src/paragraph-runs.ts +25 -2
  454. package/src/recording-title.ts +16 -0
  455. package/src/sentence-load.ts +68 -2
  456. package/src/stray-space.ts +37 -6
  457. package/src/structure/due-column.ts +33 -0
  458. package/src/structure/generic-role.ts +8 -0
  459. package/src/structure/party-role.ts +3 -2
  460. package/src/title-case-name.ts +19 -0
@@ -31,6 +31,8 @@ const DESCRIPTION = /^[::](?![::])/u;
31
31
  const LAYOUT = /[ \u3000]{2}/u;
32
32
  /** Fewer characters than this is a label or a caption, not a sentence. */
33
33
  const MIN_SENTENCE_CHARS = 15;
34
+ /** A cell is short: a one-line paragraph this long or longer is a clause (…と認められた場合), not a cell before the term. A paragraph masked to nothing (a quotation) is no cell either. */
35
+ const MAX_CELL_CHARS = MIN_SENTENCE_CHARS * 2;
34
36
  /** Words that end a clause: a verb, an adjective or an auxiliary in its dictionary form ends the sentence. */
35
37
  const PREDICATE: ReadonlySet<string> = new Set(["VERB", "ADJ", "AUX"]);
36
38
 
@@ -79,9 +81,20 @@ const isTerm = (body: string, marks: PeriodMarks): boolean =>
79
81
  const isDescription = (text: string, paragraph: Paragraph, marks: PeriodMarks, previous: Paragraph | undefined): boolean =>
80
82
  DESCRIPTION.test(bodyOf(text, paragraph)) && previous !== undefined && isTerm(bodyOf(text, previous), marks);
81
83
 
84
+ /**
85
+ * A cell of a table laid out as paragraphs: a term line with its note under it (乾式バッテリー / …マンガンバッテリーも含む), right after
86
+ * another open one-line cell (ニッケル水素電池等). The note annotates the term, like the cell it came from.
87
+ */
88
+ const isTermCell = (text: string, paragraph: Paragraph, marks: PeriodMarks, previous: Paragraph | undefined): boolean => {
89
+ const [first, ...rest] = bodyOf(text, paragraph).split("\n");
90
+ const cellBefore = previous === undefined ? "\n" : bodyOf(text, previous);
91
+ const isCell = cellBefore !== "" && !cellBefore.includes("\n") && Array.from(cellBefore).length < MAX_CELL_CHARS && !isClosed(cellBefore, marks.ends);
92
+ return rest.length > 0 && isTerm(first?.trim() ?? "", marks) && isCell;
93
+ };
94
+
82
95
  /** How a paragraph ends, or undefined when its last line is not a sentence (a label, a lead-in, a note, a laid-out row). */
83
96
  export const paragraphEnd = (text: string, paragraph: Paragraph, marks: PeriodMarks, next?: Paragraph, previous?: Paragraph): ParagraphEnd | undefined => {
84
- if (isDescription(text, paragraph, marks, previous)) return undefined;
97
+ if (isDescription(text, paragraph, marks, previous) || isTermCell(text, paragraph, marks, previous)) return undefined;
85
98
  const body = text.slice(paragraph.span.start, paragraph.span.end).trimEnd();
86
99
  const last = body.split("\n").at(-1)?.trim() ?? "";
87
100
  if (Array.from(last).length < MIN_SENTENCE_CHARS || LEAD_IN.test(last)) return undefined;
@@ -1,4 +1,5 @@
1
1
  import type { Detector, Finding, ProseDocument } from "../plugin.ts";
2
+ import { spellsAcronym } from "./acronym-capitals.ts";
2
3
  import { cuedNamesIn, mentionsIn, nameVariants, suffixedNamesIn, type NameMention, type VariantChars } from "../name-variants.ts";
3
4
  import { withKnownNeighbours } from "../name-neighbours.ts";
4
5
  import type { SpellingInput } from "../name-spelling-chars.ts";
@@ -388,7 +389,7 @@ export const nameVariant: Detector = (doc): Finding[] => {
388
389
  const isTwoThings = twoThingsIn(doc, tokensOf(doc), speller, use.ordinary);
389
390
  return [...withCodes, ...titles]
390
391
  .filter(({ name, usual }) => speller === undefined || !isDictionaryPair(name, usual, speller))
391
- .filter((found) => !isTwoThings(found))
392
+ .filter((found) => !isTwoThings(found) && !spellsAcronym(doc.source, found.offset, found.name))
392
393
  .filter(notAnotherAuthorIn(doc))
393
394
  .toSorted((left, right) => left.offset - right.offset)
394
395
  .map(({ offset, name, usual, kind }) => ({
@@ -22,6 +22,8 @@ export type NumberWords = {
22
22
  readonly figureNouns: readonly string[];
23
23
  /** Words written before a number to name one of a series (Grade 5, Room 12): the number after one is not a count. */
24
24
  readonly nameWords: readonly string[];
25
+ /** Kanji counts read the native way (二通り, ふたとおり): written in kanji whatever the document's style for counts. */
26
+ readonly nativeCounts: readonly string[];
25
27
  };
26
28
 
27
29
  const alternation = (words: readonly string[]): string =>
@@ -81,7 +83,7 @@ const countMarks = (text: string, base: number, words: NumberWords, tokens: read
81
83
  if (pattern === undefined) return [];
82
84
  return [...text.matchAll(pattern)].flatMap((match): NumberMark[] => {
83
85
  const [written, digits, kanji] = match;
84
- if (kanji !== undefined && (isIdiomNumeral(kanji) || isInsideWord(written, base + match.index, tokens))) return [];
86
+ if (kanji !== undefined && (isIdiomNumeral(kanji) || words.nativeCounts.includes(written) || isInsideWord(written, base + match.index, tokens))) return [];
85
87
  if (isBeforeLongerWord(digits ?? kanji ?? "", written, base + match.index, tokens)) return [];
86
88
  return [{ kind: "count", style: digits === undefined ? "kanji" : "digits", written, offset: base + match.index }];
87
89
  });
@@ -115,12 +117,20 @@ const isHexCode = (written: string, after: string): boolean => {
115
117
  return /^\d+$/u.test(written) && LETTER_THEN_DIGIT.test(tail) && written.length + tail.length >= HEX_CODE_MIN;
116
118
  };
117
119
 
120
+ /** A word that says a quantity is about so much (約1500): a number right after it is a quantity, not part of a code. */
121
+ const APPROXIMATELY = "約";
122
+
123
+ const isOpenBefore = (text: string, index: number): boolean => {
124
+ const before = text.charAt(index - 1);
125
+ return before === APPROXIMATELY || !NOT_BEFORE.test(before);
126
+ };
127
+
118
128
  /** Each number of four digits or more standing alone, grouped (1,000) or not (1000). */
119
129
  const bigNumbers = (text: string): DigitRun[] =>
120
130
  [...text.matchAll(DIGITS_AND_COMMAS)].flatMap((match): DigitRun[] => {
121
131
  const written = match[0];
122
132
  const after = text.slice(match.index + written.length);
123
- const standsAlone = !NOT_BEFORE.test(text.charAt(match.index - 1)) && !NOT_AFTER.test(after.charAt(0)) && !isHexCode(written, after);
133
+ const standsAlone = isOpenBefore(text, match.index) && !NOT_AFTER.test(after.charAt(0)) && !isHexCode(written, after);
124
134
  return standsAlone && (GROUPED.test(written) || PLAIN_BIG.test(written)) ? [{ written, index: match.index }] : [];
125
135
  });
126
136
 
@@ -149,6 +159,17 @@ const countedAfter = (after: string, words: NumberWords): boolean => {
149
159
  /** What follows a quantity: a Japanese counter, or a word in lower case (10000 users). */
150
160
  const quantityAfter = (after: string, words: NumberWords): boolean => /^\s?[a-z]/u.test(after) || countedAfter(after, words);
151
161
 
162
+ /** The numbers after this one in a list that shares one unit (約1500、3,000、9,000m): each item takes the unit written after the last. */
163
+ const LIST_TAIL = /^(?:[、,]\s?約?[0-90-9]+(?:[,,][0-90-9]{3})*)+/u;
164
+
165
+ const GROUPED_ITEM = /[0-90-9][,,][0-90-9]{3}/u;
166
+
167
+ /** What follows a number, past the rest of the list it heads or stands in, and whether that list groups its digits (years never do). */
168
+ const afterList = (after: string): { readonly rest: string; readonly beforeGrouped: boolean } => {
169
+ const tail = LIST_TAIL.exec(after)?.[0] ?? "";
170
+ return { rest: after.slice(tail.length), beforeGrouped: GROUPED_ITEM.test(tail) };
171
+ };
172
+
152
173
  /** How far back to look for a currency sign or a label word. The sentence may start right after one (H.R. ends a sentence). */
153
174
  const BEFORE_REACH = 16;
154
175
 
@@ -156,11 +177,11 @@ const groupingMarks = (text: string, base: number, words: NumberWords, source: s
156
177
  bigNumbers(text).flatMap(({ written, index }): NumberMark[] => {
157
178
  const grouped = GROUPED.test(written);
158
179
  const before = source.slice(Math.max(0, base + index - BEFORE_REACH), base + index);
159
- const after = text.slice(index + written.length);
180
+ const { rest: after, beforeGrouped } = afterList(text.slice(index + written.length));
160
181
  const currency = CURRENCY_BEFORE.test(before);
161
182
  if (!currency && !quantityAfter(after, words)) return [];
162
183
  if (!grouped && isLabelBefore(before)) return [];
163
- if (!grouped && !currency && isYearLike(written) && !countedAfter(after, words)) return [];
184
+ if (!grouped && !currency && !beforeGrouped && isYearLike(written) && !countedAfter(after, words)) return [];
164
185
  return [{ kind: "grouping", style: grouped ? "grouped" : "plain", written, offset: base + index }];
165
186
  });
166
187
 
@@ -252,6 +273,7 @@ const wordsOf = (doc: ProseDocument): NumberWords => {
252
273
  countWords: patterns("count-number"),
253
274
  figureNouns: patterns("figure-noun"),
254
275
  nameWords: patterns("number-name-word"),
276
+ nativeCounts: patterns("numeral-native-count"),
255
277
  };
256
278
  };
257
279
 
@@ -20,13 +20,15 @@ const DIGITS = /^\d+$/u;
20
20
  /** 前の文の終わりを探す字数。見出しの行と、終わりの語が入れば足りる。 */
21
21
  const LOOKBACK = 300;
22
22
  const PLAIN_WORD = /^\p{L}{2,}$/u;
23
+ /** A worked sum (182 hours + 154 hours = 336 hours.): an operator, then an equals sign, each between spaces; Markdown may escape both. */
24
+ const WORKED_SUM = /\s\\?[+\-−–×÷*/]\s.*\s\\?=\s/u;
23
25
 
24
- /** 文の頭の数字。年、数字の後ろが小文字の語でないもの、言い終えていない行(見出しのような)は無い。 */
26
+ /** 文の頭の数字。年、数字の後ろが小文字の語でないもの、言い終えていない行(見出しのような)、計算の式の行は無い。 */
25
27
  export const openingNumeral = (text: string): string | undefined => {
26
28
  const trimmed = text.trim();
27
29
  const match = OPENING_NUMERAL.exec(trimmed);
28
30
  const numeral = match?.groups?.["numeral"];
29
- if (match === null || numeral === undefined || YEAR.test(numeral) || !SENTENCE_END.test(trimmed)) return undefined;
31
+ if (match === null || numeral === undefined || YEAR.test(numeral) || !SENTENCE_END.test(trimmed) || WORKED_SUM.test(trimmed)) return undefined;
30
32
  return match[0];
31
33
  };
32
34
 
@@ -50,6 +50,8 @@ export type OpenEndNames = {
50
50
  readonly heads: readonly string[];
51
51
  /** Every term the document defines (「秘密情報」): the word right after one (秘密情報等) widens a named thing, not an open list. */
52
52
  readonly terms: ReadonlySet<string>;
53
+ /** The document's headings: a noun a heading names with the word (## 出願書類等の送付先) is the page's subject, not an open list. */
54
+ readonly headings: readonly string[];
53
55
  };
54
56
 
55
57
  const attached = (left: Token | undefined, right: Token | undefined): boolean =>
@@ -148,7 +150,8 @@ export const openEndNames = (doc: ProseDocument, words: readonly LexiconEntry[],
148
150
  const occurrences = doc.sentences.flatMap((sentence) => words.flatMap((word) => occurrencesIn(sentence, word)));
149
151
  const defined = occurrences.filter((occurrence) => definedInAside(doc.source, occurrence, statements)).map((occurrence) => nounOf(doc.source, occurrence));
150
152
  const heads = occurrences.filter((occurrence) => headsItem(doc.source, occurrence, statements)).map((occurrence) => nounOf(doc.source, occurrence));
151
- return { quoted: quotedNames(doc.source, words), defined: new Set(defined), heads: [...new Set(heads)], terms: definedTerms(doc) };
153
+ const headings = doc.sections.map((section) => section.heading).filter((heading) => heading.trim() !== "");
154
+ return { quoted: quotedNames(doc.source, words), defined: new Set(defined), heads: [...new Set(heads)], terms: definedTerms(doc), headings };
152
155
  };
153
156
 
154
157
  /** Whether a quoted name holds this occurrence: the text around it reads the whole name (当該責任追及等 holds 「責任追及等」). */
@@ -170,8 +173,15 @@ const partsHoldingWord = (source: string, occurrence: Occurrence): string[] => {
170
173
  const followsTerm = (source: string, occurrence: Occurrence, terms: ReadonlySet<string>): boolean =>
171
174
  occurrence.tokens.slice(occurrence.first, occurrence.range.start).some((token) => terms.has(source.slice(token.span.start, occurrence.start)));
172
175
 
176
+ /** Whether a heading writes the noun the word ends, whole from its first noun (出願書類等 in ## 出願書類等の送付先). */
177
+ const namedByHeading = (source: string, occurrence: Occurrence, headings: readonly string[]): boolean => {
178
+ const noun = source.slice(startOf(occurrence, occurrence.first), occurrence.end);
179
+ return occurrence.first < occurrence.range.start && headings.some((heading) => heading.includes(noun));
180
+ };
181
+
173
182
  const isNamed = (source: string, occurrence: Occurrence, names: OpenEndNames): boolean =>
174
183
  inQuotedName(source, occurrence, names.quoted) ||
184
+ namedByHeading(source, occurrence, names.headings) ||
175
185
  followsTerm(source, occurrence, names.terms) ||
176
186
  partsHoldingWord(source, occurrence).some((part) => names.defined.has(part) || names.heads.some((head) => head.startsWith(part)));
177
187
 
@@ -20,6 +20,16 @@ export const isNarrowedUse = (tokens: readonly Token[], at: number, pointers: re
20
20
  return !pointers.some((pointer) => pointer.toLowerCase() === before.surface.toLowerCase());
21
21
  };
22
22
 
23
+ /**
24
+ * A partitive picks some out of the kind: "some of these terms", "many of the services". The defined term names one
25
+ * thing or one set, so items picked from it are the ordinary word.
26
+ */
27
+ export const isPartitiveUse = (tokens: readonly Token[], at: number, quantifiers: readonly string[]): boolean => {
28
+ const [quantifier, of, determiner] = [tokens[at - 3], tokens[at - 2], tokens[at - 1]];
29
+ if (quantifier === undefined || of?.surface.toLowerCase() !== "of" || determiner?.pos !== "DET") return false;
30
+ return quantifiers.some((word) => word.toLowerCase() === quantifier.surface.toLowerCase());
31
+ };
32
+
23
33
  /**
24
34
  * The use heads a phrase that names a kind of thing with "of" and a bare noun (certificates of deposit, letters of credit);
25
35
  * "of" followed by an article, a pronoun or a name (the certificate of the Company) is the defined thing again.
@@ -25,7 +25,7 @@ import {
25
25
  type InContext,
26
26
  type Uses,
27
27
  } from "../word-use.ts";
28
- import { titleCaseNameRuns } from "../title-case-name.ts";
28
+ import { bracketedTitleRuns, titleCaseNameRuns } from "../title-case-name.ts";
29
29
  import { withoutQuotedSpellings, type Quoted } from "../quoted-spelling.ts";
30
30
  import { teFormOf, withTeFormFullVerbs, type TeForm } from "../te-form-helper.ts";
31
31
  import { citedSpans, isOpenIn, namesOf, patternsOf, type IsOpen, type Names } from "./orthographic-variant-open.ts";
@@ -267,7 +267,7 @@ const latinSpelling = (word: string): string =>
267
267
  const latinWords = ({ sentence, isOpen, cited }: Place, skip: ReadonlySet<string>, joiners: readonly string[]): Placed[] => {
268
268
  const { text } = sentence;
269
269
  const acronyms = acronymsIn(text);
270
- const names = titleCaseNameRuns(text, joiners);
270
+ const names = [...bracketedTitleRuns(text), ...titleCaseNameRuns(text, joiners)];
271
271
  const quotedAt = (start: number, end: number): Pick<Placed, "quoted" | "name"> => {
272
272
  if (isWithinAny(cited, { start, end })) return { quoted: "cited" };
273
273
  const run = names.find(({ name }) => name.start <= start && end <= name.end);
@@ -0,0 +1,28 @@
1
+ // A code block whose lead-in says it holds what a program shows ("So, on day 3, we'd expect to see:"): the block is plain
2
+ // output, which is in no language. Pure; the lead-in words come from the output-lead-in lexicon.
3
+
4
+ const LEAD_IN_END = /[::]\s*$/u;
5
+ const LETTER = /\p{L}/u;
6
+
7
+ /** The last line with text before `offset`. */
8
+ const lineAbove = (source: string, offset: number): string =>
9
+ source
10
+ .slice(0, offset)
11
+ .split("\n")
12
+ .findLast((line) => line.trim() !== "") ?? "";
13
+
14
+ /** A Latin word stands whole (output, not outputs); 「表示され」 may sit inside a longer run. */
15
+ const holdsWord = (line: string, word: string): boolean => {
16
+ const at = line.indexOf(word);
17
+ if (at === -1) return false;
18
+ if (!/^[a-z]/u.test(word)) return true;
19
+ const whole = !LETTER.test(line.charAt(at - 1)) && !LETTER.test(line.charAt(at + word.length));
20
+ return whole || holdsWord(line.slice(at + word.length), word);
21
+ };
22
+
23
+ /** Whether the line just above the block at `offset` ends in a colon and says the block is output. */
24
+ export const afterOutputLeadIn = (source: string, offset: number, words: readonly string[]): boolean => {
25
+ const line = lineAbove(source, offset);
26
+ const lower = line.toLowerCase();
27
+ return LEAD_IN_END.test(line) && words.some((word) => word !== "" && holdsWord(lower, word.toLowerCase()));
28
+ };
@@ -6,7 +6,12 @@ import { quoteAt } from "./structure-tree.ts";
6
6
  /** 最初に挙げた一覧(対応 OS は Windows と macOS)に無い名前を、後の文が同じ語で言う所(Linux にも対応)。 */
7
7
  export const outsideAnnouncedList: Detector = (doc): Finding[] => {
8
8
  const lowered = (id: string): Set<string> => new Set((doc.lexicons[id] ?? []).map((entry) => entry.pattern.toLowerCase()));
9
- const words = { frames: doc.lexicons["enumeration-frame"] ?? [], joiners: lowered("enumeration-joiner"), negations: lowered("enumeration-negation") };
9
+ const words = {
10
+ frames: doc.lexicons["enumeration-frame"] ?? [],
11
+ joiners: lowered("enumeration-joiner"),
12
+ negations: lowered("enumeration-negation"),
13
+ ordinals: lowered("ordinal-word"),
14
+ };
10
15
  const statements = doc.sentences.flatMap((sentence) => listStatementsIn(sentence, words, doc.source));
11
16
  const lines = linesOf(doc.source);
12
17
  return outsideMembers(statements).map(({ member, announced }) => ({
@@ -57,6 +57,7 @@ import { inExcerpt } from "./quoted-excerpt.ts";
57
57
  import { listContinues, walker, type Walk } from "./list-run.ts";
58
58
  import { joinsUnfinished, repeatsConjunction } from "./list-joint.ts";
59
59
  import { insideSentenceCaseTitle } from "./title-list.ts";
60
+ import { insideByline } from "./byline-list.ts";
60
61
 
61
62
  const EMPTY: TokenRange = { start: 0, end: 0 };
62
63
 
@@ -383,12 +384,13 @@ export const listVerdicts = (tokens: readonly Token[], words: ListWords, source:
383
384
  const breaks = dashBreaks(tokens, source);
384
385
  const excerpt = inExcerpt(tokens, source, words.elision ?? []);
385
386
  const inTitle = insideSentenceCaseTitle(tokens);
387
+ const inByline = insideByline(tokens);
386
388
  const walk = walker();
387
389
  return tokens.flatMap((token, at) => {
388
390
  if (!isJudgedConjunction(token, at)) return [];
389
391
  // 郵便番号で終わる住所のあとの and / or は、住所の行を区切る読点のあと。並びの読点ではない。
390
392
  // 最後の読点のあとに前後を空けたダッシュがあれば(Washington, DC – The …)、読点はダッシュの前で閉じた日付行や見出しのもの。
391
- const notList = sentence.inCitedTitle(at) || inTitle(at) || excerpt(at) || followsPostcode(source, token.span.start) || breaks[at] === true;
393
+ const notList = sentence.inCitedTitle(at) || inTitle(at) || inByline(at) || excerpt(at) || followsPostcode(source, token.span.start) || breaks[at] === true;
392
394
  return [notList ? undefined : listAt(readItems(at), at, walk)];
393
395
  });
394
396
  };
@@ -55,7 +55,21 @@ const findingOf = (paragraph: Paragraph, opener: string, share: number, limit: n
55
55
  };
56
56
  };
57
57
 
58
- /** Each paragraph that opens with a restating word and repeats at least limit percent of the previous paragraph's words. */
58
+ /**
59
+ * Whether the sentences after the opener's sentence go on to something new: a summary that leads into the next step
60
+ * (このように、…状況となっていた。その一方で、…を確認した。) sums up on purpose. A one-sentence paragraph does not go on.
61
+ */
62
+ const goesOn = (earlier: Paragraph, later: Paragraph, limit: number): boolean => {
63
+ const rest = later.sentences.slice(1).flatMap((sentence) => sentence.tokens ?? []);
64
+ if (rest.length === 0) return false;
65
+ const { share, words } = repeatedShare(tokensOf(earlier), rest);
66
+ return words >= MIN_CONTENT_WORDS && share < limit;
67
+ };
68
+
69
+ /**
70
+ * Each paragraph that opens with a restating word and repeats at least limit percent of the previous paragraph's words,
71
+ * unless its later sentences go on to something new.
72
+ */
59
73
  export const paragraphRestatement: Detector = (doc, options): Finding[] => {
60
74
  const openers = (doc.lexicons["restating-opener"] ?? []).map((entry) => entry.pattern);
61
75
  return doc.paragraphs.flatMap((later, index): Finding[] => {
@@ -63,6 +77,7 @@ export const paragraphRestatement: Detector = (doc, options): Finding[] => {
63
77
  const opener = openerOf(later.sentences[0]?.text ?? "", openers);
64
78
  if (earlier === undefined || opener === undefined || !isNextTo(doc, earlier, later)) return [];
65
79
  const { share, words } = repeatedShare(tokensOf(earlier), tokensAfterOpener(later, opener));
66
- return words >= MIN_CONTENT_WORDS && share >= options.limit ? [findingOf(later, opener, share, options.limit)] : [];
80
+ const restates = words >= MIN_CONTENT_WORDS && share >= options.limit && !goesOn(earlier, later, options.limit);
81
+ return restates ? [findingOf(later, opener, share, options.limit)] : [];
67
82
  });
68
83
  };
@@ -7,16 +7,28 @@ const wordsOf = (doc: ProseDocument, words: PersonWords["words"]): PersonWords =
7
7
  notAfter: doc.lexicons["person-not-after"] ?? [],
8
8
  });
9
9
 
10
+ const TOPIC = "は";
11
+
12
+ /**
13
+ * A self-reference set as a topic against another person's in the same sentence (僕は左を向く、君は右を向いても): the two
14
+ * people of an example, not the writer naming itself. others: the person-contrast word list.
15
+ */
16
+ const contrastsPeople = (sentence: Sentence, mention: PersonMention, others: readonly string[]): boolean =>
17
+ sentence.text.startsWith(TOPIC, mention.at + mention.written.length) && others.some((other) => other !== "" && sentence.text.includes(`${other}${TOPIC}`));
18
+
10
19
  /**
11
20
  * One document naming itself (私たち / 弊社, 私 / 筆者) or its reader (you / one) two ways: the minority form of each slot.
12
- * Sentences in another language than the document's are left out; quotations are left out by personMentions. A form the
21
+ * Sentences in another language than the document's are left out; quotations are left out by personMentions, and so is a
22
+ * self-reference contrasted with another person in one sentence (僕は…、君は…). A form the
13
23
  * language package lists in person-other-sense (本社, also the head office) counts only where it is the usual form.
14
24
  */
15
25
  export const personMix: Detector = (doc, options): Finding[] => {
16
26
  const person = wordsOf(doc, options.lexicon ?? []);
27
+ const others = (doc.lexicons["person-contrast"] ?? []).map((entry) => entry.pattern);
17
28
  const entries: { readonly sentence: Sentence; readonly mention: PersonMention }[] = doc.sentences
18
29
  .filter((sentence) => sentence.embeddedLanguage === undefined)
19
- .flatMap((sentence) => personMentions(sentence.text, person).map((mention) => ({ sentence, mention })));
30
+ .flatMap((sentence) => personMentions(sentence.text, person).map((mention) => ({ sentence, mention })))
31
+ .filter(({ sentence, mention }) => !contrastsPeople(sentence, mention, others));
20
32
  const otherSenses = new Set((doc.lexicons["person-other-sense"] ?? []).map((entry) => entry.pattern));
21
33
  return personMinorities(withoutOtherSenses(entries, otherSenses), options.limit).flatMap(({ odd, usual, of }) =>
22
34
  odd.map(({ sentence, mention }) => ({
@@ -0,0 +1,13 @@
1
+ const QUOTE_OPENERS: Readonly<Record<string, string>> = { "”": "“", "’": "‘", '"': '"', "」": "「", "』": "『" };
2
+
3
+ /**
4
+ * Whether the line ends with a quotation it opens after words of its own (Revised “Getting It Right!”): the stop belongs to
5
+ * the quoted title, not to a sentence of the line's.
6
+ */
7
+ export const endsWithQuotedTitle = (line: string): boolean => {
8
+ const text = line.trimEnd();
9
+ const opener = QUOTE_OPENERS[text.at(-1) ?? ""];
10
+ if (opener === undefined) return false;
11
+ const opened = text.slice(0, -1).lastIndexOf(opener);
12
+ return opened > 0 && text.slice(0, opened).trim() !== "";
13
+ };
@@ -0,0 +1,22 @@
1
+ import { isInterview } from "../section-levels.ts";
2
+ import type { ProseDocument, Sentence } from "../plugin.ts";
3
+
4
+ // An interview's answers are speech set down (いえ、会社からの打診でした。…だいたい見当がつく。): one speaker mixes
5
+ // polite and plain sentences as people talk, as a transcript does. The interviewer's turns (――…?) and the writer's
6
+ // introduction before the first turn are written prose and stay compared. Pure.
7
+
8
+ const LEADING_EMPHASIS = /^[\s*_]+/u;
9
+
10
+ const opensWithMark = (text: string, marks: readonly string[]): boolean => {
11
+ const start = text.replace(LEADING_EMPHASIS, "");
12
+ return marks.some((mark) => start.startsWith(mark));
13
+ };
14
+
15
+ /** The sentences of an interview's answers: paragraphs after the first interviewer's turn that are not turns themselves. */
16
+ export const spokenAnswerSentences = (doc: ProseDocument, marks: readonly string[]): Set<Sentence> => {
17
+ const starts = doc.paragraphs.map((paragraph) => paragraph.span.start);
18
+ if (!isInterview(doc.source, doc.sections, starts, marks)) return new Set();
19
+ const isTurn = doc.paragraphs.map((paragraph) => opensWithMark(doc.source.slice(paragraph.span.start, paragraph.span.end), marks));
20
+ const firstTurn = isTurn.indexOf(true);
21
+ return new Set(doc.paragraphs.flatMap((paragraph, index) => (index > firstTurn && isTurn[index] === false ? paragraph.sentences : [])));
22
+ };
@@ -0,0 +1,4 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ import { colloquialOpenerPile } from "../casual-voice.ts";
3
+
4
+ export const detector: Detector = colloquialOpenerPile;
@@ -1,4 +1,5 @@
1
- import type { Detector, Finding, LengthUnit, Sentence, Span } from "../plugin.ts";
1
+ import type { Detector, Finding, LengthUnit, Paragraph, Section, Sentence, Span } from "../plugin.ts";
2
+ import { isFlattenedTableBlock } from "./sentence-parts.ts";
2
3
 
3
4
  const HEAD_CHARS = 6;
4
5
  const HEAD_WORDS = 3;
@@ -17,7 +18,14 @@ const headOf = (sentence: Sentence, unit: LengthUnit): string => {
17
18
  const containerOf = (sentence: Sentence, lists: readonly Span[]): number =>
18
19
  lists.filter((item) => item.start <= sentence.span.start && sentence.span.start < item.end).reduce((innermost, item) => Math.max(innermost, item.start), -1);
19
20
 
20
- type Run = { readonly head: string; readonly container: number; readonly members: readonly Sentence[] };
21
+ /** 文の節。文の始まりを含む節の始まり。見出しを挟めば別の節で、FAQ の答えどうしのように別の話になる。 */
22
+ const sectionOf = (sentence: Sentence, sections: readonly Section[]): number =>
23
+ sections
24
+ .filter((section) => section.span.start <= sentence.span.start && sentence.span.start < section.span.end)
25
+ .reduce((innermost, section) => Math.max(innermost, section.span.start), -1);
26
+
27
+ /** 連なりが続ける範囲: 箇条書きの項目と節の組。 */
28
+ type Run = { readonly head: string; readonly container: string; readonly members: readonly Sentence[] };
21
29
 
22
30
  /** 前の文と今の文のあいだで、箇条書きの項目が始まっているか。文を持たない項目(画像だけの - ![図](a.png))も連なりを切る。 */
23
31
  const listBetween = (previous: Sentence | undefined, sentence: Sentence, lists: readonly Span[]): boolean =>
@@ -26,11 +34,12 @@ const listBetween = (previous: Sentence | undefined, sentence: Sentence, lists:
26
34
  /**
27
35
  * 連なりは同じ入れ物の中でだけ続く。箇条書きの項目どうしは同じ形で並べるのが書き方そのもの(「1. SRE に関する…」「2. SRE に関する…」)で、
28
36
  * 項目をまたぐと切る。一つの項目の中の段落や、地の文の中では、これまでどおり数える。箇条書きの前後の地の文も、箇条書きで切れる。
37
+ * 見出しを挟んでも切る(FAQ の答えごとの「Learn more about …」)。
29
38
  */
30
- const runsOf = (sentences: readonly Sentence[], unit: LengthUnit, lists: readonly Span[]): Run[] =>
39
+ const runsOf = (sentences: readonly Sentence[], unit: LengthUnit, lists: readonly Span[], sections: readonly Section[]): Run[] =>
31
40
  sentences.reduce<Run[]>((acc, sentence) => {
32
41
  const head = headOf(sentence, unit);
33
- const container = containerOf(sentence, lists);
42
+ const container = `${String(containerOf(sentence, lists))} ${String(sectionOf(sentence, sections))}`;
34
43
  const last = acc.at(-1);
35
44
  // 短すぎる書き出しは「同じ」と言えない。単位ぶん揃って初めて連なりと見る。
36
45
  const full = unit === "char" ? head.length === HEAD_CHARS : head.split(" ").length === HEAD_WORDS;
@@ -40,9 +49,26 @@ const runsOf = (sentences: readonly Sentence[], unit: LengthUnit, lists: readonl
40
49
  return acc;
41
50
  }, []);
42
51
 
52
+ /** 一文だけの段落の文か。 */
53
+ const standsAlone = (sentence: Sentence, paragraphs: readonly Paragraph[]): boolean =>
54
+ paragraphs.some((paragraph) => paragraph.sentences.length === 1 && paragraph.sentences[0]?.span.start === sentence.span.start);
55
+
56
+ /**
57
+ * 連なりのどの文も一文だけの段落(「The government's 'How to rent' guide …」を案内ごとに一段落)なら、同じ型で並べた項目で、
58
+ * 印の無い箇条書き。同じ段落の中で続く書き出しだけを言う。
59
+ */
60
+ const isEntryList = (run: Run, paragraphs: readonly Paragraph[]): boolean => run.members.every((sentence) => standsAlone(sentence, paragraphs));
61
+
62
+ /** 連なりの最初の文を含む段落が、行の区切りの落ちた表(升の文字がつながった段落)か。行ごとに同じ升で始まるのは表の形。 */
63
+ const inFlattenedTable = (run: Run, paragraphs: readonly Paragraph[], source: string): boolean => {
64
+ const start = run.members[0]?.span.start ?? -1;
65
+ const paragraph = paragraphs.find((candidate) => candidate.span.start <= start && start < candidate.span.end);
66
+ return paragraph !== undefined && isFlattenedTableBlock(source.slice(paragraph.span.start, paragraph.span.end));
67
+ };
68
+
43
69
  export const repeatedHead: Detector = (doc, options): Finding[] =>
44
- runsOf(doc.sentences, doc.lengthUnit, doc.listSpans)
45
- .filter((run) => run.members.length > options.limit)
70
+ runsOf(doc.sentences, doc.lengthUnit, doc.listSpans, doc.sections)
71
+ .filter((run) => run.members.length > options.limit && !isEntryList(run, doc.paragraphs) && !inFlattenedTable(run, doc.paragraphs, doc.source))
46
72
  .map((run) => ({
47
73
  rule: "repeated-sentence-head",
48
74
  severity: "warning",
@@ -15,6 +15,7 @@ export const REQUEST_LEXICONS = {
15
15
  owner: "request-owner",
16
16
  pointer: "request-pointer",
17
17
  offer: "request-offer",
18
+ instruction: "request-instruction",
18
19
  timing: "request-timing",
19
20
  invitation: "request-invitation",
20
21
  contact: "request-contact",
@@ -39,6 +40,7 @@ const wordsOf = (doc: ProseDocument): Words => ({
39
40
  owner: patternsOf(doc.lexicons[REQUEST_LEXICONS.owner]),
40
41
  pointer: patternsOf(doc.lexicons[REQUEST_LEXICONS.pointer]),
41
42
  offer: patternsOf(doc.lexicons[REQUEST_LEXICONS.offer]),
43
+ instruction: patternsOf(doc.lexicons[REQUEST_LEXICONS.instruction]),
42
44
  timing: patternsOf(doc.lexicons[REQUEST_LEXICONS.timing]),
43
45
  invitation: patternsOf(doc.lexicons[REQUEST_LEXICONS.invitation]),
44
46
  contact: patternsOf(doc.lexicons[REQUEST_LEXICONS.contact]),
@@ -103,7 +105,8 @@ const isProhibition = (text: string, endings: readonly Place[], words: Words): b
103
105
  /**
104
106
  * A request for an action: an action word next to a request ending (「確認してください」「please send」), not a condition
105
107
  * (「ご不明な点があれば…ください」 is an offer), not an open offer to take the reader's questions (「ご質問はメールでお送りください」),
106
- * not a pointer to where to read more (「詳細は資料をご確認ください」), not what an invitation is for (「登録をしにお越しください」),
108
+ * not a pointer to where to read more (「詳細は資料をご確認ください」), not the writer asking how to do something
109
+ * (「返送の方法を教えてください」 "let me know how to send it back"), not what an invitation is for (「登録をしにお越しください」),
107
110
  * not a prohibition (「メールでは送らないでください」 "Please do not submit comments by email"),
108
111
  * and not the way to reach the writer on a contact line (「ファックス番号:… 送信後、ご連絡ください」).
109
112
  * The action has to be close to the ending, or a noun like 検討会 or 履修登録 earlier in the sentence would make one.
@@ -117,7 +120,7 @@ export const isRequest = (text: string, words: Words): boolean => {
117
120
  endings.some((ending) => gapBetween(action, ending) <= ACTION_REACH) && !invitations.some((invitation) => invitedTo(comparable, action, invitation)),
118
121
  );
119
122
  if (!asked || holdsContactLine(text, words) || isProhibition(text, endings, words)) return false;
120
- return ![words.condition, words.offer, words.pointer].some((patterns) => containsAny(text, patterns));
123
+ return ![words.condition, words.offer, words.instruction, words.pointer].some((patterns) => containsAny(text, patterns));
121
124
  };
122
125
 
123
126
  const NAMED = new Set(["PROPN"]);
@@ -0,0 +1,15 @@
1
+ // A word run together from two long words where a conversion lost the space between them ("Includingspecified" where a
2
+ // table's cells met): the dictionary knows both halves and not the whole. Halves this long are not a coined compound
3
+ // (crowdwork), which joins short roots. Pure; the dictionary is the language package's word list.
4
+
5
+ /** The shortest half: below it, two words make a compound a writer may coin (crowdwork, workflow). */
6
+ const MIN_HALF = 6;
7
+
8
+ /** Whether `word` is two dictionary words of at least MIN_HALF letters each run together, and no dictionary word itself. */
9
+ export const isRunTogether = (word: string, dictionary: ReadonlySet<string>): boolean => {
10
+ const lower = word.toLowerCase();
11
+ if (!/^\p{L}+$/u.test(lower) || dictionary.has(lower)) return false;
12
+ return Array.from({ length: lower.length - MIN_HALF * 2 + 1 }, (_unused, index) => index + MIN_HALF).some(
13
+ (cut) => dictionary.has(lower.slice(0, cut)) && dictionary.has(lower.slice(cut)),
14
+ );
15
+ };
@@ -4,6 +4,8 @@ import { isWithinAny, quotedIn } from "../quoted-span.ts";
4
4
  import { entryOpens } from "./lexicon-match.ts";
5
5
  import { laterAlternatives, laterJoined } from "../alternative-words.ts";
6
6
  import { isContrastiveGa } from "./adversative-ga.ts";
7
+ import { isFlattenedTable } from "./sentence-parts.ts";
8
+ import { bareListCommas } from "./bare-word-list.ts";
7
9
 
8
10
  type TokenTest = (token: Token, at: number, tokens: readonly Token[]) => boolean;
9
11
 
@@ -63,7 +65,8 @@ const largestItem = (sentence: Sentence, counted: readonly Token[]): readonly To
63
65
  /**
64
66
  * A sentence holding more than limit tokens written as one of the lexicon's words (the suffix 的). The options of one choice
65
67
  * (連続的か断続的か、一時的) and a joined pair (信仰的主観的) count once: each names one point. A list written inside the sentence
66
- * (①…、②…) is counted item by item, as each item is a point of its own.
68
+ * (①…、②…) is counted item by item, as each item is a point of its own. A table a converter flattened into one sentence
69
+ * is cells, not the writer's sentence (the same 経常的 in each row).
67
70
  */
68
71
  export const sentenceWordCount: Detector = (doc, options): Finding[] => {
69
72
  const words = wordsOf(options.lexicon);
@@ -81,6 +84,7 @@ export const sentenceWordCount: Detector = (doc, options): Finding[] => {
81
84
  const isCounted: TokenTest = (token, at, tokens) => words.has(token.surface) && !laterOf(tokens).has(at);
82
85
  const fixedTerms = doc.lexicons[FIXED_TERM_LEXICON] ?? [];
83
86
  return doc.sentences.flatMap((sentence) => {
87
+ if (isFlattenedTable(sentence.text)) return [];
84
88
  const counted = largestItem(sentence, countedTokens(sentence, isCounted, fixedTerms));
85
89
  return counted.length > options.limit ? [findingOf(sentence, counted, options.limit)] : [];
86
90
  });
@@ -145,10 +149,21 @@ export const separatesItems = (at: number, tokens: readonly Token[]): boolean =>
145
149
  return betweenQuotations(at, tokens) || (isNominal(itemEnd) && startsNoun(at, tokens, itemEnd));
146
150
  };
147
151
 
148
- /** A sentence cut by more than limit of the lexicon's commas (読点). Commas between listed nouns are not counted. */
152
+ /**
153
+ * A sentence cut by more than limit of the lexicon's commas (読点). Commas between listed nouns, and between the short bare words
154
+ * of a list, are not counted. A table a converter flattened into one sentence is cells, not the writer's sentence.
155
+ */
149
156
  export const sentenceCommaCount: Detector = (doc, options): Finding[] => {
150
157
  const commas = wordsOf(options.lexicon);
151
- return sentencesOver(doc, options.limit, (token, at, tokens) => commas.has(token.surface) && !separatesItems(at, tokens));
158
+ const isComma = (token: Token): boolean => commas.has(token.surface);
159
+ const listed = new WeakMap<readonly Token[], ReadonlySet<number>>();
160
+ const listedIn = (tokens: readonly Token[]): ReadonlySet<number> => {
161
+ const known = listed.get(tokens) ?? bareListCommas(tokens, isComma);
162
+ listed.set(tokens, known);
163
+ return known;
164
+ };
165
+ const counts: TokenTest = (token, at, tokens) => isComma(token) && !separatesItems(at, tokens) && !listedIn(tokens).has(at);
166
+ return sentencesOver({ ...doc, sentences: doc.sentences.filter((sentence) => !isFlattenedTable(sentence.text)) }, options.limit, counts);
152
167
  };
153
168
 
154
169
  const CONJUNCTIVE = "SCONJ";
@@ -5,9 +5,11 @@ import { isRunInLabel } from "./run-in-label.ts";
5
5
  import { noticeSentences } from "./notice-paragraph.ts";
6
6
  import { separatePartSentences, trailingPartSentences } from "./register-separate-part.ts";
7
7
  import { askerSentences } from "./asker-voice.ts";
8
+ import { recordingCaptionSentences } from "../recording-title.ts";
8
9
  import { licenceNoticeSentences } from "./licence-notice.ts";
9
10
  import { chronologyRows } from "../chronology-rows.ts";
10
11
  import { isNeutralPlainShape } from "./register-neutral-shape.ts";
12
+ import { spokenAnswerSentences } from "./register-interview.ts";
11
13
  import { contactBlockSentences, fieldValueSentences, labelledQuoteSentences, referenceNoteSentences, tableCellSentences } from "./register-set-apart.ts";
12
14
  import { endsInSetGreeting, isDeclaration, isExclamation, isTakenUp } from "./register-voice.ts";
13
15
  import { entriesForGenre } from "../lexicon-genres.ts";
@@ -22,6 +24,7 @@ import type { Detector, Finding, LexiconEntry, ProseDocument, Sentence, Span, To
22
24
  * 年表の行(1921年信号装置の製作を開始する。)も、文書の文体と揃えない書き方なので数えない。
23
25
  * 断り書きの段落(…ご了承ください。)も、本文とは別の声で書く決まり文句なので数えない(notice-paragraph.ts)。
24
26
  * 読み手の相談や質問を載せる節(【相談事例等】)の文は尋ねた人の言葉のままなので数えない(asker-voice.ts)。
27
+ * 動画の題(…(3分00秒))の下の説明も、動画の言葉のままなので数えない(recording-title.ts)。
25
28
  * 文書の最後に掲載先が付けた利用条件の断り書き(…ライセンスの下に提供されています。)も数えない(licence-notice.ts)。
26
29
  * 札を付けて引いた言葉(例:…。Q: …?)、印を付けた札の行の下の記入欄の値(■ 調査目的\n…とする。)、
27
30
  * 〒や電話の行のある問い合わせ先の段落も数えない(register-set-apart.ts)。
@@ -33,6 +36,7 @@ import type { Detector, Finding, LexiconEntry, ProseDocument, Sentence, Span, To
33
36
  * 丁寧な形でしか言わない挨拶(お疲れ様でした。)、演説の決意の言い切り(二度と繰り返さない。)、
34
37
  * 次の文が「そんな」「これだけ」で受ける場面の書き出し、「!」で終わる叫び(わかるかっ!)も quiet(register-voice.ts)。
35
38
  * ※で始まる行の注記と、行に並べ直した表のセル(制限なし。)は、どちらの調子でも quiet(register-set-apart.ts)。
39
+ * インタビューの答え(聞き手の「――」の後の段落)は話した言葉なので quiet(register-interview.ts)。
36
40
  * 数には入れる。数から外すと、常体を何度も使う文書(演説)で少数派が閾値を下回り、残りの常体の文が新たに指されてしまう。
37
41
  */
38
42
  type Entry = { readonly sentence: Sentence; readonly register: Register; readonly group: number | undefined; readonly quiet: boolean };
@@ -101,12 +105,19 @@ export const judgedSentences = (doc: ProseDocument, polite: readonly LexiconEntr
101
105
  const words = endingWords(doc, polite, genre);
102
106
  const lists = doc.lists.map((list) => list.span);
103
107
  const rows = chronologyRows(doc);
104
- const asked = askerSentences(doc.sections, doc.lexicons["asker-heading"] ?? []);
108
+ const asked = new Set([...askerSentences(doc.sections, doc.lexicons["asker-heading"] ?? []), ...recordingCaptionSentences(doc.sections)]);
105
109
  const licence = licenceNoticeSentences(doc, doc.lexicons["licence-word"] ?? []);
106
110
  const quoted = labelledQuoteSentences(doc.paragraphs, doc.source, doc.lexicons["quote-label"] ?? []);
107
111
  const fields = fieldValueSentences(doc.sentences, doc.source);
108
112
  const contact = contactBlockSentences(doc.sentences, doc.source, doc.lexicons["contact-line-opener"] ?? []);
109
- const asides = new Set([...referenceNoteSentences(doc.sentences, doc.source), ...tableCellSentences(doc.sentences, doc.source)]);
113
+ const asides = new Set([
114
+ ...referenceNoteSentences(doc.sentences, doc.source),
115
+ ...tableCellSentences(doc.sentences, doc.source),
116
+ ...spokenAnswerSentences(
117
+ doc,
118
+ (doc.lexicons["interviewer-mark"] ?? []).map((entry) => entry.pattern),
119
+ ),
120
+ ]);
110
121
  const all = doc.sentences.flatMap((sentence, index): { sentence: Sentence; register: Register; quiet: boolean }[] => {
111
122
  if (
112
123
  !isClosed(sentence) ||