chaffjs 0.49.0 → 0.50.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 (373) hide show
  1. package/dist/announced-count.d.ts.map +1 -1
  2. package/dist/announced-count.js +18 -1
  3. package/dist/announced-count.js.map +1 -1
  4. package/dist/announced-list.d.ts.map +1 -1
  5. package/dist/announced-list.js +6 -1
  6. package/dist/announced-list.js.map +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +4 -2
  9. package/dist/cli.js.map +1 -1
  10. package/dist/composite-signals.d.ts +3 -1
  11. package/dist/composite-signals.d.ts.map +1 -1
  12. package/dist/composite-signals.js +7 -0
  13. package/dist/composite-signals.js.map +1 -1
  14. package/dist/detectors/agentless-passive.d.ts.map +1 -1
  15. package/dist/detectors/agentless-passive.js +39 -4
  16. package/dist/detectors/agentless-passive.js.map +1 -1
  17. package/dist/detectors/agreement-slip.d.ts +2 -0
  18. package/dist/detectors/agreement-slip.d.ts.map +1 -1
  19. package/dist/detectors/agreement-slip.js +10 -3
  20. package/dist/detectors/agreement-slip.js.map +1 -1
  21. package/dist/detectors/amount-scale.js +2 -2
  22. package/dist/detectors/amount-scale.js.map +1 -1
  23. package/dist/detectors/chat-citation.d.ts +2 -6
  24. package/dist/detectors/chat-citation.d.ts.map +1 -1
  25. package/dist/detectors/chat-citation.js +4 -2
  26. package/dist/detectors/chat-citation.js.map +1 -1
  27. package/dist/detectors/chat-mark-extent.d.ts +11 -0
  28. package/dist/detectors/chat-mark-extent.d.ts.map +1 -0
  29. package/dist/detectors/chat-mark-extent.js +53 -0
  30. package/dist/detectors/chat-mark-extent.js.map +1 -0
  31. package/dist/detectors/conjugated-entry.d.ts +2 -2
  32. package/dist/detectors/conjugated-entry.d.ts.map +1 -1
  33. package/dist/detectors/conjugated-entry.js +3 -5
  34. package/dist/detectors/conjugated-entry.js.map +1 -1
  35. package/dist/detectors/contrast-frame.d.ts.map +1 -1
  36. package/dist/detectors/contrast-frame.js +34 -1
  37. package/dist/detectors/contrast-frame.js.map +1 -1
  38. package/dist/detectors/currency-notation.js +2 -2
  39. package/dist/detectors/currency-notation.js.map +1 -1
  40. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  41. package/dist/detectors/defined-term-form.js +15 -3
  42. package/dist/detectors/defined-term-form.js.map +1 -1
  43. package/dist/detectors/definition-use.d.ts.map +1 -1
  44. package/dist/detectors/definition-use.js +5 -1
  45. package/dist/detectors/definition-use.js.map +1 -1
  46. package/dist/detectors/ellipsis.js +2 -2
  47. package/dist/detectors/ellipsis.js.map +1 -1
  48. package/dist/detectors/email-letter.d.ts +2 -0
  49. package/dist/detectors/email-letter.d.ts.map +1 -1
  50. package/dist/detectors/email-letter.js +1 -1
  51. package/dist/detectors/email-letter.js.map +1 -1
  52. package/dist/detectors/en-shape.d.ts.map +1 -1
  53. package/dist/detectors/en-shape.js +34 -8
  54. package/dist/detectors/en-shape.js.map +1 -1
  55. package/dist/detectors/gram-furniture.d.ts +1 -0
  56. package/dist/detectors/gram-furniture.d.ts.map +1 -1
  57. package/dist/detectors/gram-furniture.js +6 -0
  58. package/dist/detectors/gram-furniture.js.map +1 -1
  59. package/dist/detectors/gram-repetition.d.ts.map +1 -1
  60. package/dist/detectors/gram-repetition.js +8 -2
  61. package/dist/detectors/gram-repetition.js.map +1 -1
  62. package/dist/detectors/heading-case.d.ts +1 -0
  63. package/dist/detectors/heading-case.d.ts.map +1 -1
  64. package/dist/detectors/heading-case.js +10 -3
  65. package/dist/detectors/heading-case.js.map +1 -1
  66. package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
  67. package/dist/detectors/kutoten-consistency.js +27 -6
  68. package/dist/detectors/kutoten-consistency.js.map +1 -1
  69. package/dist/detectors/lexicon-match.d.ts +2 -0
  70. package/dist/detectors/lexicon-match.d.ts.map +1 -1
  71. package/dist/detectors/lexicon-match.js +14 -3
  72. package/dist/detectors/lexicon-match.js.map +1 -1
  73. package/dist/detectors/lexicon.d.ts.map +1 -1
  74. package/dist/detectors/lexicon.js +8 -1
  75. package/dist/detectors/lexicon.js.map +1 -1
  76. package/dist/detectors/list-item-clause.d.ts +4 -0
  77. package/dist/detectors/list-item-clause.d.ts.map +1 -0
  78. package/dist/detectors/list-item-clause.js +8 -0
  79. package/dist/detectors/list-item-clause.js.map +1 -0
  80. package/dist/detectors/list-parallel.d.ts.map +1 -1
  81. package/dist/detectors/list-parallel.js +6 -2
  82. package/dist/detectors/list-parallel.js.map +1 -1
  83. package/dist/detectors/list-sentence.d.ts +2 -0
  84. package/dist/detectors/list-sentence.d.ts.map +1 -1
  85. package/dist/detectors/list-sentence.js.map +1 -1
  86. package/dist/detectors/mark-shape.d.ts.map +1 -1
  87. package/dist/detectors/mark-shape.js +28 -8
  88. package/dist/detectors/mark-shape.js.map +1 -1
  89. package/dist/detectors/missing-final-period.d.ts.map +1 -1
  90. package/dist/detectors/missing-final-period.js +10 -1
  91. package/dist/detectors/missing-final-period.js.map +1 -1
  92. package/dist/detectors/nominalization.d.ts.map +1 -1
  93. package/dist/detectors/nominalization.js +11 -4
  94. package/dist/detectors/nominalization.js.map +1 -1
  95. package/dist/detectors/ordinal-suffix.js +2 -2
  96. package/dist/detectors/ordinal-suffix.js.map +1 -1
  97. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  98. package/dist/detectors/orthographic-variant.js +30 -6
  99. package/dist/detectors/orthographic-variant.js.map +1 -1
  100. package/dist/detectors/orthography.d.ts.map +1 -1
  101. package/dist/detectors/orthography.js +13 -7
  102. package/dist/detectors/orthography.js.map +1 -1
  103. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  104. package/dist/detectors/oxford-comma.js +15 -1
  105. package/dist/detectors/oxford-comma.js.map +1 -1
  106. package/dist/detectors/paragraph-run.js +2 -2
  107. package/dist/detectors/paragraph-run.js.map +1 -1
  108. package/dist/detectors/phone-number-variant.d.ts.map +1 -1
  109. package/dist/detectors/phone-number-variant.js +2 -1
  110. package/dist/detectors/phone-number-variant.js.map +1 -1
  111. package/dist/detectors/phrase-context.d.ts +6 -0
  112. package/dist/detectors/phrase-context.d.ts.map +1 -0
  113. package/dist/detectors/phrase-context.js +12 -0
  114. package/dist/detectors/phrase-context.js.map +1 -0
  115. package/dist/detectors/phrase-match-all.d.ts +3 -0
  116. package/dist/detectors/phrase-match-all.d.ts.map +1 -0
  117. package/dist/detectors/phrase-match-all.js +47 -0
  118. package/dist/detectors/phrase-match-all.js.map +1 -0
  119. package/dist/detectors/phrase-match.d.ts +2 -1
  120. package/dist/detectors/phrase-match.d.ts.map +1 -1
  121. package/dist/detectors/phrase-match.js +25 -6
  122. package/dist/detectors/phrase-match.js.map +1 -1
  123. package/dist/detectors/placeholder-text.d.ts.map +1 -1
  124. package/dist/detectors/placeholder-text.js +14 -2
  125. package/dist/detectors/placeholder-text.js.map +1 -1
  126. package/dist/detectors/proper-noun-density.d.ts.map +1 -1
  127. package/dist/detectors/proper-noun-density.js +10 -6
  128. package/dist/detectors/proper-noun-density.js.map +1 -1
  129. package/dist/detectors/quote-around.d.ts +3 -0
  130. package/dist/detectors/quote-around.d.ts.map +1 -1
  131. package/dist/detectors/quote-around.js +2 -0
  132. package/dist/detectors/quote-around.js.map +1 -1
  133. package/dist/detectors/range-notation.js +2 -2
  134. package/dist/detectors/range-notation.js.map +1 -1
  135. package/dist/detectors/registry/phrase-match-all.d.ts +3 -0
  136. package/dist/detectors/registry/phrase-match-all.d.ts.map +1 -0
  137. package/dist/detectors/registry/phrase-match-all.js +3 -0
  138. package/dist/detectors/registry/phrase-match-all.js.map +1 -0
  139. package/dist/detectors/requirement-lists.d.ts.map +1 -1
  140. package/dist/detectors/requirement-lists.js +2 -0
  141. package/dist/detectors/requirement-lists.js.map +1 -1
  142. package/dist/detectors/sentence-counts.d.ts.map +1 -1
  143. package/dist/detectors/sentence-counts.js +5 -3
  144. package/dist/detectors/sentence-counts.js.map +1 -1
  145. package/dist/detectors/sentence-length.d.ts.map +1 -1
  146. package/dist/detectors/sentence-length.js +9 -2
  147. package/dist/detectors/sentence-length.js.map +1 -1
  148. package/dist/detectors/signals.d.ts.map +1 -1
  149. package/dist/detectors/signals.js +6 -1
  150. package/dist/detectors/signals.js.map +1 -1
  151. package/dist/detectors/team.d.ts.map +1 -1
  152. package/dist/detectors/team.js +42 -9
  153. package/dist/detectors/team.js.map +1 -1
  154. package/dist/detectors/unit-spacing.js +2 -2
  155. package/dist/detectors/unit-spacing.js.map +1 -1
  156. package/dist/detectors/vague-deadline.d.ts.map +1 -1
  157. package/dist/detectors/vague-deadline.js +2 -1
  158. package/dist/detectors/vague-deadline.js.map +1 -1
  159. package/dist/levels.d.ts +14 -0
  160. package/dist/levels.d.ts.map +1 -1
  161. package/dist/levels.js +8 -3
  162. package/dist/levels.js.map +1 -1
  163. package/dist/phone-numbers.d.ts +5 -2
  164. package/dist/phone-numbers.d.ts.map +1 -1
  165. package/dist/phone-numbers.js +17 -3
  166. package/dist/phone-numbers.js.map +1 -1
  167. package/dist/plugin.d.ts +2 -0
  168. package/dist/plugin.d.ts.map +1 -1
  169. package/dist/render/explain.d.ts +2 -0
  170. package/dist/render/explain.d.ts.map +1 -1
  171. package/dist/render/explain.js +38 -14
  172. package/dist/render/explain.js.map +1 -1
  173. package/dist/render/options.d.ts.map +1 -1
  174. package/dist/render/options.js +11 -6
  175. package/dist/render/options.js.map +1 -1
  176. package/dist/render/text.d.ts.map +1 -1
  177. package/dist/render/text.js +14 -4
  178. package/dist/render/text.js.map +1 -1
  179. package/dist/run.d.ts +3 -0
  180. package/dist/run.d.ts.map +1 -1
  181. package/dist/run.js +20 -13
  182. package/dist/run.js.map +1 -1
  183. package/dist/structure/deadline-after-event.d.ts +1 -1
  184. package/dist/structure/deadline-after-event.d.ts.map +1 -1
  185. package/dist/structure/deadline-after-event.js +36 -9
  186. package/dist/structure/deadline-after-event.js.map +1 -1
  187. package/dist/structure/definition-use.d.ts +10 -1
  188. package/dist/structure/definition-use.d.ts.map +1 -1
  189. package/dist/structure/definition-use.js +4 -4
  190. package/dist/structure/definition-use.js.map +1 -1
  191. package/dist/structure/leg-times.d.ts.map +1 -1
  192. package/dist/structure/leg-times.js +10 -2
  193. package/dist/structure/leg-times.js.map +1 -1
  194. package/dist/structure/requirement-lists.d.ts +3 -0
  195. package/dist/structure/requirement-lists.d.ts.map +1 -1
  196. package/dist/structure/requirement-lists.js +8 -2
  197. package/dist/structure/requirement-lists.js.map +1 -1
  198. package/dist/structure/time-marks.d.ts +10 -0
  199. package/dist/structure/time-marks.d.ts.map +1 -1
  200. package/dist/structure/time-marks.js +21 -0
  201. package/dist/structure/time-marks.js.map +1 -1
  202. package/package.json +3 -3
  203. package/rules/abstract-length.yaml +1 -1
  204. package/rules/adverb-overuse.yaml +1 -1
  205. package/rules/agentless-passive.yaml +3 -3
  206. package/rules/agreement-slip.yaml +5 -4
  207. package/rules/ai-generated-composite.yaml +3 -3
  208. package/rules/ai-structure.yaml +1 -1
  209. package/rules/all-caps-shouting.yaml +1 -1
  210. package/rules/announced-count-mismatch.yaml +2 -2
  211. package/rules/announcing-opener.yaml +1 -1
  212. package/rules/arrival-before-departure.yaml +1 -1
  213. package/rules/article-sound.yaml +1 -1
  214. package/rules/baito-keigo.yaml +1 -1
  215. package/rules/bold-density.yaml +1 -1
  216. package/rules/bold-emphasis.yaml +1 -1
  217. package/rules/bold-label-list.yaml +1 -1
  218. package/rules/bracket-width-consistency.yaml +1 -1
  219. package/rules/chat-citation-residue.yaml +1 -1
  220. package/rules/citation-style-mix.yaml +1 -1
  221. package/rules/clause-chain.yaml +1 -1
  222. package/rules/cliche.yaml +4 -4
  223. package/rules/closing-cliche.yaml +1 -1
  224. package/rules/closing-exhortation.yaml +1 -1
  225. package/rules/cold-open.yaml +1 -1
  226. package/rules/colloquial-opener.yaml +1 -1
  227. package/rules/concrete-evidence-density.yaml +1 -1
  228. package/rules/contraction-consistency.yaml +1 -1
  229. package/rules/cross-doc-term-variant.yaml +2 -2
  230. package/rules/cushion-phrase-density.yaml +1 -1
  231. package/rules/deadline-after-event.yaml +2 -2
  232. package/rules/demonstrative-opener-run.yaml +1 -1
  233. package/rules/double-keigo.yaml +1 -1
  234. package/rules/double-negative.yaml +11 -2
  235. package/rules/doubled-nado.yaml +1 -1
  236. package/rules/email-stock-courtesy.yaml +1 -1
  237. package/rules/email-subject-length.yaml +1 -1
  238. package/rules/emoji-heading.yaml +1 -1
  239. package/rules/empty-intensifier.yaml +1 -1
  240. package/rules/excessive-hedging.yaml +1 -1
  241. package/rules/exclamation-width-consistency.yaml +1 -1
  242. package/rules/expletive-construction.yaml +3 -3
  243. package/rules/figurative-density.yaml +3 -3
  244. package/rules/hiragana-fukushi.yaml +1 -1
  245. package/rules/homophone-slip.yaml +3 -3
  246. package/rules/honesty-marker.yaml +1 -1
  247. package/rules/humble-for-others.yaml +1 -1
  248. package/rules/hyphen-as-dash.yaml +1 -1
  249. package/rules/idiom-misuse.yaml +1 -1
  250. package/rules/internal-jargon.yaml +1 -1
  251. package/rules/kana-function-word.yaml +1 -1
  252. package/rules/katakana-long-vowel.yaml +1 -1
  253. package/rules/kutoten-consistency.yaml +7 -3
  254. package/rules/latin-abbreviation-form.yaml +1 -1
  255. package/rules/latin-spacing.yaml +1 -1
  256. package/rules/max-paragraph-length.yaml +1 -1
  257. package/rules/max-sentence-length.yaml +1 -1
  258. package/rules/max-ten.yaml +1 -1
  259. package/rules/misconversion.yaml +2 -2
  260. package/rules/ngram-repetition.yaml +3 -3
  261. package/rules/no-em-dash.yaml +3 -3
  262. package/rules/no-mixed-desumasu.yaml +1 -1
  263. package/rules/no-nakaguro-parallel.yaml +1 -1
  264. package/rules/nominalization.yaml +1 -1
  265. package/rules/nonstandard-word.yaml +2 -2
  266. package/rules/numbered-generic-heading.yaml +1 -1
  267. package/rules/numbering-gap.yaml +2 -2
  268. package/rules/one-sentence-paragraph-run.yaml +1 -1
  269. package/rules/orthographic-variant.yaml +2 -2
  270. package/rules/over-general-claim.yaml +1 -1
  271. package/rules/oxford-comma-consistency.yaml +4 -3
  272. package/rules/padded-intro.yaml +1 -1
  273. package/rules/phone-number-variant.yaml +1 -1
  274. package/rules/preamble-length.yaml +1 -1
  275. package/rules/preferred-term.yaml +1 -1
  276. package/rules/proper-noun-density.yaml +1 -1
  277. package/rules/q-fragment-answer.yaml +1 -1
  278. package/rules/quote-style-consistency.yaml +1 -1
  279. package/rules/quote-without-source.yaml +1 -1
  280. package/rules/redundant-expression.yaml +1 -1
  281. package/rules/repeated-conjunction.yaml +1 -1
  282. package/rules/repeated-sentence-ending.yaml +1 -1
  283. package/rules/repeated-sentence-head.yaml +5 -5
  284. package/rules/required-listed-as-preferred.yaml +2 -2
  285. package/rules/required-sections.yaml +1 -1
  286. package/rules/sasete-itadaku.yaml +1 -1
  287. package/rules/sentence-initial-conjunction-run.yaml +1 -1
  288. package/rules/sentence-initial-so.yaml +1 -1
  289. package/rules/sentence-spacing-consistency.yaml +1 -1
  290. package/rules/shell-prompt-mix.yaml +1 -1
  291. package/rules/stock-transition.yaml +1 -1
  292. package/rules/stray-space.yaml +1 -1
  293. package/rules/taigen-dome-in-prose.yaml +1 -1
  294. package/rules/teki-overuse.yaml +1 -1
  295. package/rules/title-case-consistency.yaml +1 -1
  296. package/rules/title-length.yaml +1 -1
  297. package/rules/topic-predicate-distance.yaml +1 -1
  298. package/rules/translationese-density.yaml +1 -1
  299. package/rules/uncomparable-graded.yaml +1 -1
  300. package/rules/undefined-acronym.yaml +1 -1
  301. package/rules/unfilled-placeholder.yaml +4 -4
  302. package/rules/unqualified-superlative.yaml +1 -1
  303. package/rules/use-before-definition.yaml +2 -2
  304. package/rules/vague-word-density.yaml +1 -1
  305. package/rules/weasel-word.yaml +1 -1
  306. package/rules/which-that-consistency.yaml +1 -1
  307. package/rules/wordy-phrase.yaml +1 -1
  308. package/src/announced-count.ts +22 -1
  309. package/src/announced-list.ts +7 -1
  310. package/src/cli.ts +4 -2
  311. package/src/composite-signals.ts +10 -1
  312. package/src/detectors/agentless-passive.ts +49 -5
  313. package/src/detectors/agreement-slip.ts +11 -3
  314. package/src/detectors/amount-scale.ts +2 -2
  315. package/src/detectors/chat-citation.ts +4 -5
  316. package/src/detectors/chat-mark-extent.ts +63 -0
  317. package/src/detectors/conjugated-entry.ts +3 -5
  318. package/src/detectors/contrast-frame.ts +37 -2
  319. package/src/detectors/currency-notation.ts +2 -2
  320. package/src/detectors/defined-term-form.ts +15 -4
  321. package/src/detectors/definition-use.ts +5 -8
  322. package/src/detectors/ellipsis.ts +2 -2
  323. package/src/detectors/email-letter.ts +1 -1
  324. package/src/detectors/en-shape.ts +40 -5
  325. package/src/detectors/gram-furniture.ts +8 -0
  326. package/src/detectors/gram-repetition.ts +8 -1
  327. package/src/detectors/heading-case.ts +11 -3
  328. package/src/detectors/kutoten-consistency.ts +37 -6
  329. package/src/detectors/lexicon-match.ts +17 -3
  330. package/src/detectors/lexicon.ts +10 -4
  331. package/src/detectors/list-item-clause.ts +9 -0
  332. package/src/detectors/list-parallel.ts +5 -2
  333. package/src/detectors/list-sentence.ts +2 -0
  334. package/src/detectors/mark-shape.ts +36 -8
  335. package/src/detectors/missing-final-period.ts +11 -1
  336. package/src/detectors/nominalization.ts +14 -4
  337. package/src/detectors/ordinal-suffix.ts +2 -2
  338. package/src/detectors/orthographic-variant.ts +44 -8
  339. package/src/detectors/orthography.ts +19 -9
  340. package/src/detectors/oxford-comma.ts +15 -1
  341. package/src/detectors/paragraph-run.ts +2 -2
  342. package/src/detectors/phone-number-variant.ts +2 -1
  343. package/src/detectors/phrase-context.ts +19 -0
  344. package/src/detectors/phrase-match-all.ts +57 -0
  345. package/src/detectors/phrase-match.ts +31 -6
  346. package/src/detectors/placeholder-text.ts +19 -3
  347. package/src/detectors/proper-noun-density.ts +14 -6
  348. package/src/detectors/quote-around.ts +6 -0
  349. package/src/detectors/range-notation.ts +2 -2
  350. package/src/detectors/registry/phrase-match-all.ts +4 -0
  351. package/src/detectors/requirement-lists.ts +2 -0
  352. package/src/detectors/sentence-counts.ts +7 -4
  353. package/src/detectors/sentence-length.ts +12 -2
  354. package/src/detectors/signals.ts +10 -1
  355. package/src/detectors/team.ts +50 -12
  356. package/src/detectors/unit-spacing.ts +2 -2
  357. package/src/detectors/vague-deadline.ts +2 -1
  358. package/src/levels.ts +9 -3
  359. package/src/phone-numbers.ts +19 -3
  360. package/src/plugin.ts +2 -0
  361. package/src/render/explain.ts +46 -16
  362. package/src/render/options.ts +12 -6
  363. package/src/render/text.ts +20 -7
  364. package/src/run.ts +32 -8
  365. package/src/structure/deadline-after-event.ts +49 -10
  366. package/src/structure/definition-use.ts +15 -5
  367. package/src/structure/leg-times.ts +16 -1
  368. package/src/structure/requirement-lists.ts +14 -2
  369. package/src/structure/time-marks.ts +25 -0
  370. package/dist/honorific-group.d.ts +0 -8
  371. package/dist/honorific-group.d.ts.map +0 -1
  372. package/dist/honorific-group.js +0 -15
  373. package/dist/honorific-group.js.map +0 -1
@@ -46,7 +46,7 @@ not_flagged:
46
46
  en: Only the suffix 的 is counted; words such as 目的 and 的確, terms the law defines (電磁的方法, 反社会的勢力), and anything in 「」 are not. The options of one choice joined by か (連続的か断続的か、一時的) and a pair written together with only nouns between (信仰的主観的, 時間的空間的) count once. A list written inside the sentence with circled numbers (①…、②…) is counted item by item. A table a converter ran into one sentence (rows of ditto cells, 〃) is not counted.
47
47
  level_meaning:
48
48
  ja: 一文の「〜的」{limit} 個まで
49
- en: up to {limit} 〜的 words in a sentence
49
+ en: up to {limit} {limit|〜的 word|〜的 words} in a sentence
50
50
  rewrite:
51
51
  depth: light
52
52
  ja:
@@ -65,4 +65,4 @@ not_flagged:
65
65
  en: The document's title (the first heading, when no other heading is as shallow) is a name and is not compared. Neither style is called right.
66
66
  level_meaning:
67
67
  ja: 少ないほうの流儀の見出しが {limit} 個以下のとき指摘
68
- en: reported when the minority style has {limit} headings or fewer
68
+ en: reported when the minority style has {limit} {limit|heading|headings} or fewer
@@ -91,7 +91,7 @@ not_flagged:
91
91
  en: "A number label at the head of a heading (Chapter 2, 1.) is not counted. Nor is a numbered series label in brackets at its end (“(490: Employee travel)”), and another document's title quoted in 「」 counts as one name. Reports, press releases, minutes, specifications and papers have a higher limit; legal, literary and speech genres, and FAQs (whose headings are questions), do not run this rule. In any genre, a heading that ends with a question mark, or with a Japanese question particle (…できますか。), is not counted, since its length is the reader's question. A heading ending with a running time in brackets (… (3:00)) is the title of a video or a recording and is not counted."
92
92
  level_meaning:
93
93
  ja: 題や見出しが {limit} 文字を超えたら指摘
94
- en: reported when a title or heading runs past {limit} words
94
+ en: reported when a title or heading runs past {limit} {limit|word|words}
95
95
  rewrite:
96
96
  depth: light
97
97
  ja:
@@ -49,7 +49,7 @@ not_flagged:
49
49
  en: Sentences with no topic (noun + は), quotations in 「」, and distances up to the limit are not counted. When the topic gets its own predicate in an earlier clause (〜ではありませんが, 〜であって; 〜ではなく, 〜であるため, 〜は〜で with no comma between, 〜であるならば, 〜にあるところ or 〜ており followed by a clause with its own subject; a passive report 〜だと言われているが; 〜ますが or 〜ましたが (or the negative 〜ませんが, 〜ませんでしたが) with no other subject between the topic and it, followed by a clause with a subject of its own (〜が) and then a new topic, or straight away by a name as a new topic that runs to the end (〜ましたが、赤澤大臣は…), or always when the topic is an act made a noun (〜することは差し控えますが、…); 〜ことから, 〜つつ, 〜としても or 〜こととし with no other subject between the topic and it, from the topic-clause-close word list; a circled number (③) after a predicate, where a list run into one line starts its next item; a 〜のは topic that gets its copula inside a clause という makes a noun's content, when that noun phrase ends at a comma, as in 〜来てほしいのは日本であったという調査の結果、…), the count stops at that clause's end. A later clause's subject may be a part, as in 〜のほとんどは. A は that makes an adverb of the noun before it (最後は, in the end; the words are in the topic-adverb word list) is not a topic; with a noun or の before it (交渉の最後は) it is. When a は that sets the time or the case (今夜は, 当日は, 〜ときは) is followed by another topic, the count starts from that topic. An article of a statute that a document of another kind quotes as it stands (第7条 …, the forms in the statute-article-opener word list) is not the writer's sentence and is not counted. Not used on English documents.
50
50
  level_meaning:
51
51
  ja: 主題から述語まで {limit} 字まで
52
- en: up to {limit} characters between the topic and the predicate
52
+ en: up to {limit} {limit|character|characters} between the topic and the predicate
53
53
  rewrite:
54
54
  depth: light
55
55
  ja:
@@ -47,7 +47,7 @@ not_flagged:
47
47
  en: None of these is wrong alone, so documents shorter than 500 characters are not measured. Phrasings common in human technical writing (を提供する, に焦点を当てる, することができる) are not counted. A document whose only such phrases address the reader (あなたの, あなたは) has chosen to speak to its reader and is not reported; beside other phrases they count. The literature preset turns it off, since a novel calls its characters 彼女.
48
48
  level_meaning:
49
49
  ja: 1000 字あたり翻訳調の言い回し {limit} 個まで
50
- en: up to {limit} translated phrasings per 1000 characters
50
+ en: up to {limit} {limit|translated phrasing|translated phrasings} per 1000 characters
51
51
  rewrite:
52
52
  depth: light
53
53
  ja:
@@ -50,7 +50,7 @@ not_flagged:
50
50
  en: Only the pairs on chaff's list are checked. Words that say how close ("almost unique", "nearly impossible", ほぼ完璧) are not reported. A superlative stacked on a superlative (最も最適) is redundant-expression's, and より最適化する (optimise further) is not reported. Literature is not checked.
51
51
  level_meaning:
52
52
  ja: 当てはまる言い回しが {limit} 箇所あれば指摘
53
- en: reported once there are {limit}
53
+ en: reported once there {limit|is|are} {limit}
54
54
  sources: [proselint]
55
55
  rewrite:
56
56
  depth: light
@@ -97,4 +97,4 @@ not_flagged:
97
97
  en: Common acronyms (URL, PDF), acronyms spelled out in brackets next to them, and the letters of a company name (㈱ADEKA, CO.,LTD.) are not reported. Neither are a template's placeholders (OOOO, XX 月) or an acronym in the title of a page in a list of links (it still counts towards the limit). Nor are an acronym explained under another capitalisation (TCoP, then TCOP), one a sentence about the abbreviation writes out (the abbreviation DOB … date of birth), or a term in a list whose nested link names it (- GPL above GNU General Public License). Nor are the parties and courts of a case citation (Ashwander v. TVA, 297 U.S. 288; MCI Telecomms. Corp. v. AT&T; (SDNY 1952)), an agency's docket number in a citation (NOV/CFA 01-01); a citation's acronyms still count towards the limit. Nor is the MR. JUSTICE that opens a line of an opinion. An acronym given another name after "or" in its parenthesis (Department of Health and Human Services (HHS or the Department)) or spelled out with its hyphened letter (Agency for Health (ARPA-H)) counts as expanded, and the letters of an email address (OASH-RFI@hhs.gov) are not an acronym. Nor are the rule names and values of an ABNF grammar in the text (CRLF, %x0D), the rungs of a grade ladder (A and AA), a register or reporter cited by number (80 FR 66128, 2022 WL 4447293), the kind written before a dated identifier (WD WD-ABC1-20200101), or the PO of a PO Box. A note that opens with a citation (1. See L. Summers (2015), "…," IMF Economic Review) is written in the cited work's words, and its acronyms are not reported (they still count towards the limit); so is an entry of a reference list keyed by a bracketed label ([FETCH] WHATWG, …; also when a long label leaves one space, or stands alone above the indented entry). Nor are capitals the document cites by two or more numbers (BCP 78 and BCP 14, DR 4339 and DR 4340), an acronym whose name the same sentence writes out before it (U.S. Small Business Administration … SBA), a judge's surname after his title (Lord HOLT, Mr. Justice BULLER), a name marked as a trademark (Acrobat DC®), a code cited by section (44 USC. 3502, 15 USCA § 709, FAR 12.212), or a code cited by title and division (21 CFR subpart J). Nor are a keyword to send by text message (texting GNPCGS to 333111), a product's edition written with the product's name (Adobe Acrobat Reader DC), or capitals joined to a capitalised word in a name (NITE SAFE-Lite). An acronym the same sentence writes out in lower case before the same noun (incident response plan … IR plans), and one bracketed with a word in lower case after a name whose head gives its letters (… Partnerships to Stimulate Cybersecurity Education (RAMPS program)), count as expanded. An acronym in a pasted chat line (<jinxer-wm> FIRING …) is the speaker's or the bot's words, and is not reported (it still counts towards the limit). Nor are the capitals inside a postal address that runs from a street number to a state and ZIP code (the NE and MS of 1600 Elm Rd. NE, MS K12-3, Springfield, GA 30329), a keyword of SQL (VIEW, WHERE), or a name in capitals that the document also writes inside a sentence with only its first letter a capital (AIRBNB in a text that writes a hotel / Airbnb). Nor is a conjunction written in capitals at the head of a line (OR, Skip to …; an OR alone between two options). Nor are capitals a document writes only as the name of a kind of file (the MAP files, MAPファイル, the extension “.MAP”). Nor is a word of three letters or more that the dictionary knows only as an interjection, written in capitals (HEY, a product's name). Nor are two words in capitals side by side, each of five letters or more (MIRAI SCHOOL, the name of a plan; UNITED STATES), which are a name or words written in capitals.
98
98
  level_meaning:
99
99
  ja: 説明のない略語が {limit} 種類あれば指摘。文書が自分で略語を {limit} 個展開していれば、1 つの抜けから指摘
100
- en: reported once {limit} different acronyms go unexplained, or from the first one when the document itself spells out {limit} others
100
+ en: reported once {limit} different {limit|acronym goes|acronyms go} unexplained, or from the first one when the document itself spells out {limit} {limit|other|others}
@@ -10,8 +10,8 @@ name:
10
10
  en: Unfilled placeholder
11
11
 
12
12
  why:
13
- ja: "「【会社名】」「[Your Name]」「(ここに会社名を書く)」は、雛形や生成した下書きに残る空欄です。値に「TODO: …」「未定」とだけ書いたものも、後で埋めるつもりの空欄です。英語の雛形の指示の行(OPTIONAL: General conclusions …)が、埋めた報告書に残ったものも同じです。文体の好みではなく、埋め忘れです。ビジネス文書の宛名・署名・金額・日付・住所・電話番号の位置に残った「〇〇様」「株式会社〇〇」「〇万円」「氏名:〇〇」「03-〇〇〇〇」も同じ空欄です。表の升に残った空欄も数えます。文の中で例として置いた「○○」は正しい書き方なので数えません。"
14
- en: '"[Your Name]" and "[Insert Date]" are the blanks a template or a generated draft leaves. A value that only says "TODO: …" or "TBD" is a blank too, left to fill in later, and so is an instruction line from the template left in a filled report ("OPTIONAL: General conclusions …"). This is not a matter of style: the blank was never filled. In a Japanese business document, the blank marks (〇〇) left where a name, a sum, a date, an address or a phone number belongs (〇〇様, 株式会社〇〇, 〇万円, 氏名:〇〇, 03-〇〇〇〇) are blanks too. A blank left in a table cell counts as well.'
13
+ ja: "「【会社名】」「[Your Name]」「[Candidate Name]」「(ここに会社名を書く)」は、雛形や生成した下書きに残る空欄です。値に「TODO: …」「未定」とだけ書いたものも、後で埋めるつもりの空欄です。英語の雛形の指示の行(OPTIONAL: General conclusions …)が、埋めた報告書に残ったものも同じです。文体の好みではなく、埋め忘れです。ビジネス文書の宛名・署名・金額・日付・住所・電話番号の位置に残った「〇〇様」「株式会社〇〇」「〇万円」「氏名:〇〇」「03-〇〇〇〇」も同じ空欄です。表の升に残った空欄も数えます。文の中で例として置いた「○○」は正しい書き方なので数えません。"
14
+ en: '"[Your Name]", "[Insert Date]" and "[Candidate Name]" are the blanks a template or a generated draft leaves. A value that only says "TODO: …" or "TBD" is a blank too, left to fill in later, and so is an instruction line from the template left in a filled report ("OPTIONAL: General conclusions …"). This is not a matter of style: the blank was never filled. In a Japanese business document, the blank marks (〇〇) left where a name, a sum, a date, an address or a phone number belongs (〇〇様, 株式会社〇〇, 〇万円, 氏名:〇〇, 03-〇〇〇〇) are blanks too. A blank left in a table cell counts as well.'
15
15
 
16
16
  message:
17
17
  ja: 「{matched}」が埋まっていません
@@ -43,5 +43,5 @@ example:
43
43
  We can meet on Friday 9 October to go through the quote.
44
44
 
45
45
  not_flagged:
46
- ja: "文の中で例として置いた「○○」とビジネス文書以外の「○○」、行頭の「○」(箇条書きの印)、Markdown のリンク、脚注の番号、チェック欄とチェックリストの項目(- [ ] TODO: …)、値が続く見出しの札(【氏名】山田)、大文字でない「Optional:」と行の途中の OPTIONAL、コードとコードのコメント(// TODO)、文の中の「未定」(日程は未定です)、見出しが雛形と言う節(「## 雛形」「# 記入例」)の中の空欄、文書がほかの行で値を書き入れている書式の欄の名前(【氏名】 山田 花子 とある文書の「【氏名】に旧氏を書く」)、記入線の横の札(____ [Name of New Employer])、例を示す行のかぎ括弧の中(例:「【会社名】の田中です」)も指しません。"
47
- en: 'Markdown links and reference definitions, footnote numbers, checkboxes and checklist items ("- [ ] TODO: …"), a label its value follows ("[Date]: 2024-04-01"), "Optional:" not in capitals and OPTIONAL inside a line, code and code comments ("// TODO"), "TBD" inside a sentence ("the date is TBD"), and blanks under a heading that names a template ("## Template", "# Sample letter") are not reported. Nor are a field label of a form that the document fills in on another line (【氏名】 followed by a name), the caption beside a line to write on ("________ [Name of New Employer]"), and a blank inside a quoted example ("Helpful: “See the link [insert link name] below the image”"). Nor is a Japanese example mark (○○) inside a sentence or outside a business document.'
46
+ ja: "文の中で例として置いた「○○」とビジネス文書以外の「○○」、行頭の「○」(箇条書きの印)、Markdown のリンク、脚注の番号、チェック欄とチェックリストの項目(- [ ] TODO: …)、値が続く見出しの札(【氏名】山田)、大文字でない「Optional:」と行の途中の OPTIONAL、コードとコードのコメント(// TODO)、文の中の「未定」(日程は未定です)、見出しが雛形と言う節(「## 雛形」「# 記入例」)の中の空欄、文書がほかの行で値を書き入れている書式の欄の名前(【氏名】 山田 花子 とある文書の「【氏名】に旧氏を書く」)、記入線の横の札(____ [Name of New Employer])、例を示す行のかぎ括弧の中(例:「【会社名】の田中です」)も指しません。英語の括弧は、Name や Date で終わっても、語の頭がみな大文字の二語から四語でなければ指しません(編者の補い [the defendant's name]、注記 [sic])。"
47
+ en: 'Markdown links and reference definitions, footnote numbers, checkboxes and checklist items ("- [ ] TODO: …"), a label its value follows ("[Date]: 2024-04-01"), "Optional:" not in capitals and OPTIONAL inside a line, code and code comments ("// TODO"), "TBD" inside a sentence ("the date is TBD"), and blanks under a heading that names a template ("## Template", "# Sample letter") are not reported. Nor are a field label of a form that the document fills in on another line (【氏名】 followed by a name), the caption beside a line to write on ("________ [Name of New Employer]"), and a blank inside a quoted example ("Helpful: “See the link [insert link name] below the image”"). Nor is a Japanese example mark (○○) inside a sentence or outside a business document. A bracket ending in "Name" or "Date" counts only as two to four capitalised words ("[Candidate Name]"), so an editor''s insertion ("[the defendant''s name]") and a note ("[sic]") are not reported.'
@@ -56,4 +56,4 @@ not_flagged:
56
56
  en: A superlative with its comparison or scope in the same sentence ("in our range", "than last year", "the fastest in the industry") is not reported, nor is one limited by a clause ("the best we have measured"), nor one inside quotation marks, which are someone else's words, nor one inside a set phrase ("even the best", "in the best case", "make the most of", "the most recent", "the most common"), nor one in a question, nor one inside a condition ("If spreadsheet formulas are the most prolific government code, …"). A superlative that is sought or chosen rather than claimed ("to achieve the best results", "before deciding the best way", "start with the most important tasks") is not reported, nor one whose predicate points at a member of a set ("the best plan is the one you keep") or puts it in an order ("the most critical vulnerabilities are addressed first"), nor one whose noun names a part of a whole ("the most important part", "the most important role"), nor one whose set follows its noun ("the best thing about this event", "the most common form of debunking", "the most important tool for creating the culture").
57
57
  level_meaning:
58
58
  ja: 比べる相手のない最上級が {limit} 箇所あれば指摘
59
- en: reported once there are {limit} such claims
59
+ en: reported once there {limit|is|are} {limit} {limit|such claim|such claims}
@@ -50,8 +50,8 @@ example:
50
50
  This agreement is between Harbour Ltd (the "Seller") and Hill Ltd (the "Buyer"). The Seller ships within five days.
51
51
 
52
52
  not_flagged:
53
- ja: 定義の条(「X」とは…をいう)で定義した語は、前で使っても言いません。定義の条は文書の頭にも終わりにも置く書き方があるためです。規約やポリシーの丁寧な形(以下「X」といいます)も、法令の形と同じに読みます。見出しの行(章・節の行、条の前の「(買主の義務)」のような見出し)の語と、漢字で終わる語にさらに漢字が続く長い語(「監査委員会」の「監査委員」)と、定義の括弧の前の長い名前をそのまま書いた所(「…作成の手引き(以下「手引き」という。)」より前の「…作成の手引き」)は、使った所に数えません。最初の一か所だけを指します。別の語を定義する括弧の前の名前の中(This Services Agreement (this "Agreement") の Services、本サービス利用契約(以下「本契約」という。)の本サービス)も、使った所に数えません。目次・索引の行(目次の見出しの下の項目、一行に詰めた目次、定義した語と条の番地の一覧)と、条の番号の後ろの題(Section 1.1 Closing.)と、番号と語の終わりに条の番地の括弧を添えただけの札((1)文化芸術推進基本計画(第7条関係))と、語を含むもっと長い名前(定義の括弧の前の名前を前で写した株式会社みなと、もっと長い定義した語、Navistar Financial Corporation)も数えません。文書自身の名前と定義した語に同じ頭を付けた所(この就業規則(以下「規則」)より前の「この規則」)と、すぐ後ろの括弧に定義の長い名前を書き添えた所は、読み手に分かるので言いません。要約の節(「要旨」「裁判要旨」「Summary」のような見出しの下)で、定義がその節の外にある語と、番号と題だけの項目の行((2)本件仮換地の指定等)は、本文を縮めたり名前を付けたりした所なので数えません。番地や法令の名前に続けて語の意味の出どころを書いた所(69条の3所定の小規模宅地等)も数えません。「はじめに」「序論」の節は後の本文が定義することを先に名指す所なので、要約の節と同じに読みます。他の法令を引き写した節(見出しがその法令の名前で、文書がほかでその法令を引いている)の条の中の定義は、その法令の定義で、この文書の語の定義としては読みません。英語の語を大文字の長い名前の終わりに書いた所(The National Security Act of 1947)より後ろの the Act は、その名前を指すので数えません。
54
- en: Terms defined in a definitions clause ("X" means ...) are not checked, since a definitions clause may come first or last. A heading line (a chapter or section line, or the caption above an article) does not count as a use, nor does a longer word that runs on in kanji past a term ending in kanji, nor an earlier copy of the long name written just before the definition's bracket. The polite Japanese form (以下「X」といいます) is read like the statute form. Only the first early use is pointed at. A word inside the name written right before another term's defining bracket (Services in This Services Agreement (this "Agreement")) is not a use either. Nor are contents and index lines (the items under a contents heading, a table of contents or a list of defined terms and section numbers packed on one line), a caption after a section number (Section 1.1 Closing.), a label of a number and the term ending in a bracketed section reference ((a) Seller (Section 2)), or a longer name that holds the term, such as an earlier copy of the name before the bracket (Board of Directors before our Board of Directors ("Board")), a longer defined term, a capitalised name ending in it (Navistar Financial Corporation). The document naming itself (this Agreement before (this "Agreement")) and a use followed by the long name in brackets are clear to the reader and not pointed at. A use in a summary section (under a heading such as Summary, Syllabus or 裁判要旨) of a term defined outside it, and a numbered line that only names the section below ((2) Interim Land Designation) summarise or name the body, so they are not uses either. An introduction (a heading that is the whole of Introduction, Preface or Foreword) names ahead what the body defines and is read like a summary. A definition inside an article copied from another statute (under a heading that names a document the text cites elsewhere) is that statute's, not this document's. After a longer capitalised name ending in the term (The National Security Act of 1947), "the Act" points back to that name and is not an early use.
53
+ ja: 定義の条(「X」とは…をいう)で定義した語は、前で使っても言いません。定義の条は文書の頭にも終わりにも置く書き方があるためです。規約やポリシーの丁寧な形(以下「X」といいます)も、法令の形と同じに読みます。見出しの行(章・節の行、条の前の「(買主の義務)」のような見出し)の語と、漢字で終わる語にさらに漢字が続く長い語(「監査委員会」の「監査委員」)と、定義の括弧の前の長い名前をそのまま書いた所(「…作成の手引き(以下「手引き」という。)」より前の「…作成の手引き」)は、使った所に数えません。最初の一か所だけを指します。別の語を定義する括弧の前の名前の中(This Services Agreement (this "Agreement") の Services、本サービス利用契約(以下「本契約」という。)の本サービス)も、使った所に数えません。目次・索引の行(目次の見出しの下の項目、一行に詰めた目次、定義した語と条の番地の一覧)と、条の番号の後ろの題(Section 1.1 Closing.)と、番号と語の終わりに条の番地の括弧を添えただけの札((1)文化芸術推進基本計画(第7条関係))と、語を含むもっと長い名前(定義の括弧の前の名前を前で写した株式会社みなと、もっと長い定義した語、Navistar Financial Corporation)も数えません。文書自身の名前と定義した語に同じ頭を付けた所(この就業規則(以下「規則」)より前の「この規則」)と、すぐ後ろの括弧に定義の長い名前を書き添えた所は、読み手に分かるので言いません。要約の節(「要旨」「裁判要旨」「Summary」のような見出しの下)で、定義がその節の外にある語と、番号と題だけの項目の行((2)本件仮換地の指定等)は、本文を縮めたり名前を付けたりした所なので数えません。番地や法令の名前に続けて語の意味の出どころを書いた所(69条の3所定の小規模宅地等)も数えません。「はじめに」「序論」の節は後の本文が定義することを先に名指す所なので、要約の節と同じに読みます。他の法令を引き写した節(見出しがその法令の名前で、文書がほかでその法令を引いている)の条の中の定義は、その法令の定義で、この文書の語の定義としては読みません。英語の語を大文字の長い名前の終わりに書いた所(The National Security Act of 1947)より後ろの the Act は、その名前を指すので数えません。一字の漢字の語は、当事者の呼び名(甲・乙・丙・丁)だけを探します。「法」「令」のような一字の語はふつうの語としても書くためです。
54
+ en: Terms defined in a definitions clause ("X" means ...) are not checked, since a definitions clause may come first or last. A heading line (a chapter or section line, or the caption above an article) does not count as a use, nor does a longer word that runs on in kanji past a term ending in kanji, nor an earlier copy of the long name written just before the definition's bracket. The polite Japanese form (以下「X」といいます) is read like the statute form. Only the first early use is pointed at. A word inside the name written right before another term's defining bracket (Services in This Services Agreement (this "Agreement")) is not a use either. Nor are contents and index lines (the items under a contents heading, a table of contents or a list of defined terms and section numbers packed on one line), a caption after a section number (Section 1.1 Closing.), a label of a number and the term ending in a bracketed section reference ((a) Seller (Section 2)), or a longer name that holds the term, such as an earlier copy of the name before the bracket (Board of Directors before our Board of Directors ("Board")), a longer defined term, a capitalised name ending in it (Navistar Financial Corporation). The document naming itself (this Agreement before (this "Agreement")) and a use followed by the long name in brackets are clear to the reader and not pointed at. A use in a summary section (under a heading such as Summary, Syllabus or 裁判要旨) of a term defined outside it, and a numbered line that only names the section below ((2) Interim Land Designation) summarise or name the body, so they are not uses either. An introduction (a heading that is the whole of Introduction, Preface or Foreword) names ahead what the body defines and is read like a summary. A definition inside an article copied from another statute (under a heading that names a document the text cites elsewhere) is that statute's, not this document's. After a longer capitalised name ending in the term (The National Security Act of 1947), "the Act" points back to that name and is not an early use. A Japanese term of a single kanji is checked only when it is a party's short name (甲, 乙, 丙, 丁); other single-kanji words such as 法 are also written in their everyday sense.
55
55
  rewrite:
56
56
  depth: structure
57
57
  ja:
@@ -57,7 +57,7 @@ not_flagged:
57
57
  en: 'A few vague words for the document''s length are not reported, and very short documents are not measured. Each sentence is reported once, and a word inside a longer phrase ("timely" in "in a timely manner") counts once. In legal documents, a word inside a term that law and practice define ("reasonable", "best efforts", "from time to time") is not counted; nor are the security duties data-protection law writes ("appropriate technical and organisational measures", "appropriate administrative, physical, and technical safeguards"), while a bare "appropriate measures" is counted. Inside a requirement, requirement-smell also reads "where possible" and "as needed". A word that the bracket right after it pins down ("a reasonable fee (USD 50)") is not counted either; a bracket that only names it ("(hereinafter the ""Fee"")") pins nothing down. Lines under a table of contents heading (the sections'' names) are not counted, and "reasonable accommodation" is the name of a legal duty in any genre. A word that a law or a section governs right after it ("as required by applicable law", "as required under 45 CFR §164.528", "as required under HIPAA") is not counted, since that law says what is required; one a party decides ("as required by Licensor") is.'
58
58
  level_meaning:
59
59
  ja: 1000 字あたりあいまいな語 {limit} 個まで
60
- en: up to {limit} vague words per 1000 words
60
+ en: up to {limit} {limit|vague word|vague words} per 1000 words
61
61
  rewrite:
62
62
  depth: light
63
63
  ja:
@@ -53,7 +53,7 @@ not_flagged:
53
53
  en: Only the phrases on chaff's list are checked. A citation right after the phrase does not silence it, since the sentence can name the study itself. In Japanese, 研究によると and 専門家によると, which often follow their source, are checked only as ある・最近の・多くの forms, と言われる only as と言われている (not よく言われる, which mostly talks about the saying itself), and 一般的に alone is not checked. Nor is a quotation reported as told on an occasion or by a named sayer (申し込んだら、「…」と言われています, 業者から「…」と言われている), since someone did say it.
54
54
  level_meaning:
55
55
  ja: 当てはまる言い回しが {limit} 箇所あれば指摘
56
- en: reported once there are {limit}
56
+ en: reported once there {limit|is|are} {limit}
57
57
  rewrite:
58
58
  depth: light
59
59
  ja:
@@ -47,7 +47,7 @@ not_flagged:
47
47
  en: 'A non-restrictive clause set off by a comma ("the rule, which we added,"), "which" after a preposition ("in which"), a "that" followed by its own subject ("the report that we wrote", "the fact that it works"), a document where the usual form appears fewer than 3 times, and one where the fewer form passes the level (used on purpose) are not reported. Text inside quotation marks (single ones too, ‘…’, even over several sentences) and block quotations (a > paragraph, a paragraph opening with a bracketed alteration such as [T]he, or one that goes on in lowercase after a paragraph left without a full stop) keep the quoted text''s wording and are not counted.'
48
48
  level_meaning:
49
49
  ja: 少ないほうの書き方が {limit} 箇所以下のとき指摘
50
- en: reported when the fewer form appears {limit} times or fewer
50
+ en: reported when the fewer form appears {limit} {limit|time|times} or fewer
51
51
 
52
52
  rewrite:
53
53
  depth: light
@@ -53,7 +53,7 @@ not_flagged:
53
53
  en: Only the phrases on chaff's list are checked. Phrases that contracts and statutes use on purpose ("with regard to", "prior to", "in accordance with") are not on it, nor is "at all times", which states the scope of a rule ("pets must be on a leash at all times"). In Japanese, することができる, ordinary in human writing, and 必要性, which a noun phrase may need, are left out; translationese (を可能にする) is translationese-density's and 〜を行う is nominalization's.
54
54
  level_meaning:
55
55
  ja: 回りくどい言い回しを含む文が {limit} 文あれば指摘
56
- en: reported once {limit} sentences hold one
56
+ en: reported once {limit} {limit|sentence holds|sentences hold} one
57
57
  rewrite:
58
58
  depth: light
59
59
  ja:
@@ -125,7 +125,28 @@ const pointsAhead = (sentence: string, phrase: Phrase, anchors: readonly string[
125
125
  const lowered = anchors.map((anchor) => anchor.toLowerCase());
126
126
  if (!phrase.counted) return lowered.some((anchor) => endsWithWord(before.trimEnd(), anchor));
127
127
  if (lowered.some((anchor) => before.includes(anchor))) return true;
128
- return COLON_END.test(sentence.trimEnd()) && !number.test(sentence.slice(phrase.end));
128
+ const after = sentence.slice(phrase.end);
129
+ return COLON_END.test(sentence.trimEnd()) && !number.test(after) && !inEarlierClause(after.toLowerCase(), lowered);
130
+ };
131
+
132
+ /** 句切りの読点やコンマ。「3点、以下の」の読点は数のすぐ後ろで、手前に語が無いので、数を前の節に閉じ込めない。 */
133
+ const CLAUSE_MARK = /[、,,]/u;
134
+ const WRITTEN = /\S/u;
135
+
136
+ /** 読点やコンマのどれかの手前(一つ前の読点から)に語がある。 */
137
+ const hasClauseBreak = (text: string): boolean =>
138
+ text
139
+ .split(CLAUSE_MARK)
140
+ .slice(0, -1)
141
+ .some((part) => WRITTEN.test(part));
142
+
143
+ /**
144
+ * 数の後ろに先を指す語があり、その手前で一度節が切れる(二人に聞いて分かった、困っていたことは以下のとおり)。
145
+ * 先を指す語が予告するのは後ろの節の語で、前の節の数(聞いた人数)は並べるものの数ではない。
146
+ */
147
+ const inEarlierClause = (after: string, anchors: readonly string[]): boolean => {
148
+ const anchorAt = Math.min(...anchors.map((anchor) => after.indexOf(anchor)).filter((at) => at >= 0));
149
+ return Number.isFinite(anchorAt) && hasClauseBreak(after.slice(0, anchorAt));
129
150
  };
130
151
 
131
152
  /**
@@ -44,6 +44,12 @@ export const namesInOrder = (tokens: readonly Token[], joiners: ReadonlySet<stri
44
44
  return runs.flatMap((run) => memberOf(run, source) ?? []);
45
45
  };
46
46
 
47
+ /** 語のすぐ後ろの区切り(動作環境は、Windows と macOS)は一覧の始まりの前に置いた読点で、名前の区切りではない。 */
48
+ const afterLeadingJoiner = (tokens: readonly Token[], joiners: ReadonlySet<string>): readonly Token[] => {
49
+ const first = tokens[0];
50
+ return first !== undefined && first.pos === "PUNCT" && isJoiner(first, joiners) ? tokens.slice(1) : tokens;
51
+ };
52
+
47
53
  /** 一覧の語の、一つの現れから読んだ名前。before の語は後ろの名前を、after の語は前の名前を読む。 */
48
54
  const membersAt = (
49
55
  tokens: readonly Token[],
@@ -54,7 +60,7 @@ const membersAt = (
54
60
  ): ListMember[] =>
55
61
  entry.position === "after"
56
62
  ? namesInOrder(tokens.slice(0, range.start).toReversed(), joiners, source).toReversed()
57
- : namesInOrder(tokens.slice(range.end), joiners, source);
63
+ : namesInOrder(afterLeadingJoiner(tokens.slice(range.end), joiners), joiners, source);
58
64
 
59
65
  /** 一覧を読む言葉。frames は一覧を言う語、joiners は名前をつなぐ語、negations は打ち消しの語、ordinals は序数の語(小文字)。 */
60
66
  export type ListWords = {
package/src/cli.ts CHANGED
@@ -50,7 +50,8 @@ import { notRunAmong } from "./not-run.ts";
50
50
  import { settingProblems } from "./setting-problems.ts";
51
51
  import { withExtensions } from "./extension/load.ts";
52
52
  import { offOnlyAsExperimental } from "./experimental-alone.ts";
53
- import { levelFor } from "./run.ts";
53
+ import { genreStop, levelFor } from "./run.ts";
54
+ import { REASONS } from "./reasons.ts";
54
55
  import { DEFAULT_GENRE } from "./init-choice.ts";
55
56
  import { stoppingOnYamlFileError } from "./config/yaml-file.ts";
56
57
 
@@ -239,7 +240,8 @@ const explain = (config: Config, ruleId: string | undefined, genreFlag: string |
239
240
  const preset = genre === undefined ? {} : presetLevels(genre);
240
241
  const current = levelFor(rule, config.rules, config.experimental, preset);
241
242
  const alone = offOnlyAsExperimental(rule, config, genre ?? DEFAULT_GENRE, preset, language);
242
- console.log(renderExplain(rule, current, language, genre, { ...settingSourcesOf(config, rule.id, language), offOnlyAsExperimental: alone }));
243
+ const stop = genre === undefined ? undefined : genreStop(rule, config.rules, preset, genre, REASONS[uiLanguageOf(language)]);
244
+ console.log(renderExplain(rule, current, language, genre, { ...settingSourcesOf(config, rule.id, language), offOnlyAsExperimental: alone, genreStop: stop }));
243
245
  return 0;
244
246
  };
245
247
 
@@ -1,4 +1,13 @@
1
- import type { Finding } from "./plugin.ts";
1
+ import type { Finding, RuleDefinition } from "./plugin.ts";
2
+ import { localized } from "./render/text.ts";
3
+
4
+ /** The signals as a reader knows them: each rule's name in the language, its id where no rule of that id is loaded. */
5
+ export const signalNames = (ids: readonly string[], rules: readonly Pick<RuleDefinition, "id" | "name">[], language: string): string[] =>
6
+ ids.map((id) => {
7
+ const name = rules.find((rule) => rule.id === id)?.name;
8
+ const words = name === undefined ? "" : localized(name, language);
9
+ return words === "" ? id : words;
10
+ });
2
11
 
3
12
  /** A finding that adds up measures names here the rules that read the same shapes as some of them (ai-structure). */
4
13
  export const SAME_SHAPE_VALUE = "same_shape_rules";
@@ -1,4 +1,4 @@
1
- import type { Detector, Finding, Sentence, Token } from "../plugin.ts";
1
+ import type { Detector, Finding, Lexicon, Sentence, Token } from "../plugin.ts";
2
2
 
3
3
  /**
4
4
  * 受動のまま動作主を書かないと、誰がしたのかが文から消える。
@@ -11,13 +11,57 @@ import type { Detector, Finding, Sentence, Token } from "../plugin.ts";
11
11
  */
12
12
  const isPassive = (token: Token): boolean => token.features?.["Voice"] === "Pass";
13
13
 
14
- const hasAgent = (sentence: Sentence, markers: readonly string[]): boolean => markers.some((marker) => sentence.text.includes(marker));
14
+ /** 起点の語(から)と、数のすぐ後ろで時を言う単位(月、時)。どちらも語彙表の group で受け取る。 */
15
+ const SOURCE_GROUP = "source";
16
+ const TIME_GROUP = "time";
17
+
18
+ type AgentWords = { readonly markers: readonly string[]; readonly sources: readonly string[]; readonly timeUnits: readonly string[] };
19
+
20
+ const patternsOf = (lexicon: Lexicon, group: string | undefined): string[] => lexicon.filter((entry) => entry.group === group).map((entry) => entry.pattern);
21
+
22
+ const agentWordsOf = (lexicon: Lexicon): AgentWords => ({
23
+ markers: patternsOf(lexicon, undefined),
24
+ sources: patternsOf(lexicon, SOURCE_GROUP),
25
+ timeUnits: patternsOf(lexicon, TIME_GROUP),
26
+ });
27
+
28
+ /** 時の語: 副詞のように使う名詞(来月、本日)か、数のすぐ後ろの時の単位(4月、10時)。 */
29
+ const isTime = (tokens: readonly Token[], at: number, timeUnits: readonly string[]): boolean => {
30
+ const token = tokens[at];
31
+ if (token === undefined) return false;
32
+ if (token.features?.["Adverbial"] === "Yes") return true;
33
+ return timeUnits.includes(token.surface) && tokens[at - 1]?.features?.["NumType"] === "Card";
34
+ };
35
+
36
+ /** 起点の語のうち、すぐ前が時の語でないもの(部長から)。来月から、4月1日からは時の起点で、した人を言わない。 */
37
+ const namesSource = (tokens: readonly Token[], { sources, timeUnits }: AgentWords): boolean =>
38
+ tokens.some((token, at) => sources.includes(token.surface) && at > 0 && !isTime(tokens, at - 1, timeUnits));
39
+
40
+ const hasAgent = (sentence: Sentence, words: AgentWords): boolean =>
41
+ words.markers.some((marker) => sentence.text.includes(marker)) || namesSource(sentence.tokens ?? [], words);
42
+
43
+ const isLightVerb = (token: Token | undefined): boolean => token?.pos === "VERB" && token.features?.["VerbType"] === "Light";
44
+ const isVerbalNoun = (token: Token | undefined): boolean => token?.pos === "NOUN" && token.features?.["VerbForm"] === "Vnoun";
45
+ const touches = (left: Token | undefined, right: Token | undefined): boolean => left !== undefined && right !== undefined && left.span.end === right.span.start;
46
+
47
+ /** 受け身の印のすぐ前に続けて書いた動詞の始まり(送ら れ、決定 さ れ)。印が動詞そのもの(reviewed)なら印の位置。 */
48
+ const verbStart = (tokens: readonly Token[], at: number): number => {
49
+ const before = tokens[at - 1];
50
+ if (!touches(before, tokens[at]) || before?.pos !== "VERB") return at;
51
+ return isLightVerb(before) && isVerbalNoun(tokens[at - 2]) && touches(tokens[at - 2], before) ? at - 2 : at - 1;
52
+ };
53
+
54
+ /** 指摘が引く受け身の語。印だけ(れ)では読み手に何の受け身かが分からないので、動詞から引く(決定され)。 */
55
+ const passiveVerb = (source: string, tokens: readonly Token[], passive: Token): string => {
56
+ const start = tokens[verbStart(tokens, tokens.indexOf(passive))]?.span.start ?? passive.span.start;
57
+ return source.slice(start, passive.span.end);
58
+ };
15
59
 
16
60
  export const agentlessPassive: Detector = (doc, options): Finding[] => {
17
- const markers = (options.lexicon ?? []).map((entry) => entry.pattern);
61
+ const words = agentWordsOf(options.lexicon ?? []);
18
62
  return doc.sentences
19
63
  .map((sentence) => ({ sentence, passives: (sentence.tokens ?? []).filter(isPassive) }))
20
- .filter(({ sentence, passives }) => passives.length >= options.limit && !hasAgent(sentence, markers))
64
+ .filter(({ sentence, passives }) => passives.length >= options.limit && !hasAgent(sentence, words))
21
65
  .map(({ sentence, passives }) => ({
22
66
  rule: "agentless-passive",
23
67
  severity: "warning",
@@ -27,7 +71,7 @@ export const agentlessPassive: Detector = (doc, options): Finding[] => {
27
71
  values: {
28
72
  count: passives.length,
29
73
  limit: options.limit,
30
- word: passives.map((token) => token.surface).join(" "),
74
+ word: passives.map((token) => passiveVerb(doc.source, sentence.tokens ?? [], token)).join(" "),
31
75
  offset: passives[0]?.span.start ?? sentence.span.start,
32
76
  },
33
77
  }));
@@ -26,6 +26,8 @@ export type AgreementLists = {
26
26
  readonly afterArticle: ReadonlySet<string>;
27
27
  /** 名詞句を目的語に取る前置詞(on / of)。この後ろの this / these は主語にならない。 */
28
28
  readonly prepositions?: ReadonlySet<string>;
29
+ /** homophone-slip が言う組(their are)。その規則が正しい語まで言うので、ここでは数えない。 */
30
+ readonly homophones?: ReadonlySet<string>;
29
31
  };
30
32
 
31
33
  export type Slip = { readonly variant: "number" | "possessive" | "determiner"; readonly first: Token; readonly last: Token; readonly word: string };
@@ -42,6 +44,8 @@ const CLOSING_MARK = new Set([".", ";", ":", "?", "!", ")"]);
42
44
  */
43
45
  const PHRASE_END = new Set(["AUX", "ADP", "SCONJ", "PRON", "DET", "ADV"]);
44
46
  const PREDICATE_TAIL = new Set(["DET", "ADJ", "PRON", "NUM"]);
47
+ /** 所有の印('s / ')。不変化詞のうち、これだけが名詞を重ねた語の途中(a children's book)。to や not は名詞句の外。 */
48
+ const POSSESSIVE_MARK = /^['’]/u;
45
49
 
46
50
  const lower = (token: Token): string => token.surface.toLowerCase();
47
51
 
@@ -54,6 +58,7 @@ const isPlural = (token: Token): boolean => token.features?.["Number"] === "Plur
54
58
  /** 名詞の後ろの語で、名詞句が終わるか。分詞(a data driven approach)も名詞を重ねた語の途中。 */
55
59
  export const endsNounPhrase = (next: Token | undefined, finite: ReadonlySet<string>): boolean => {
56
60
  if (next === undefined || finite.has(lower(next))) return true;
61
+ if (next.pos === "PART") return !POSSESSIVE_MARK.test(next.surface);
57
62
  return next.pos === "PUNCT" ? CLOSING_MARK.has(next.surface) : PHRASE_END.has(next.pos);
58
63
  };
59
64
 
@@ -128,7 +133,8 @@ const mayBeNoun = (token: Token): boolean => token.features?.["AlsoNoun"] === "Y
128
133
  /**
129
134
  * 名詞が動詞にも読め(works)、その前に名詞句の頭になれる語があれば、限定詞と名詞ではなく主語と動詞かもしれない。
130
135
  * an individual works(individual は名詞にもなる)/ Those responsible report to the board(those は代名詞にもなる)。
131
- * 後ろが is / has なら、名詞は動詞ではない(these key result is)。
136
+ * 後ろが is / has なら、名詞は動詞ではない(these key result is)。後ろが to なら、解析器が動詞と知らない語も動詞かもしれない
137
+ * (every key maps to an array の maps)。
132
138
  */
133
139
  const mayBeVerb = (
134
140
  determiner: Determiner,
@@ -138,7 +144,7 @@ const mayBeVerb = (
138
144
  finite: ReadonlySet<string>,
139
145
  bound: boolean,
140
146
  ): boolean =>
141
- noun.features?.["AlsoVerb"] === "Yes" &&
147
+ (noun.features?.["AlsoVerb"] === "Yes" || next?.pos === "PART") &&
142
148
  !(next !== undefined && finite.has(lower(next))) &&
143
149
  ((standsAlone(determiner) && !bound) || modifiers.some(mayBeNoun));
144
150
 
@@ -188,7 +194,8 @@ const possessiveSlipAt = (source: string, tokens: readonly Token[], at: number,
188
194
  const auxiliary = verb.pos === "AUX" && isBaseVerb(tokens[at + 2]) && !isNounAfterPreposition(tokens, at);
189
195
  const verbal = LOWER.test(verb.surface) && (lists.finite.has(lower(verb)) || auxiliary);
190
196
  if (!verbal || !joinedBySpace(source, [possessive, verb]) || isPartOfLongerWord(source, possessive, verb)) return undefined;
191
- return slipOf("possessive", source, possessive, verb);
197
+ const slip = slipOf("possessive", source, possessive, verb);
198
+ return lists.homophones?.has(slip.word.toLowerCase()) === true ? undefined : slip;
192
199
  };
193
200
 
194
201
  /** ones of the most。前に限定詞・形容詞・代名詞があれば、ones は代名詞(the ones of the most use)。 */
@@ -236,6 +243,7 @@ const listsOf = (lexicons: Readonly<Record<string, Lexicon>>): AgreementLists =>
236
243
  misnumbered: lexicons["misnumbered-phrase"] ?? [],
237
244
  afterArticle: setOf(lexicons["determiner-after-article"]),
238
245
  prepositions: setOf(lexicons["object-preposition"]),
246
+ homophones: setOf(lexicons["homophone-slip"]),
239
247
  });
240
248
 
241
249
  export const agreementSlip: Detector = (doc): Finding[] => {
@@ -4,7 +4,7 @@ import type { Detector, Finding, Lexicon, ProseDocument } from "../plugin.ts";
4
4
  import { escapeRegExp } from "../orthography.ts";
5
5
  import { amountValue, scaleMixes, withoutRoundTextFigures, type ScaleWord, type ScaledAmount } from "../structure/amount-scale.ts";
6
6
  import { AMOUNT, amountsIn, formsOf, type WrittenAmount } from "./currency-notation.ts";
7
- import { quoteAround } from "./quote-around.ts";
7
+ import { quoteAround, sentenceQuoteAt } from "./quote-around.ts";
8
8
  import { proseAndTablesOf } from "../table-text.ts";
9
9
 
10
10
  /** How far back a larger part of one amount may start (1億2,000万円 is read from 2,000万円). */
@@ -90,7 +90,7 @@ export const amountScale: Detector = (doc): Finding[] => {
90
90
  severity: "info",
91
91
  line: 0,
92
92
  column: 0,
93
- quote: quoteAround(text, odd.offset, odd.offset + odd.written.length),
93
+ quote: sentenceQuoteAt(doc.sentences, odd.offset) ?? quoteAround(text, odd.offset, odd.offset + odd.written.length),
94
94
  values: { written: odd.written.trim(), usual: usual.written.trim(), offset: odd.offset },
95
95
  }));
96
96
  };
@@ -2,9 +2,7 @@ import type { Detector, Finding, Lexicon, ProseDocument, Span } from "../plugin.
2
2
  import { escapeRegExp } from "../orthography.ts";
3
3
  import { isQuotedAlone } from "../quoted-span.ts";
4
4
  import { findingAt, markupOf } from "./markup-finding.ts";
5
-
6
- /** One marker a chat interface leaves when its answer is pasted: where it is and what was written. */
7
- export type ChatMarker = { readonly matched: string; readonly span: Span };
5
+ import { wholeMarks, type ChatMarker } from "./chat-mark-extent.ts";
8
6
 
9
7
  /** Every place a lexicon pattern is written in `text`, case and all, in the order they appear. */
10
8
  export const markersIn = (text: string, lexicon: Lexicon): ChatMarker[] =>
@@ -69,9 +67,10 @@ export const standsAlone = (source: string, span: Span): boolean => {
69
67
  return withoutSurrounding(`${before}${marker}${after}`) === marker;
70
68
  };
71
69
 
72
- /** Each marker is a leftover in its own right, so each is reported, from the first. */
70
+ /** Each mark is a leftover in its own right, so each is reported once, whole, from the first. */
73
71
  export const chatCitationResidue: Detector = (doc, options): Finding[] => {
74
- const markers = markersIn(doc.source, options.lexicon ?? []).filter((marker) => reachesReader(doc, marker.span) && !standsAlone(doc.source, marker.span));
72
+ const found = markersIn(doc.source, options.lexicon ?? []).filter((marker) => reachesReader(doc, marker.span) && !standsAlone(doc.source, marker.span));
73
+ const markers = wholeMarks(doc.source, found);
75
74
  if (markers.length === 0 || markers.length < options.limit) return [];
76
75
  return markers.map((marker) => findingAt(doc, marker.span, { matched: marker.matched, count: markers.length, limit: options.limit }));
77
76
  };
@@ -0,0 +1,63 @@
1
+ import type { Span } from "../plugin.ts";
2
+
3
+ /** One marker a chat interface leaves when its answer is pasted: where it is and what was written. */
4
+ export type ChatMarker = { readonly matched: string; readonly span: Span };
5
+
6
+ const CLOSING_OF: Readonly<Record<string, string>> = { "[": "]", "【": "】" };
7
+ const OPENING_OF: Readonly<Record<string, string>> = { "]": "[", "】": "【" };
8
+ const LEAD_IN = ":";
9
+
10
+ const lineEndAfter = (source: string, index: number): number => {
11
+ const end = source.indexOf("\n", index);
12
+ return end === -1 ? source.length : end;
13
+ };
14
+
15
+ /** Where the bracket opened at `open` closes on its line (just after the closer), or undefined when it does not. */
16
+ const closedAt = (source: string, open: number): number | undefined => {
17
+ const closer = CLOSING_OF[source[open] ?? ""];
18
+ if (closer === undefined) return undefined;
19
+ const close = source.indexOf(closer, open + 1);
20
+ return close === -1 || close >= lineEndAfter(source, open) ? undefined : close + 1;
21
+ };
22
+
23
+ /** A marker that opens a bracket (contentReference[) runs to its closer and any {…} right after it. */
24
+ const forwardEnd = (source: string, span: Span): number => {
25
+ const opened = span.end - 1;
26
+ const closed = CLOSING_OF[source[opened] ?? ""] === undefined ? undefined : closedAt(source, opened);
27
+ const end = closed ?? span.end;
28
+ return source[end] === "{" ? (closedBraceAt(source, end) ?? end) : end;
29
+ };
30
+
31
+ const closedBraceAt = (source: string, open: number): number | undefined => {
32
+ const close = source.indexOf("}", open + 1);
33
+ return close === -1 || close >= lineEndAfter(source, open) ? undefined : close + 1;
34
+ };
35
+
36
+ /** A marker that closes a bracket it did not open (†source】) starts where that bracket opens on its line. */
37
+ const backwardStart = (source: string, span: Span): number => {
38
+ const written = source.slice(span.start, span.end);
39
+ const opener = OPENING_OF[written.at(-1) ?? ""];
40
+ if (opener === undefined || written.includes(opener)) return span.start;
41
+ const lineStart = source.lastIndexOf("\n", span.start - 1) + 1;
42
+ const open = source.lastIndexOf(opener, span.start - 1);
43
+ return open < lineStart ? span.start : open;
44
+ };
45
+
46
+ /** The whole mark a marker belongs to as written (:contentReference[oaicite:0]{index=0}, 【4:0†source】). */
47
+ export const markExtent = (source: string, span: Span): Span => {
48
+ const start = backwardStart(source, span);
49
+ const end = forwardEnd(source, span);
50
+ const widened = end > span.end || start < span.start;
51
+ return { start: widened && source[start - 1] === LEAD_IN ? start - 1 : start, end };
52
+ };
53
+
54
+ /** One marker per mark: each widened to its whole mark, and the markers inside a mark already taken dropped. */
55
+ export const wholeMarks = (source: string, markers: readonly ChatMarker[]): ChatMarker[] =>
56
+ markers
57
+ .map((marker) => markExtent(source, marker.span))
58
+ .toSorted((left, right) => left.start - right.start || right.end - left.end)
59
+ .reduce<Span[]>((kept, span) => {
60
+ const last = kept.at(-1);
61
+ return last !== undefined && span.start < last.end ? kept : [...kept, span];
62
+ }, [])
63
+ .map((span) => ({ matched: source.slice(span.start, span.end), span }));
@@ -41,13 +41,11 @@ const occurrencesOf = (text: string, word: string): Span[] =>
41
41
  }));
42
42
 
43
43
  /**
44
- * prefer の「使わない書き方」が動詞のとき、活用した形の始まり(文の中の字の位置)。「使う書き方」の中に出たものは除く。
44
+ * prefer の「使わない書き方」が動詞のとき、活用した形の範囲(文の中の字の位置)。「使う書き方」の中に出たものは除く。
45
45
  * 大文字小文字だけ違う組(Javascript・JavaScript)は語で照らすと区別が消えるので、字で探す側に任せる。
46
46
  */
47
- export const conjugatedStartsOutside = (sentence: Sentence, entry: LexiconEntry, use: string): number[] => {
47
+ export const conjugatedSpansOutside = (sentence: Sentence, entry: LexiconEntry, use: string): Span[] => {
48
48
  if (entry.pattern.toLowerCase() === use.toLowerCase()) return [];
49
49
  const covered = occurrencesOf(sentence.text, use);
50
- return conjugatedSpans(sentence, entry)
51
- .filter((span) => !covered.some((cover) => cover.start <= span.start && span.end <= cover.end))
52
- .map((span) => span.start);
50
+ return conjugatedSpans(sentence, entry).filter((span) => !covered.some((cover) => cover.start <= span.start && span.end <= cover.end));
53
51
  };
@@ -1,4 +1,4 @@
1
- import type { Lexicon, LexiconEntry, Sentence } from "../plugin.ts";
1
+ import type { Lexicon, LexiconEntry, Sentence, Token } from "../plugin.ts";
2
2
  import { escapeRegExp } from "../orthography.ts";
3
3
  import { comparableText, comparableWords, entryCloses, entryIn, entryOpens, entryRanges } from "./lexicon-match.ts";
4
4
 
@@ -67,6 +67,41 @@ const opensWithWord = (sentence: Sentence, entry: LexiconEntry): boolean => {
67
67
  const nextAffirms = (next: Sentence | undefined, words: ContrastWords): boolean =>
68
68
  next !== undefined && groupOf(words.turns, ACROSS).some((turn) => opensWithWord(next, turn)) && !words.leads.some((lead) => entryIn(next, lead));
69
69
 
70
+ const ECHO = "echo";
71
+ const VERBAL: ReadonlySet<string> = new Set(["VERB", "AUX"]);
72
+ const SKIPPED: ReadonlySet<string> = new Set(["ADV", "PART"]);
73
+
74
+ const lemmaOf = (token: Token): string => comparableWords(token.lemma ?? token.surface);
75
+
76
+ /** The verb a denial denies: the verb right after it (didn't build → build), or its own (weren't → be). */
77
+ const deniedVerb = (sentence: Sentence, lead: LexiconEntry): string | undefined => {
78
+ const tokens = sentence.tokens ?? [];
79
+ const range = entryRanges(sentence, lead)[0];
80
+ if (range === undefined) return undefined;
81
+ const next = tokens.slice(range.end).find((token) => !SKIPPED.has(token.pos));
82
+ const own = tokens.slice(range.start, range.end).find((token) => VERBAL.has(token.pos));
83
+ const verb = next?.pos === "VERB" ? next : own;
84
+ return verb === undefined ? undefined : lemmaOf(verb);
85
+ };
86
+
87
+ /** The verb right after the subject that opens the sentence (We built → build). */
88
+ const affirmedVerb = (sentence: Sentence): string | undefined => {
89
+ const verb = (sentence.tokens ?? []).slice(1).find((token) => !SKIPPED.has(token.pos));
90
+ return verb !== undefined && VERBAL.has(verb.pos) ? lemmaOf(verb) : undefined;
91
+ };
92
+
93
+ /**
94
+ * A denial whose own subject (We, You) opens the next sentence and says the denied verb again, without a denial
95
+ * (We didn't build this for speed. We built it for teams.). Another verb is the story going on (We didn't have backups. We lost the data.).
96
+ */
97
+ const echoAffirms = (sentence: Sentence, lead: LexiconEntry, next: Sentence | undefined, words: ContrastWords): boolean => {
98
+ if (next === undefined || sentence.tokens === undefined || next.tokens === undefined) return false;
99
+ if (words.leads.some((other) => entryIn(next, other))) return false;
100
+ const subject = groupOf(words.turns, ECHO).find((turn) => opensWithWord(sentence, turn) && opensWithWord(next, turn));
101
+ const denied = subject === undefined ? undefined : deniedVerb(sentence, lead);
102
+ return denied !== undefined && denied === affirmedVerb(next);
103
+ };
104
+
70
105
  const AFTER = "after";
71
106
  const DIGIT_AFTER = /^\p{Nd}/u;
72
107
  /** 数字と、続く助数詞一字(1回、2つ)。 */
@@ -94,7 +129,7 @@ const framesIn = (sentence: Sentence, frame: LexiconEntry, amounts: Lexicon): bo
94
129
  const closesWithTurn = (sentence: Sentence, words: ContrastWords): boolean => groupOf(words.turns, CLOSING).some((turn) => entryCloses(sentence, turn));
95
130
 
96
131
  const answeredBy = (lead: LexiconEntry, sentence: Sentence, next: Sentence | undefined, words: ContrastWords): boolean => {
97
- if (lead.group === ACROSS) return nextAffirms(next, words);
132
+ if (lead.group === ACROSS) return nextAffirms(next, words) || echoAffirms(sentence, lead, next, words);
98
133
  if (lead.group === CLOSING) return closesWithTurn(sentence, words);
99
134
  return turnAfter(sentence, lead, words) || nextTurns(next, words);
100
135
  };