chaffjs 0.30.0 → 0.31.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 (530) hide show
  1. package/dist/announced-count.d.ts +2 -0
  2. package/dist/announced-count.d.ts.map +1 -1
  3. package/dist/announced-count.js +4 -3
  4. package/dist/announced-count.js.map +1 -1
  5. package/dist/contacts/addresses.d.ts +21 -0
  6. package/dist/contacts/addresses.d.ts.map +1 -0
  7. package/dist/contacts/addresses.js +144 -0
  8. package/dist/contacts/addresses.js.map +1 -0
  9. package/dist/contacts/emails.d.ts +11 -0
  10. package/dist/contacts/emails.d.ts.map +1 -0
  11. package/dist/contacts/emails.js +51 -0
  12. package/dist/contacts/emails.js.map +1 -0
  13. package/dist/contacts/variants.d.ts +14 -0
  14. package/dist/contacts/variants.d.ts.map +1 -0
  15. package/dist/contacts/variants.js +25 -0
  16. package/dist/contacts/variants.js.map +1 -0
  17. package/dist/derived/battery-runtime.d.ts +85 -0
  18. package/dist/derived/battery-runtime.d.ts.map +1 -0
  19. package/dist/derived/battery-runtime.js +217 -0
  20. package/dist/derived/battery-runtime.js.map +1 -0
  21. package/dist/derived/period-counts.d.ts +48 -0
  22. package/dist/derived/period-counts.d.ts.map +1 -0
  23. package/dist/derived/period-counts.js +128 -0
  24. package/dist/derived/period-counts.js.map +1 -0
  25. package/dist/derived/time-lengths.d.ts.map +1 -1
  26. package/dist/derived/time-lengths.js +12 -9
  27. package/dist/derived/time-lengths.js.map +1 -1
  28. package/dist/derived/use-interval.d.ts +33 -0
  29. package/dist/derived/use-interval.d.ts.map +1 -0
  30. package/dist/derived/use-interval.js +93 -0
  31. package/dist/derived/use-interval.js.map +1 -0
  32. package/dist/detectors/announced-count.d.ts.map +1 -1
  33. package/dist/detectors/announced-count.js +1 -0
  34. package/dist/detectors/announced-count.js.map +1 -1
  35. package/dist/detectors/capacity-runtime.d.ts +7 -0
  36. package/dist/detectors/capacity-runtime.d.ts.map +1 -0
  37. package/dist/detectors/capacity-runtime.js +98 -0
  38. package/dist/detectors/capacity-runtime.js.map +1 -0
  39. package/dist/detectors/contact-variant.d.ts +3 -0
  40. package/dist/detectors/contact-variant.d.ts.map +1 -0
  41. package/dist/detectors/contact-variant.js +21 -0
  42. package/dist/detectors/contact-variant.js.map +1 -0
  43. package/dist/detectors/count-over-capacity.d.ts +4 -0
  44. package/dist/detectors/count-over-capacity.d.ts.map +1 -0
  45. package/dist/detectors/count-over-capacity.js +26 -0
  46. package/dist/detectors/count-over-capacity.js.map +1 -0
  47. package/dist/detectors/date-outside-period.d.ts.map +1 -1
  48. package/dist/detectors/date-outside-period.js +2 -1
  49. package/dist/detectors/date-outside-period.js.map +1 -1
  50. package/dist/detectors/date-stamp-order.d.ts +3 -0
  51. package/dist/detectors/date-stamp-order.d.ts.map +1 -0
  52. package/dist/detectors/date-stamp-order.js +24 -0
  53. package/dist/detectors/date-stamp-order.js.map +1 -0
  54. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  55. package/dist/detectors/defined-term-form.js +57 -7
  56. package/dist/detectors/defined-term-form.js.map +1 -1
  57. package/dist/detectors/definition-use.d.ts +1 -1
  58. package/dist/detectors/definition-use.d.ts.map +1 -1
  59. package/dist/detectors/definition-use.js +4 -2
  60. package/dist/detectors/definition-use.js.map +1 -1
  61. package/dist/detectors/derived-numbers.d.ts +9 -1
  62. package/dist/detectors/derived-numbers.d.ts.map +1 -1
  63. package/dist/detectors/derived-numbers.js +2 -2
  64. package/dist/detectors/derived-numbers.js.map +1 -1
  65. package/dist/detectors/due-date.d.ts.map +1 -1
  66. package/dist/detectors/due-date.js +6 -0
  67. package/dist/detectors/due-date.js.map +1 -1
  68. package/dist/detectors/en-shape.d.ts.map +1 -1
  69. package/dist/detectors/en-shape.js +7 -4
  70. package/dist/detectors/en-shape.js.map +1 -1
  71. package/dist/detectors/event-deadline.d.ts +3 -0
  72. package/dist/detectors/event-deadline.d.ts.map +1 -0
  73. package/dist/detectors/event-deadline.js +24 -0
  74. package/dist/detectors/event-deadline.js.map +1 -0
  75. package/dist/detectors/fact-consistency.d.ts +1 -1
  76. package/dist/detectors/fact-consistency.d.ts.map +1 -1
  77. package/dist/detectors/fact-consistency.js +52 -3
  78. package/dist/detectors/fact-consistency.js.map +1 -1
  79. package/dist/detectors/heading-case.d.ts +5 -2
  80. package/dist/detectors/heading-case.d.ts.map +1 -1
  81. package/dist/detectors/heading-case.js +12 -4
  82. package/dist/detectors/heading-case.js.map +1 -1
  83. package/dist/detectors/heading-echo.d.ts +5 -0
  84. package/dist/detectors/heading-echo.d.ts.map +1 -1
  85. package/dist/detectors/heading-echo.js +14 -1
  86. package/dist/detectors/heading-echo.js.map +1 -1
  87. package/dist/detectors/layout-code.d.ts +5 -0
  88. package/dist/detectors/layout-code.d.ts.map +1 -0
  89. package/dist/detectors/layout-code.js +124 -0
  90. package/dist/detectors/layout-code.js.map +1 -0
  91. package/dist/detectors/measured-facts.d.ts +8 -0
  92. package/dist/detectors/measured-facts.d.ts.map +1 -0
  93. package/dist/detectors/measured-facts.js +18 -0
  94. package/dist/detectors/measured-facts.js.map +1 -0
  95. package/dist/detectors/name-variant-model-codes.d.ts +11 -0
  96. package/dist/detectors/name-variant-model-codes.d.ts.map +1 -0
  97. package/dist/detectors/name-variant-model-codes.js +21 -0
  98. package/dist/detectors/name-variant-model-codes.js.map +1 -0
  99. package/dist/detectors/name-variant.d.ts.map +1 -1
  100. package/dist/detectors/name-variant.js +25 -4
  101. package/dist/detectors/name-variant.js.map +1 -1
  102. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  103. package/dist/detectors/orthographic-variant.js +62 -7
  104. package/dist/detectors/orthographic-variant.js.map +1 -1
  105. package/dist/detectors/orthography.d.ts.map +1 -1
  106. package/dist/detectors/orthography.js +12 -6
  107. package/dist/detectors/orthography.js.map +1 -1
  108. package/dist/detectors/quantity-range.d.ts +3 -0
  109. package/dist/detectors/quantity-range.d.ts.map +1 -0
  110. package/dist/detectors/quantity-range.js +35 -0
  111. package/dist/detectors/quantity-range.js.map +1 -0
  112. package/dist/detectors/range-band.d.ts +5 -0
  113. package/dist/detectors/range-band.d.ts.map +1 -0
  114. package/dist/detectors/range-band.js +80 -0
  115. package/dist/detectors/range-band.js.map +1 -0
  116. package/dist/detectors/registry/capacity-runtime-mismatch.d.ts +3 -0
  117. package/dist/detectors/registry/capacity-runtime-mismatch.d.ts.map +1 -0
  118. package/dist/detectors/registry/capacity-runtime-mismatch.js +3 -0
  119. package/dist/detectors/registry/capacity-runtime-mismatch.js.map +1 -0
  120. package/dist/detectors/registry/contact-variant.d.ts +3 -0
  121. package/dist/detectors/registry/contact-variant.d.ts.map +1 -0
  122. package/dist/detectors/registry/contact-variant.js +3 -0
  123. package/dist/detectors/registry/contact-variant.js.map +1 -0
  124. package/dist/detectors/registry/count-over-capacity.d.ts +3 -0
  125. package/dist/detectors/registry/count-over-capacity.d.ts.map +1 -0
  126. package/dist/detectors/registry/count-over-capacity.js +3 -0
  127. package/dist/detectors/registry/count-over-capacity.js.map +1 -0
  128. package/dist/detectors/registry/date-stamp-order.d.ts +3 -0
  129. package/dist/detectors/registry/date-stamp-order.d.ts.map +1 -0
  130. package/dist/detectors/registry/date-stamp-order.js +3 -0
  131. package/dist/detectors/registry/date-stamp-order.js.map +1 -0
  132. package/dist/detectors/registry/event-deadline.d.ts +3 -0
  133. package/dist/detectors/registry/event-deadline.d.ts.map +1 -0
  134. package/dist/detectors/registry/event-deadline.js +3 -0
  135. package/dist/detectors/registry/event-deadline.js.map +1 -0
  136. package/dist/detectors/registry/interval-count-mismatch.d.ts +3 -0
  137. package/dist/detectors/registry/interval-count-mismatch.d.ts.map +1 -0
  138. package/dist/detectors/registry/interval-count-mismatch.js +3 -0
  139. package/dist/detectors/registry/interval-count-mismatch.js.map +1 -0
  140. package/dist/detectors/registry/layout-code-mismatch.d.ts +3 -0
  141. package/dist/detectors/registry/layout-code-mismatch.d.ts.map +1 -0
  142. package/dist/detectors/registry/layout-code-mismatch.js +3 -0
  143. package/dist/detectors/registry/layout-code-mismatch.js.map +1 -0
  144. package/dist/detectors/registry/quantity-range.d.ts +3 -0
  145. package/dist/detectors/registry/quantity-range.d.ts.map +1 -0
  146. package/dist/detectors/registry/quantity-range.js +3 -0
  147. package/dist/detectors/registry/quantity-range.js.map +1 -0
  148. package/dist/detectors/registry/range-band-mismatch.d.ts +3 -0
  149. package/dist/detectors/registry/range-band-mismatch.d.ts.map +1 -0
  150. package/dist/detectors/registry/range-band-mismatch.js +3 -0
  151. package/dist/detectors/registry/range-band-mismatch.js.map +1 -0
  152. package/dist/detectors/registry/rent-multiple-mismatch.d.ts +3 -0
  153. package/dist/detectors/registry/rent-multiple-mismatch.d.ts.map +1 -0
  154. package/dist/detectors/registry/rent-multiple-mismatch.js +3 -0
  155. package/dist/detectors/registry/rent-multiple-mismatch.js.map +1 -0
  156. package/dist/detectors/registry/scaled-quantity-mismatch.d.ts +3 -0
  157. package/dist/detectors/registry/scaled-quantity-mismatch.d.ts.map +1 -0
  158. package/dist/detectors/registry/scaled-quantity-mismatch.js +3 -0
  159. package/dist/detectors/registry/scaled-quantity-mismatch.js.map +1 -0
  160. package/dist/detectors/registry/step-time-sum-mismatch.d.ts +3 -0
  161. package/dist/detectors/registry/step-time-sum-mismatch.d.ts.map +1 -0
  162. package/dist/detectors/registry/step-time-sum-mismatch.js +3 -0
  163. package/dist/detectors/registry/step-time-sum-mismatch.js.map +1 -0
  164. package/dist/detectors/registry/time-range-reversed.d.ts +3 -0
  165. package/dist/detectors/registry/time-range-reversed.d.ts.map +1 -0
  166. package/dist/detectors/registry/time-range-reversed.js +3 -0
  167. package/dist/detectors/registry/time-range-reversed.js.map +1 -0
  168. package/dist/detectors/registry/unlisted-item-used.d.ts +3 -0
  169. package/dist/detectors/registry/unlisted-item-used.d.ts.map +1 -0
  170. package/dist/detectors/registry/unlisted-item-used.js +3 -0
  171. package/dist/detectors/registry/unlisted-item-used.js.map +1 -0
  172. package/dist/detectors/registry/walk-time-distance-mismatch.d.ts +3 -0
  173. package/dist/detectors/registry/walk-time-distance-mismatch.d.ts.map +1 -0
  174. package/dist/detectors/registry/walk-time-distance-mismatch.js +3 -0
  175. package/dist/detectors/registry/walk-time-distance-mismatch.js.map +1 -0
  176. package/dist/detectors/rent-multiple-mismatch.d.ts +3 -0
  177. package/dist/detectors/rent-multiple-mismatch.d.ts.map +1 -0
  178. package/dist/detectors/rent-multiple-mismatch.js +39 -0
  179. package/dist/detectors/rent-multiple-mismatch.js.map +1 -0
  180. package/dist/detectors/scaled-quantity.d.ts +3 -0
  181. package/dist/detectors/scaled-quantity.d.ts.map +1 -0
  182. package/dist/detectors/scaled-quantity.js +37 -0
  183. package/dist/detectors/scaled-quantity.js.map +1 -0
  184. package/dist/detectors/signals.d.ts.map +1 -1
  185. package/dist/detectors/signals.js +3 -1
  186. package/dist/detectors/signals.js.map +1 -1
  187. package/dist/detectors/step-time-sum.d.ts +3 -0
  188. package/dist/detectors/step-time-sum.d.ts.map +1 -0
  189. package/dist/detectors/step-time-sum.js +46 -0
  190. package/dist/detectors/step-time-sum.js.map +1 -0
  191. package/dist/detectors/structure-tree.d.ts +2 -0
  192. package/dist/detectors/structure-tree.d.ts.map +1 -1
  193. package/dist/detectors/structure-tree.js +22 -5
  194. package/dist/detectors/structure-tree.js.map +1 -1
  195. package/dist/detectors/structure.js +1 -1
  196. package/dist/detectors/structure.js.map +1 -1
  197. package/dist/detectors/technical-docs.d.ts +5 -0
  198. package/dist/detectors/technical-docs.d.ts.map +1 -1
  199. package/dist/detectors/technical-docs.js +12 -0
  200. package/dist/detectors/technical-docs.js.map +1 -1
  201. package/dist/detectors/time-order.d.ts +1 -0
  202. package/dist/detectors/time-order.d.ts.map +1 -1
  203. package/dist/detectors/time-order.js +3 -1
  204. package/dist/detectors/time-order.js.map +1 -1
  205. package/dist/detectors/unit-consistency.d.ts +1 -1
  206. package/dist/detectors/unit-consistency.d.ts.map +1 -1
  207. package/dist/detectors/unit-consistency.js +46 -38
  208. package/dist/detectors/unit-consistency.js.map +1 -1
  209. package/dist/detectors/unlisted-items.d.ts +3 -0
  210. package/dist/detectors/unlisted-items.d.ts.map +1 -0
  211. package/dist/detectors/unlisted-items.js +57 -0
  212. package/dist/detectors/unlisted-items.js.map +1 -0
  213. package/dist/detectors/use-count-words.d.ts +8 -0
  214. package/dist/detectors/use-count-words.d.ts.map +1 -0
  215. package/dist/detectors/use-count-words.js +20 -0
  216. package/dist/detectors/use-count-words.js.map +1 -0
  217. package/dist/detectors/use-interval.d.ts +3 -0
  218. package/dist/detectors/use-interval.d.ts.map +1 -0
  219. package/dist/detectors/use-interval.js +39 -0
  220. package/dist/detectors/use-interval.js.map +1 -0
  221. package/dist/detectors/walk-time-distance-mismatch.d.ts +4 -0
  222. package/dist/detectors/walk-time-distance-mismatch.d.ts.map +1 -0
  223. package/dist/detectors/walk-time-distance-mismatch.js +38 -0
  224. package/dist/detectors/walk-time-distance-mismatch.js.map +1 -0
  225. package/dist/facts/approximate-tolerance.d.ts +7 -0
  226. package/dist/facts/approximate-tolerance.d.ts.map +1 -0
  227. package/dist/facts/approximate-tolerance.js +16 -0
  228. package/dist/facts/approximate-tolerance.js.map +1 -0
  229. package/dist/facts/item-amounts.d.ts +18 -0
  230. package/dist/facts/item-amounts.d.ts.map +1 -0
  231. package/dist/facts/item-amounts.js +67 -0
  232. package/dist/facts/item-amounts.js.map +1 -0
  233. package/dist/facts/labelled-facts.d.ts +4 -0
  234. package/dist/facts/labelled-facts.d.ts.map +1 -1
  235. package/dist/facts/labelled-facts.js +21 -6
  236. package/dist/facts/labelled-facts.js.map +1 -1
  237. package/dist/facts/measure-units.d.ts +5 -0
  238. package/dist/facts/measure-units.d.ts.map +1 -0
  239. package/dist/facts/measure-units.js +28 -0
  240. package/dist/facts/measure-units.js.map +1 -0
  241. package/dist/facts/measures.d.ts +23 -4
  242. package/dist/facts/measures.d.ts.map +1 -1
  243. package/dist/facts/measures.js +68 -19
  244. package/dist/facts/measures.js.map +1 -1
  245. package/dist/facts/retention-periods.d.ts +51 -0
  246. package/dist/facts/retention-periods.d.ts.map +1 -0
  247. package/dist/facts/retention-periods.js +148 -0
  248. package/dist/facts/retention-periods.js.map +1 -0
  249. package/dist/facts/unit-conflicts.d.ts +3 -2
  250. package/dist/facts/unit-conflicts.d.ts.map +1 -1
  251. package/dist/facts/unit-conflicts.js +15 -7
  252. package/dist/facts/unit-conflicts.js.map +1 -1
  253. package/dist/facts/unit-equivalents.d.ts +13 -0
  254. package/dist/facts/unit-equivalents.d.ts.map +1 -0
  255. package/dist/facts/unit-equivalents.js +56 -0
  256. package/dist/facts/unit-equivalents.js.map +1 -0
  257. package/dist/facts/unit-tolerance.d.ts +4 -0
  258. package/dist/facts/unit-tolerance.d.ts.map +1 -0
  259. package/dist/facts/unit-tolerance.js +13 -0
  260. package/dist/facts/unit-tolerance.js.map +1 -0
  261. package/dist/facts/unit-word.d.ts +8 -0
  262. package/dist/facts/unit-word.d.ts.map +1 -0
  263. package/dist/facts/unit-word.js +34 -0
  264. package/dist/facts/unit-word.js.map +1 -0
  265. package/dist/facts/written-precision.d.ts +10 -0
  266. package/dist/facts/written-precision.d.ts.map +1 -0
  267. package/dist/facts/written-precision.js +20 -0
  268. package/dist/facts/written-precision.js.map +1 -0
  269. package/dist/kana-spelling.d.ts +12 -0
  270. package/dist/kana-spelling.d.ts.map +1 -1
  271. package/dist/kana-spelling.js +23 -0
  272. package/dist/kana-spelling.js.map +1 -1
  273. package/dist/model-codes.d.ts +23 -0
  274. package/dist/model-codes.d.ts.map +1 -0
  275. package/dist/model-codes.js +81 -0
  276. package/dist/model-codes.js.map +1 -0
  277. package/dist/name-spelling-chars.d.ts +16 -0
  278. package/dist/name-spelling-chars.d.ts.map +1 -0
  279. package/dist/name-spelling-chars.js +14 -0
  280. package/dist/name-spelling-chars.js.map +1 -0
  281. package/dist/name-variants.d.ts +3 -2
  282. package/dist/name-variants.d.ts.map +1 -1
  283. package/dist/name-variants.js +4 -7
  284. package/dist/name-variants.js.map +1 -1
  285. package/dist/phone-numbers.d.ts.map +1 -1
  286. package/dist/phone-numbers.js +22 -5
  287. package/dist/phone-numbers.js.map +1 -1
  288. package/dist/place-names.d.ts +12 -5
  289. package/dist/place-names.d.ts.map +1 -1
  290. package/dist/place-names.js +34 -14
  291. package/dist/place-names.js.map +1 -1
  292. package/dist/plugin.d.ts +5 -0
  293. package/dist/plugin.d.ts.map +1 -1
  294. package/dist/preamble-paragraphs.d.ts +2 -1
  295. package/dist/preamble-paragraphs.d.ts.map +1 -1
  296. package/dist/preamble-paragraphs.js +16 -1
  297. package/dist/preamble-paragraphs.js.map +1 -1
  298. package/dist/profile/parse.d.ts.map +1 -1
  299. package/dist/profile/parse.js +11 -0
  300. package/dist/profile/parse.js.map +1 -1
  301. package/dist/spacing-code.d.ts +6 -0
  302. package/dist/spacing-code.d.ts.map +1 -0
  303. package/dist/spacing-code.js +16 -0
  304. package/dist/spacing-code.js.map +1 -0
  305. package/dist/structure/amount-range.d.ts +2 -2
  306. package/dist/structure/amount-range.d.ts.map +1 -1
  307. package/dist/structure/amount-range.js +12 -5
  308. package/dist/structure/amount-range.js.map +1 -1
  309. package/dist/structure/capacity-count.d.ts +59 -0
  310. package/dist/structure/capacity-count.d.ts.map +1 -0
  311. package/dist/structure/capacity-count.js +118 -0
  312. package/dist/structure/capacity-count.js.map +1 -0
  313. package/dist/structure/counted-amounts.d.ts +6 -0
  314. package/dist/structure/counted-amounts.d.ts.map +1 -1
  315. package/dist/structure/counted-amounts.js +4 -4
  316. package/dist/structure/counted-amounts.js.map +1 -1
  317. package/dist/structure/date-outside-period.d.ts +3 -1
  318. package/dist/structure/date-outside-period.d.ts.map +1 -1
  319. package/dist/structure/date-outside-period.js +8 -5
  320. package/dist/structure/date-outside-period.js.map +1 -1
  321. package/dist/structure/date-range.d.ts +1 -0
  322. package/dist/structure/date-range.d.ts.map +1 -1
  323. package/dist/structure/date-range.js +1 -1
  324. package/dist/structure/date-range.js.map +1 -1
  325. package/dist/structure/deadline-after-event.d.ts +23 -0
  326. package/dist/structure/deadline-after-event.d.ts.map +1 -0
  327. package/dist/structure/deadline-after-event.js +42 -0
  328. package/dist/structure/deadline-after-event.js.map +1 -0
  329. package/dist/structure/definition-use.d.ts +1 -1
  330. package/dist/structure/definition-use.d.ts.map +1 -1
  331. package/dist/structure/definition-use.js +55 -2
  332. package/dist/structure/definition-use.js.map +1 -1
  333. package/dist/structure/due-date.d.ts.map +1 -1
  334. package/dist/structure/due-date.js +5 -27
  335. package/dist/structure/due-date.js.map +1 -1
  336. package/dist/structure/labelled-date-order.d.ts +38 -0
  337. package/dist/structure/labelled-date-order.d.ts.map +1 -0
  338. package/dist/structure/labelled-date-order.js +41 -0
  339. package/dist/structure/labelled-date-order.js.map +1 -0
  340. package/dist/structure/layout-codes.d.ts +68 -0
  341. package/dist/structure/layout-codes.d.ts.map +1 -0
  342. package/dist/structure/layout-codes.js +161 -0
  343. package/dist/structure/layout-codes.js.map +1 -0
  344. package/dist/structure/measured-amounts.d.ts +17 -0
  345. package/dist/structure/measured-amounts.d.ts.map +1 -0
  346. package/dist/structure/measured-amounts.js +110 -0
  347. package/dist/structure/measured-amounts.js.map +1 -0
  348. package/dist/structure/quantity-range.d.ts +8 -0
  349. package/dist/structure/quantity-range.d.ts.map +1 -0
  350. package/dist/structure/quantity-range.js +36 -0
  351. package/dist/structure/quantity-range.js.map +1 -0
  352. package/dist/structure/range-bands.d.ts +75 -0
  353. package/dist/structure/range-bands.d.ts.map +1 -0
  354. package/dist/structure/range-bands.js +244 -0
  355. package/dist/structure/range-bands.js.map +1 -0
  356. package/dist/structure/rent-multiple.d.ts +76 -0
  357. package/dist/structure/rent-multiple.d.ts.map +1 -0
  358. package/dist/structure/rent-multiple.js +186 -0
  359. package/dist/structure/rent-multiple.js.map +1 -0
  360. package/dist/structure/scaled-quantities.d.ts +50 -0
  361. package/dist/structure/scaled-quantities.d.ts.map +1 -0
  362. package/dist/structure/scaled-quantities.js +153 -0
  363. package/dist/structure/scaled-quantities.js.map +1 -0
  364. package/dist/structure/stamp-order.d.ts +16 -0
  365. package/dist/structure/stamp-order.d.ts.map +1 -0
  366. package/dist/structure/stamp-order.js +78 -0
  367. package/dist/structure/stamp-order.js.map +1 -0
  368. package/dist/structure/step-times.d.ts +49 -0
  369. package/dist/structure/step-times.d.ts.map +1 -0
  370. package/dist/structure/step-times.js +128 -0
  371. package/dist/structure/step-times.js.map +1 -0
  372. package/dist/structure/term-deadline.d.ts +19 -0
  373. package/dist/structure/term-deadline.d.ts.map +1 -0
  374. package/dist/structure/term-deadline.js +28 -0
  375. package/dist/structure/term-deadline.js.map +1 -0
  376. package/dist/structure/time-range.d.ts +16 -0
  377. package/dist/structure/time-range.d.ts.map +1 -0
  378. package/dist/structure/time-range.js +57 -0
  379. package/dist/structure/time-range.js.map +1 -0
  380. package/dist/structure/total-line.d.ts +16 -0
  381. package/dist/structure/total-line.d.ts.map +1 -0
  382. package/dist/structure/total-line.js +44 -0
  383. package/dist/structure/total-line.js.map +1 -0
  384. package/dist/structure/total.d.ts +7 -1
  385. package/dist/structure/total.d.ts.map +1 -1
  386. package/dist/structure/total.js +28 -5
  387. package/dist/structure/total.js.map +1 -1
  388. package/dist/structure/unlisted-items.d.ts +70 -0
  389. package/dist/structure/unlisted-items.d.ts.map +1 -0
  390. package/dist/structure/unlisted-items.js +152 -0
  391. package/dist/structure/unlisted-items.js.map +1 -0
  392. package/dist/structure/walk-time.d.ts +87 -0
  393. package/dist/structure/walk-time.d.ts.map +1 -0
  394. package/dist/structure/walk-time.js +195 -0
  395. package/dist/structure/walk-time.js.map +1 -0
  396. package/package.json +3 -3
  397. package/profiles/listing.yaml +20 -0
  398. package/rules/announced-count-mismatch.yaml +2 -2
  399. package/rules/capacity-runtime-mismatch.yaml +66 -0
  400. package/rules/contact-variant.yaml +76 -0
  401. package/rules/count-over-capacity.yaml +55 -0
  402. package/rules/date-outside-period.yaml +4 -4
  403. package/rules/date-stamp-order.yaml +82 -0
  404. package/rules/deadline-after-event.yaml +67 -0
  405. package/rules/defined-name-repeated.yaml +2 -2
  406. package/rules/due-before-issue.yaml +11 -7
  407. package/rules/fact-conflict.yaml +9 -4
  408. package/rules/heading-echo.yaml +2 -2
  409. package/rules/interval-count-mismatch.yaml +54 -0
  410. package/rules/latin-spacing.yaml +2 -2
  411. package/rules/layout-code-mismatch.yaml +68 -0
  412. package/rules/name-variant.yaml +8 -2
  413. package/rules/no-em-dash.yaml +2 -2
  414. package/rules/preamble-length.yaml +2 -2
  415. package/rules/quantity-range-reversed.yaml +53 -0
  416. package/rules/range-band-mismatch.yaml +70 -0
  417. package/rules/rent-multiple-mismatch.yaml +61 -0
  418. package/rules/scaled-quantity-mismatch.yaml +69 -0
  419. package/rules/step-time-sum-mismatch.yaml +65 -0
  420. package/rules/time-range-reversed.yaml +48 -0
  421. package/rules/title-case-consistency.yaml +2 -2
  422. package/rules/total-mismatch.yaml +2 -2
  423. package/rules/unit-mismatch.yaml +12 -4
  424. package/rules/unlisted-item-used.yaml +90 -0
  425. package/rules/unused-definition.yaml +2 -2
  426. package/rules/use-before-definition.yaml +2 -2
  427. package/rules/walk-time-distance-mismatch.yaml +55 -0
  428. package/src/announced-count.ts +6 -3
  429. package/src/contacts/addresses.ts +179 -0
  430. package/src/contacts/emails.ts +63 -0
  431. package/src/contacts/variants.ts +33 -0
  432. package/src/derived/battery-runtime.ts +284 -0
  433. package/src/derived/period-counts.ts +178 -0
  434. package/src/derived/time-lengths.ts +12 -9
  435. package/src/derived/use-interval.ts +151 -0
  436. package/src/detectors/announced-count.ts +1 -0
  437. package/src/detectors/capacity-runtime.ts +128 -0
  438. package/src/detectors/contact-variant.ts +24 -0
  439. package/src/detectors/count-over-capacity.ts +37 -0
  440. package/src/detectors/date-outside-period.ts +2 -1
  441. package/src/detectors/date-stamp-order.ts +28 -0
  442. package/src/detectors/defined-term-form.ts +63 -7
  443. package/src/detectors/definition-use.ts +6 -2
  444. package/src/detectors/derived-numbers.ts +3 -3
  445. package/src/detectors/due-date.ts +10 -2
  446. package/src/detectors/en-shape.ts +11 -4
  447. package/src/detectors/event-deadline.ts +29 -0
  448. package/src/detectors/fact-consistency.ts +64 -3
  449. package/src/detectors/heading-case.ts +13 -4
  450. package/src/detectors/heading-echo.ts +17 -1
  451. package/src/detectors/layout-code.ts +174 -0
  452. package/src/detectors/measured-facts.ts +20 -0
  453. package/src/detectors/name-variant-model-codes.ts +27 -0
  454. package/src/detectors/name-variant.ts +32 -6
  455. package/src/detectors/orthographic-variant.ts +78 -9
  456. package/src/detectors/orthography.ts +16 -6
  457. package/src/detectors/quantity-range.ts +47 -0
  458. package/src/detectors/range-band.ts +125 -0
  459. package/src/detectors/registry/capacity-runtime-mismatch.ts +4 -0
  460. package/src/detectors/registry/contact-variant.ts +4 -0
  461. package/src/detectors/registry/count-over-capacity.ts +4 -0
  462. package/src/detectors/registry/date-stamp-order.ts +4 -0
  463. package/src/detectors/registry/event-deadline.ts +4 -0
  464. package/src/detectors/registry/interval-count-mismatch.ts +4 -0
  465. package/src/detectors/registry/layout-code-mismatch.ts +4 -0
  466. package/src/detectors/registry/quantity-range.ts +4 -0
  467. package/src/detectors/registry/range-band-mismatch.ts +4 -0
  468. package/src/detectors/registry/rent-multiple-mismatch.ts +4 -0
  469. package/src/detectors/registry/scaled-quantity-mismatch.ts +4 -0
  470. package/src/detectors/registry/step-time-sum-mismatch.ts +4 -0
  471. package/src/detectors/registry/time-range-reversed.ts +4 -0
  472. package/src/detectors/registry/unlisted-item-used.ts +4 -0
  473. package/src/detectors/registry/walk-time-distance-mismatch.ts +4 -0
  474. package/src/detectors/rent-multiple-mismatch.ts +56 -0
  475. package/src/detectors/scaled-quantity.ts +49 -0
  476. package/src/detectors/signals.ts +3 -1
  477. package/src/detectors/step-time-sum.ts +55 -0
  478. package/src/detectors/structure-tree.ts +30 -5
  479. package/src/detectors/structure.ts +1 -1
  480. package/src/detectors/technical-docs.ts +12 -0
  481. package/src/detectors/time-order.ts +5 -1
  482. package/src/detectors/unit-consistency.ts +50 -38
  483. package/src/detectors/unlisted-items.ts +72 -0
  484. package/src/detectors/use-count-words.ts +32 -0
  485. package/src/detectors/use-interval.ts +51 -0
  486. package/src/detectors/walk-time-distance-mismatch.ts +45 -0
  487. package/src/facts/approximate-tolerance.ts +19 -0
  488. package/src/facts/item-amounts.ts +94 -0
  489. package/src/facts/labelled-facts.ts +29 -7
  490. package/src/facts/measure-units.ts +31 -0
  491. package/src/facts/measures.ts +113 -25
  492. package/src/facts/retention-periods.ts +216 -0
  493. package/src/facts/unit-conflicts.ts +22 -9
  494. package/src/facts/unit-equivalents.ts +70 -0
  495. package/src/facts/unit-tolerance.ts +17 -0
  496. package/src/facts/unit-word.ts +35 -0
  497. package/src/facts/written-precision.ts +23 -0
  498. package/src/kana-spelling.ts +25 -0
  499. package/src/model-codes.ts +104 -0
  500. package/src/name-spelling-chars.ts +34 -0
  501. package/src/name-variants.ts +8 -7
  502. package/src/phone-numbers.ts +26 -6
  503. package/src/place-names.ts +53 -14
  504. package/src/plugin.ts +2 -0
  505. package/src/preamble-paragraphs.ts +21 -2
  506. package/src/profile/parse.ts +10 -0
  507. package/src/spacing-code.ts +26 -0
  508. package/src/structure/amount-range.ts +16 -7
  509. package/src/structure/capacity-count.ts +196 -0
  510. package/src/structure/counted-amounts.ts +5 -4
  511. package/src/structure/date-outside-period.ts +11 -6
  512. package/src/structure/date-range.ts +1 -1
  513. package/src/structure/deadline-after-event.ts +67 -0
  514. package/src/structure/definition-use.ts +59 -2
  515. package/src/structure/due-date.ts +8 -32
  516. package/src/structure/labelled-date-order.ts +84 -0
  517. package/src/structure/layout-codes.ts +210 -0
  518. package/src/structure/measured-amounts.ts +138 -0
  519. package/src/structure/quantity-range.ts +54 -0
  520. package/src/structure/range-bands.ts +316 -0
  521. package/src/structure/rent-multiple.ts +277 -0
  522. package/src/structure/scaled-quantities.ts +225 -0
  523. package/src/structure/stamp-order.ts +100 -0
  524. package/src/structure/step-times.ts +169 -0
  525. package/src/structure/term-deadline.ts +35 -0
  526. package/src/structure/time-range.ts +64 -0
  527. package/src/structure/total-line.ts +63 -0
  528. package/src/structure/total.ts +41 -6
  529. package/src/structure/unlisted-items.ts +207 -0
  530. package/src/structure/walk-time.ts +285 -0
@@ -0,0 +1,87 @@
1
+ import type { StructureIssue } from "./issues.ts";
2
+ /**
3
+ * 書いた距離と合わない徒歩の分数(駅 徒歩3分(約600m)、a 3-minute walk (600 m))。徒歩の語に付いた分数と、そのすぐ前かすぐ後ろの
4
+ * 距離だけを組にし、文書の速さで歩いた分数と比べる。速さは文書に書いたもの(道路距離80mを1分、80 m per minute、5 km/h)を使い、
5
+ * 書いていなければ呼ぶ側が渡す速さ(文書の種類の速さ。不動産の広告は 80m で1分、切り上げ)を使う。どちらも無ければ速さを推し量らない。
6
+ * 約の付いた距離は、書いた一番下の桁の半分だけ幅を持たせる(約1.2km は 1.15〜1.25km)。小数の距離は書いた桁の半分の幅を持つ。
7
+ * 範囲(5〜7分)、上限(10分以内)、約の付いた分数は比べない。語は言語パッケージの語彙表から受け取る。
8
+ */
9
+ /** 語彙表の一語。position は数のどちら側に書くか。weight は単位の倍率(長さは m、時間は秒)。 */
10
+ export type WalkMark = {
11
+ readonly pattern: string;
12
+ readonly position?: "before" | "after" | undefined;
13
+ readonly weight?: number | undefined;
14
+ };
15
+ export type WalkWords = {
16
+ /** 分数を徒歩の時間にする語(徒歩、walk)。position は分数のどちら側か。 */
17
+ readonly walks: readonly WalkMark[];
18
+ /** 徒歩の語と分数の間に挟んでよい語(徒歩で5分の で)。 */
19
+ readonly gaps: readonly string[];
20
+ /** 分数を上限にする語(以内、within)。position は分数のどちら側か。 */
21
+ readonly bounds: readonly WalkMark[];
22
+ /** 二つの数を範囲にする語(5から7分、8 to 10 minutes)。〜 や - の記号は語彙表に書かなくても読む。 */
23
+ readonly ranges: readonly string[];
24
+ /** 約や上限の語と数の間で読み飛ばす語(about a 5-minute walk の a)。 */
25
+ readonly fillers: readonly string[];
26
+ /** 長さの単位。weight は m への倍率。 */
27
+ readonly lengths: readonly WalkMark[];
28
+ /** 時間の単位。weight は秒への倍率。分より短い単位は分数に使わない。 */
29
+ readonly times: readonly WalkMark[];
30
+ /** 数を概数にする語(約、about)。 */
31
+ readonly hedges: readonly string[];
32
+ /** 長さを速さにする語(を1分、per minute、/h、分速)。weight はその時間の秒。 */
33
+ readonly perTimes: readonly WalkMark[];
34
+ /** 速さの行にあれば、端数を切り上げると言う語(切り上げ、rounded up)。 */
35
+ readonly roundUps: readonly string[];
36
+ /** 速さの行にあれば、切り上げの語があっても切り上げではないと言う語(切り上げません、not rounded up)。 */
37
+ readonly notRoundUps: readonly string[];
38
+ };
39
+ /** 1分に歩く m と、端数の扱い。up は切り上げだけ、any は切り上げでも切り捨てでも合う。 */
40
+ export type WalkRate = {
41
+ readonly metresPerMinute: number;
42
+ readonly rounding: "up" | "any";
43
+ };
44
+ /** 読んだ距離。metres は書いた値、margin は書いた桁から来る幅の半分(m)。 */
45
+ export type Distance = {
46
+ readonly start: number;
47
+ readonly end: number;
48
+ readonly metres: number;
49
+ readonly margin: number;
50
+ };
51
+ /** 徒歩の分数。lead は前に書いた徒歩の語の始まり(徒歩5分 の 徒歩)、後ろに書くなら数の始まり。 */
52
+ type Minutes = {
53
+ readonly start: number;
54
+ readonly end: number;
55
+ readonly lead: number;
56
+ readonly value: number;
57
+ };
58
+ /** 一行の中の、徒歩の分数。範囲、上限、約の付いた分数は読まない。 */
59
+ export declare const walkMinutesIn: (line: string, words: WalkWords) => Minutes[];
60
+ /** 書いた数の桁から来る幅の半分(書いた単位で)。小数は最後の桁、約の付いた整数は最後の 0 でない桁。それ以外は 0。 */
61
+ export declare const marginOf: (digits: string, hedged: boolean) => number;
62
+ /** 一行の中の距離。範囲の片側は読まない。 */
63
+ export declare const distancesIn: (line: string, words: WalkWords) => Distance[];
64
+ /**
65
+ * 分数と組になる距離。すぐ後ろ(徒歩5分(400m))を先に、無ければすぐ前(400m(徒歩5分))を見る。間に置けるのは記号と約の語だけ。
66
+ * 一つの距離は一つの分数とだけ組にする。
67
+ */
68
+ export declare const walkPairs: (line: string, words: WalkWords) => {
69
+ readonly minutes: Minutes;
70
+ readonly distance: Distance;
71
+ }[];
72
+ /** 一行に書いた速さ(m/分)。距離のすぐ後ろ(80mを1分、80 m per minute)かすぐ前(分速80m)に時間の語がある距離。 */
73
+ export declare const ratesIn: (line: string, words: WalkWords) => number[];
74
+ /**
75
+ * 文書の速さ。徒歩の語のある行に書いた速さが一つ(一つの値)だけなら、それを使う。端数は、その行に切り上げの語があれば切り上げだけ、
76
+ * 無ければどちらでもよい。二つ以上の値があれば、どの分数がどれで計ったか決められないので比べない。書いていなければ fallback。
77
+ */
78
+ export declare const statedRate: (source: string, words: WalkWords, fallback?: WalkRate) => WalkRate | undefined;
79
+ /** その距離を歩いて合う分数の幅。margin の幅の上の端は含まない(1.25km は 1.3km と書く)。 */
80
+ export declare const expectedMinutes: (distance: Pick<Distance, "metres" | "margin">, rate: WalkRate) => {
81
+ readonly low: number;
82
+ readonly high: number;
83
+ };
84
+ /** 距離と合わない徒歩の分数。分数の位置を指す。 */
85
+ export declare const walkTimeMismatches: (source: string, words: WalkWords, fallback?: WalkRate) => StructureIssue[];
86
+ export {};
87
+ //# sourceMappingURL=walk-time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walk-time.d.ts","sourceRoot":"","sources":["../../src/structure/walk-time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;GAMG;AAEH,6DAA6D;AAC7D,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG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cAAc,EAoBxG,CAAC"}
@@ -0,0 +1,195 @@
1
+ const DIGIT = "[0-90-9]";
2
+ const NUMBER = new RegExp(`(?<!${DIGIT}|[.,,.])${DIGIT}+(?:[,,]${DIGIT}{3})*(?:[..]${DIGIT}+)?(?!${DIGIT}|[..,,]${DIGIT})`, "gu");
3
+ const LETTER = /[A-Za-z]/u;
4
+ /** 単位のすぐ後ろにあれば、その単位ではない(m のあとの in、㎡ の 2、m² の ²)。 */
5
+ const UNIT_CONTINUES = /^[A-Za-z0-90-9²³]/u;
6
+ /** 数と単位の間に置けるもの(1.2 km、5-minute)。 */
7
+ const NUMBER_UNIT_GAP = /^[ \u00a0-]?/u;
8
+ /** 分数と後ろの徒歩の語の間に置けるもの(5 minutes' walk、5 min. walk)。 */
9
+ const MINUTES_WALK_GAP = /^[\s'’.]*/u;
10
+ /**
11
+ * 分数と距離の間に置けるもの。開き括弧か・か / の一つだけ(徒歩5分(400m)、400m(徒歩5分)、徒歩5分・400m)。
12
+ * 読点では組にしない(標高600m、徒歩3分 の 600m は道のりではない)。
13
+ */
14
+ const PAIR_GAP = /^\s*[(([[【・//]\s*$/u;
15
+ const RANGE_MARKS = ["〜", "~", "~", "–", "—", "-"];
16
+ const DIGIT_START = new RegExp(`^${DIGIT}`, "u");
17
+ const DIGIT_END = new RegExp(`${DIGIT}$`, "u");
18
+ /** 浮動小数の誤差(1150 / 80 など)で切り上げが一つずれないための小さな数。 */
19
+ const EPSILON = 1e-9;
20
+ const MINUTE_SECONDS = 60;
21
+ /** 時速から出した速さ(4km/h は 66.66…m/分)を、言うときに小数一桁にする。 */
22
+ const RATE_DECIMALS = 10;
23
+ const normal = (text) => text.normalize("NFKC").toLowerCase();
24
+ const valueOf = (digits) => Number(digits.normalize("NFKC").replaceAll(",", ""));
25
+ const isWordEdge = (text, at) => !(LETTER.test(text.charAt(at - 1)) && LETTER.test(text.charAt(at)));
26
+ const startsWithWord = (text, word) => normal(text.slice(0, word.length)) === normal(word) && isWordEdge(text, word.length);
27
+ const endsWithWord = (text, word) => text.length >= word.length && normal(text.slice(-word.length)) === normal(word) && isWordEdge(text, text.length - word.length);
28
+ /** 末尾の空白と、読み飛ばす語を除く(about a の a)。 */
29
+ const trimFillers = (text, fillers) => {
30
+ const trimmed = text.trimEnd();
31
+ const filler = fillers.find((word) => endsWithWord(trimmed, word));
32
+ return filler === undefined ? trimmed : trimFillers(trimmed.slice(0, -filler.length), fillers);
33
+ };
34
+ /** 位置 at から始まる単位。㎞ のような一字の単位も NFKC で照らす。長い語から。 */
35
+ const unitAt = (line, at, units) => units
36
+ .toSorted((left, right) => right.pattern.length - left.pattern.length)
37
+ .flatMap((unit) => Array.from({ length: unit.pattern.length }, (_, index) => at + index + 1)
38
+ .filter((end) => normal(line.slice(at, end)) === normal(unit.pattern) && !UNIT_CONTINUES.test(line.slice(end)))
39
+ .map((end) => ({ unit, end })))[0];
40
+ /** 一行の中の、単位の付いた数。 */
41
+ const readingsIn = (line, units) => [...line.matchAll(NUMBER)].flatMap((match) => {
42
+ const numberEnd = match.index + match[0].length;
43
+ const unitStart = numberEnd + (NUMBER_UNIT_GAP.exec(line.slice(numberEnd))?.[0].length ?? 0);
44
+ const found = unitAt(line, unitStart, units);
45
+ return found === undefined ? [] : [{ start: match.index, end: numberEnd, digits: match[0], unit: found.unit, unitEnd: found.end }];
46
+ });
47
+ const endsWithAny = (text, words) => words.some((word) => endsWithWord(text, word));
48
+ /** 範囲の片側の数か(5〜7分 の 7、5分から10分 の 5分、400m〜600m の 400m、8 to 10 minutes の 10)。 */
49
+ const isRangeEnd = (line, reading, units, rangeWords) => {
50
+ const joins = [...RANGE_MARKS, ...rangeWords];
51
+ const after = line.slice(reading.unitEnd).trimStart();
52
+ const next = joins.find((word) => startsWithWord(after, word));
53
+ if (next !== undefined && DIGIT_START.test(after.slice(next.length).trimStart()))
54
+ return true;
55
+ const before = line.slice(0, reading.start).trimEnd();
56
+ const previous = joins.find((word) => endsWithWord(before, word));
57
+ if (previous === undefined)
58
+ return false;
59
+ const left = before.slice(0, -previous.length).trimEnd();
60
+ const unit = units.find((mark) => endsWithWord(left, mark.pattern));
61
+ return DIGIT_END.test(unit === undefined ? left : left.slice(0, -unit.pattern.length).trimEnd());
62
+ };
63
+ /** 数のすぐ前(読み飛ばす語の後ろ)に約の語があるか。 */
64
+ const isHedged = (line, start, words) => endsWithAny(trimFillers(line.slice(0, start).replace(/[(([[]$/u, ""), words.fillers), words.hedges);
65
+ const boundBefore = (prefix, words) => endsWithAny(trimFillers(prefix, words.fillers), words.bounds.filter((bound) => bound.position === "before").map((bound) => bound.pattern));
66
+ const boundAfter = (rest, words) => words.bounds.filter((bound) => bound.position !== "before").some((bound) => startsWithWord(rest.trimStart(), bound.pattern));
67
+ /** 前に書く徒歩の語(徒歩5分、徒歩で5分)。あれば、その語の始まりの位置。 */
68
+ const walkBeforeStart = (prefix, words) => {
69
+ const trimmed = prefix.trimEnd();
70
+ const gap = words.gaps.find((word) => trimmed.endsWith(word));
71
+ const head = gap === undefined ? trimmed : trimmed.slice(0, -gap.length).trimEnd();
72
+ const walk = words.walks.find((mark) => mark.position === "before" && endsWithWord(head, mark.pattern));
73
+ return walk === undefined ? undefined : head.length - walk.pattern.length;
74
+ };
75
+ /** 後ろに書く徒歩の語(a 5-minute walk)。あれば、その語の終わりの位置。 */
76
+ const walkAfterEnd = (line, from, words) => {
77
+ const at = from + (MINUTES_WALK_GAP.exec(line.slice(from))?.[0].length ?? 0);
78
+ const walk = words.walks.find((mark) => mark.position === "after" && startsWithWord(line.slice(at), mark.pattern));
79
+ return walk === undefined ? undefined : at + walk.pattern.length;
80
+ };
81
+ const minuteUnits = (words) => words.times.filter((unit) => (unit.weight ?? 0) >= MINUTE_SECONDS);
82
+ /** 一行の中の、徒歩の分数。範囲、上限、約の付いた分数は読まない。 */
83
+ export const walkMinutesIn = (line, words) => readingsIn(line, minuteUnits(words)).flatMap((reading) => {
84
+ const prefix = line.slice(0, reading.start);
85
+ const leadStart = walkBeforeStart(prefix, words);
86
+ const afterEnd = walkAfterEnd(line, reading.unitEnd, words);
87
+ if (leadStart === undefined && afterEnd === undefined)
88
+ return [];
89
+ if (isRangeEnd(line, reading, words.times, words.ranges) || isHedged(line, reading.start, words))
90
+ return [];
91
+ if (boundBefore(prefix, words) || boundAfter(line.slice(afterEnd ?? reading.unitEnd), words))
92
+ return [];
93
+ const value = (valueOf(reading.digits) * (reading.unit.weight ?? 0)) / MINUTE_SECONDS;
94
+ if (!Number.isInteger(value) || value <= 0)
95
+ return [];
96
+ return [{ start: reading.start, end: afterEnd ?? reading.unitEnd, lead: leadStart ?? reading.start, value }];
97
+ });
98
+ /** 書いた数の桁から来る幅の半分(書いた単位で)。小数は最後の桁、約の付いた整数は最後の 0 でない桁。それ以外は 0。 */
99
+ export const marginOf = (digits, hedged) => {
100
+ const plain = digits.normalize("NFKC").replaceAll(",", "");
101
+ const point = plain.indexOf(".");
102
+ if (point !== -1)
103
+ return 10 ** -(plain.length - point - 1) / 2;
104
+ if (!hedged)
105
+ return 0;
106
+ const lastNonZero = [...plain].findLastIndex((digit) => digit !== "0");
107
+ const zeros = plain.length - 1 - lastNonZero;
108
+ return 10 ** zeros / 2;
109
+ };
110
+ /** 一行の中の距離。範囲の片側は読まない。 */
111
+ export const distancesIn = (line, words) => readingsIn(line, words.lengths)
112
+ .filter((reading) => !isRangeEnd(line, reading, words.lengths, words.ranges))
113
+ .flatMap((reading) => {
114
+ const weight = reading.unit.weight ?? 0;
115
+ const metres = valueOf(reading.digits) * weight;
116
+ const margin = marginOf(reading.digits, isHedged(line, reading.start, words)) * weight;
117
+ return metres > 0 ? [{ start: reading.start, end: reading.unitEnd, metres, margin }] : [];
118
+ });
119
+ /**
120
+ * 分数と組になる距離。すぐ後ろ(徒歩5分(400m))を先に、無ければすぐ前(400m(徒歩5分))を見る。間に置けるのは記号と約の語だけ。
121
+ * 一つの距離は一つの分数とだけ組にする。
122
+ */
123
+ export const walkPairs = (line, words) => {
124
+ const distances = distancesIn(line, words);
125
+ const between = (from, to) => from <= to && PAIR_GAP.test(trimFillers(line.slice(from, to), [...words.hedges, ...words.fillers]));
126
+ const used = new Set();
127
+ return walkMinutesIn(line, words).flatMap((minutes) => {
128
+ const after = distances.find((distance) => !used.has(distance) && between(minutes.end, distance.start));
129
+ const before = after ?? distances.findLast((distance) => !used.has(distance) && between(distance.end, minutes.lead));
130
+ if (before === undefined)
131
+ return [];
132
+ used.add(before);
133
+ return [{ minutes, distance: before }];
134
+ });
135
+ };
136
+ /** 一行に書いた速さ(m/分)。距離のすぐ後ろ(80mを1分、80 m per minute)かすぐ前(分速80m)に時間の語がある距離。 */
137
+ export const ratesIn = (line, words) => distancesIn(line, words).flatMap((distance) => {
138
+ const rest = line.slice(distance.end).trimStart();
139
+ const head = line.slice(0, distance.start).trimEnd();
140
+ const per = words.perTimes.find((mark) => mark.position !== "before" && startsWithWord(rest, mark.pattern)) ??
141
+ words.perTimes.find((mark) => mark.position === "before" && endsWithWord(head, mark.pattern));
142
+ return per === undefined ? [] : [distance.metres / ((per.weight ?? MINUTE_SECONDS) / MINUTE_SECONDS)];
143
+ });
144
+ const containsAny = (text, words) => words.some((word) => normal(text).includes(normal(word)));
145
+ /** 速さを読む行。徒歩の語(Walking も walk の語として)を含む行。 */
146
+ const hasWalkWord = (line, words) => containsAny(line, words.walks.map((walk) => walk.pattern));
147
+ const linesOf = (source) => {
148
+ const starts = [0, ...[...source.matchAll(/\n/gu)].map((match) => match.index + 1)];
149
+ return starts.map((start, index) => ({ text: source.slice(start, (starts[index + 1] ?? source.length + 1) - 1), start }));
150
+ };
151
+ /**
152
+ * 文書の速さ。徒歩の語のある行に書いた速さが一つ(一つの値)だけなら、それを使う。端数は、その行に切り上げの語があれば切り上げだけ、
153
+ * 無ければどちらでもよい。二つ以上の値があれば、どの分数がどれで計ったか決められないので比べない。書いていなければ fallback。
154
+ */
155
+ export const statedRate = (source, words, fallback) => {
156
+ const stated = linesOf(source)
157
+ .filter((line) => hasWalkWord(line.text, words))
158
+ .flatMap((line) => ratesIn(line.text, words).map((rate) => ({ rate, up: containsAny(line.text, words.roundUps) && !containsAny(line.text, words.notRoundUps) })));
159
+ const first = stated[0];
160
+ if (first === undefined)
161
+ return fallback;
162
+ if (stated.some((other) => other.rate !== first.rate))
163
+ return undefined;
164
+ return { metresPerMinute: first.rate, rounding: stated.some((other) => other.up) ? "up" : "any" };
165
+ };
166
+ /** その距離を歩いて合う分数の幅。margin の幅の上の端は含まない(1.25km は 1.3km と書く)。 */
167
+ export const expectedMinutes = (distance, rate) => {
168
+ const low = (distance.metres - distance.margin) / rate.metresPerMinute;
169
+ const high = (distance.metres + distance.margin) / rate.metresPerMinute;
170
+ return { low: rate.rounding === "up" ? Math.ceil(low - EPSILON) : Math.floor(low + EPSILON), high: Math.ceil(high - EPSILON) };
171
+ };
172
+ const rangeText = (low, high) => (low === high ? String(low) : `${String(low)}–${String(high)}`);
173
+ /** 距離と合わない徒歩の分数。分数の位置を指す。 */
174
+ export const walkTimeMismatches = (source, words, fallback) => {
175
+ const rate = statedRate(source, words, fallback);
176
+ if (rate === undefined)
177
+ return [];
178
+ return linesOf(source).flatMap((line) => walkPairs(line.text, words).flatMap(({ minutes, distance }) => {
179
+ const { low, high } = expectedMinutes(distance, rate);
180
+ if (minutes.value >= low && minutes.value <= high)
181
+ return [];
182
+ return [
183
+ {
184
+ offset: line.start + minutes.lead,
185
+ values: {
186
+ minutes: line.text.slice(minutes.lead, minutes.end),
187
+ distance: line.text.slice(distance.start, distance.end),
188
+ expected: rangeText(Math.max(low, 1), Math.max(high, 1)),
189
+ rate: Math.round(rate.metresPerMinute * RATE_DECIMALS) / RATE_DECIMALS,
190
+ },
191
+ },
192
+ ];
193
+ }));
194
+ };
195
+ //# sourceMappingURL=walk-time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walk-time.js","sourceRoot":"","sources":["../../src/structure/walk-time.ts"],"names":[],"mappings":"AAqDA,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,M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AAC;IACjD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAClC,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CACtC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC5D,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtD,IAAI,OAAO,CAAC,KAAK,IAAI,GAAG,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI;YAAE,OAAO,EAAE,CAAC;QAC7D,OAAO;YACL;gBACE,MAAM,EAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI;gBACjC,MAAM,EAAE;oBACN,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;oBACnD,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;oBACvD,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;oBACxD,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,GAAG,aAAa;iBACvE;aACF;SACF,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaffjs",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Prose validation harness. Finds what is hard to read, and never rewrites it for you.",
5
5
  "keywords": [
6
6
  "chaff",
@@ -87,8 +87,8 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "@anthropic-ai/sdk": "^0.125.0",
90
- "@chaffjs/lang-en": "0.27.0",
91
- "@chaffjs/lang-ja": "0.29.0",
90
+ "@chaffjs/lang-en": "0.28.0",
91
+ "@chaffjs/lang-ja": "0.30.0",
92
92
  "character-entities": "^2.0.2",
93
93
  "mdast-util-from-markdown": "^2.0.3",
94
94
  "mdast-util-frontmatter": "^2.0.1",
@@ -0,0 +1,20 @@
1
+ id: listing
2
+
3
+ name:
4
+ ja: 不動産の物件広告
5
+ en: Property listing
6
+
7
+ why:
8
+ ja: 日本の不動産の広告は、徒歩の分数を道路距離80mを1分として出し、1分未満の端数を1分に切り上げると決められています(不動産の表示に関する公正競争規約施行規則)。物件広告では、速さを書いていなくても、この速さで徒歩の分数と距離を比べます。ほかの文書の徒歩の分数は、速さを書いたときだけ比べます。
9
+ en: Japanese property advertising computes walking times at 80 m of road per minute, a part minute rounded up (the real-estate fair-competition code). In a Japanese listing, walking times are compared with their distances at that rate even when it is not written. There is no such standard for English listings, so this profile has no English part.
10
+
11
+ # 設定(chaff.yaml の profile / by_path)が無いときに、内容から選ぶ。物件概要の項目(交通、賃料、敷金、間取り…)の行が
12
+ # min_lines 行以上あれば物件広告として読む。表の行(| 賃料 | …)も、「賃料:…」の行も数える。
13
+ detect:
14
+ ja:
15
+ line: "^[ \\t]*\\|?[ \\t]*(?:交通|賃料|家賃|管理費|共益費|敷金|礼金|保証金|間取り|専有面積|入居可能日|築年月)[ \\t]*[||::]"
16
+ min_lines: 3
17
+
18
+ ja:
19
+ # 文書に速さを書いていないときの、徒歩の分数の速さ。1分に歩く m と、端数を切り上げるか(walk-time-distance-mismatch)。
20
+ walk_rate: { metres_per_minute: 80, round_up: true }
@@ -60,5 +60,5 @@ example:
60
60
  - Your bank account
61
61
 
62
62
  not_flagged:
63
- ja: 目安の数(約3点、3つ以上)、順番(3つ目)、選ぶ数(以下から1つ選ぶ)、見出しや表の前の数、箇条書きがすぐ後ろに無い数は比べません。予告の文に数が二つあるときも比べません。コロンだけで予告する文は、コロンにいちばん近い数を予告の数とみなし、その数の後ろにまだ数があれば比べません(「1 つのページを 2 ページに分けました:」)。どの行も「ラベル:A / B」の形の箇条書きは、斜線(/)で区切って並べた項目の数が合っていれば指摘しません。一行に並べた名前は、区切りが決まらないとき(名前の中に「と」「・」がある、括弧が閉じていない、途中で文が終わる)と、並びが閉じていないとき(「ほか」「など」で終わる、「5名ほか」)は比べません。
64
- en: An estimate (about three, three or more), a rank (the first three), how many to pick (choose two), a number before a heading or a table, and a number with no list right after it are not compared. Nor is a sentence with two numbers in it. When only a colon announces the list, the number nearest the colon is the count, so a number followed by another one is not compared ("We merged three tasks into 2 pages:"). A list whose every item is a label, a colon and members split at slashes is not reported when the members add up to the count. Names listed on one line are not compared when the split is unclear ("and" or "&" inside a name, an unclosed bracket, a sentence ending midway) or the list is left open ("etc.", "and others").
63
+ ja: 目安の数(約3点、3つ以上)、順番(3つ目)、選ぶ数(以下から1つ選ぶ)、条や節の番号(7.1、第3条)、見出しや表の前の数、箇条書きがすぐ後ろに無い数は比べません。予告の文に数が二つあるときも比べません。コロンだけで予告する文は、コロンにいちばん近い数を予告の数とみなし、その数の後ろにまだ数があれば比べません(「1 つのページを 2 ページに分けました:」)。どの行も「ラベル:A / B」の形の箇条書きは、斜線(/)で区切って並べた項目の数が合っていれば指摘しません。一行に並べた名前は、区切りが決まらないとき(名前の中に「と」「・」がある、括弧が閉じていない、途中で文が終わる)と、並びが閉じていないとき(「ほか」「など」で終わる、「5名ほか」)は比べません。
64
+ en: An estimate (about three, three or more), a rank (the first three), how many to pick (choose two), the number of a clause or section (7.1, Article 7), a number before a heading or a table, and a number with no list right after it are not compared. Nor is a sentence with two numbers in it. When only a colon announces the list, the number nearest the colon is the count, so a number followed by another one is not compared ("We merged three tasks into 2 pages:"). A list whose every item is a label, a colon and members split at slashes is not reported when the members add up to the count. Names listed on one line are not compared when the split is unclear ("and" or "&" inside a name, an unclosed bracket, a sentence ending midway) or the list is left open ("etc.", "and others").
@@ -0,0 +1,66 @@
1
+ id: capacity-runtime-mismatch
2
+ layer: L3
3
+ status: stable
4
+ how_to_find: capacity-runtime-mismatch
5
+ # Item names are read with battery-label (capacity, consumption, runtime, standby, peak, bound), units with battery-unit and
6
+ # unit-time, ranges with range-connector, rough values with approximate-marker.
7
+ severity: warning
8
+
9
+ name:
10
+ ja: 電池の容量を消費電流で割った時間より長い使用時間
11
+ en: A runtime longer than the battery capacity divided by the consumption
12
+
13
+ why:
14
+ ja: 「容量 5000 mAh、消費電流 500 mA、連続使用時間 15時間」のように書くと、5000 mAh ÷ 500 mA は 10時間なので、15時間はどうやっても届きません。消費電流か使用時間のどちらかを、別の条件の値や別の機種の値に書き換えたときに起きます。実際の使用時間は変換の損失で割り算の値より短くなるのが普通なので、短いほうは言いません。割り算の値を、使用時間の書いた桁の一つ分(15時間なら1時間)より大きく超えたときだけ言います。三つのどれかに「約」「最大」などが付いていれば、その幅を二倍にします。
15
+ en: 'When a spec states "Capacity 5000 mAh, current draw 500 mA, runtime 15 hours", 5000 mAh at 500 mA lasts 10 hours, so 15 hours cannot be reached. It happens when the consumption or the runtime is replaced with the value of another condition or another model. A real runtime is normally shorter than the division because of conversion losses, so a shorter one is not reported. Only a runtime above the division by more than one step of its last written digit (1 hour for "15 hours") is reported; when any of the three is marked "about" or "up to", that margin is doubled.'
16
+
17
+ message:
18
+ ja: "{capacity} ÷ {consumption} は {expected} 時間ですが、使用時間は{runtime}と書かれています"
19
+ en: "{capacity} at {consumption} lasts {expected} hours, but the runtime is given as {runtime}"
20
+
21
+ how_to_fix:
22
+ ja: 容量・消費電流・使用時間が同じ条件の値かを確かめて、違っているほうを直してください。
23
+ en: Check that the capacity, the consumption and the runtime are values of the same condition, and correct the one that is not.
24
+
25
+ levels: { normal: warning, relaxed: info }
26
+
27
+ use_for: [business, technical, blog, legal, docs, academic, literature, speech]
28
+
29
+ group: facts
30
+ summary:
31
+ ja: 「5000 mAh、500 mA、連続使用時間15時間」のように、容量を消費電流で割った時間より長い使用時間
32
+ en: A runtime longer than the capacity divided by the consumption, such as 5000 mAh at 500 mA stated as 15 hours
33
+ example:
34
+ ja:
35
+ before: |
36
+ | 項目 | 仕様 |
37
+ | --- | --- |
38
+ | バッテリー容量 | 5000 mAh |
39
+ | 消費電流 | 500 mA |
40
+ | 連続使用時間 | 15時間 |
41
+ after: |
42
+ | 項目 | 仕様 |
43
+ | --- | --- |
44
+ | バッテリー容量 | 5000 mAh |
45
+ | 消費電流 | 500 mA |
46
+ | 連続使用時間 | 10時間 |
47
+ en:
48
+ before: |
49
+ | Item | Specification |
50
+ | --- | --- |
51
+ | Battery capacity | 50 Wh |
52
+ | Power consumption | 10 W |
53
+ | Runtime | 8 hours |
54
+ after: |
55
+ | Item | Specification |
56
+ | --- | --- |
57
+ | Battery capacity | 50 Wh |
58
+ | Power consumption | 10 W |
59
+ | Runtime | 5 hours |
60
+
61
+ not_flagged:
62
+ ja: 容量・消費電流・使用時間を、表の行(項目名と値)か「項目名:値」の行に書き、同じ節の同じ表か行にそろっているときだけ読みます。幅の広い表は列ごとに一台と読みます。mAh は mA でだけ、Wh は W でだけ割り、mAh を W で割ることはしません(電圧が公称か動作時かを決められないため)。最大の消費電流(項目名の「最大」、列の見出しの「最大」)は使わず、待機の消費電流は待受時間とだけ組みます。消費電流と使用時間が二つ以上あれば、括弧の中の条件(音量50%)が同じものどうしだけを組みます。範囲(8〜10時間、300〜500 mA)は書き手に有利な端(使用時間の短いほう、消費電流の小さいほう、容量の大きいほう)で比べます。「以上」「以下」「以内」で片側だけを決めた値と、文の中に書いた値は読みません。
63
+ en: 'Only a capacity, a consumption and a runtime written as table rows (item name and value) or "item name: value" lines, in the same table or the lines of the same section, are read; a wider table is one device per column. mAh is divided only by mA and Wh only by W; mAh is never divided by W, since whether the voltage is the nominal or the operating one cannot be told. A maximum consumption ("max" in the item name, a "Max" column) is not used, and a standby consumption pairs only with a standby time. With two or more consumptions and runtimes, only those with the same condition in brackets ("(50% volume)") are paired. A range ("8-10 hours", "300-500 mA") is compared at the end that favours the writer (the shorter runtime, the smaller consumption, the larger capacity). A value bounded on one side ("at least", "under") and values in running sentences are not read.'
64
+ level_meaning:
65
+ ja: 容量を消費電流で割った時間を、使用時間が書いた桁を超えて上回るとき指摘
66
+ en: reported when the runtime is above the capacity divided by the consumption by more than its written precision
@@ -0,0 +1,76 @@
1
+ id: contact-variant
2
+ layer: L3
3
+ status: stable
4
+ how_to_find: contact-variant
5
+ word_list: address-label
6
+ # The address labels (住所, 本店所在地, Address, head office) and whose address each names come from the language's
7
+ # address-label lexicon; addresses after labels of different offices (a head office and a branch) are never compared.
8
+ languages: [ja, en]
9
+ severity: warning
10
+
11
+ name:
12
+ ja: 連絡先の書き違い
13
+ en: A contact written two ways
14
+
15
+ why:
16
+ ja: 問合せ先のメールアドレスや会社の住所は、本文の上と下、問合せ先と管轄の条のように何度も書かれます。一か所だけ「privacy@hibari-lab.example」が「privacy@hibarilab.example」に、「丸の内二丁目4番1号」が「丸の内二丁目1番4号」になっていると、読み手はどちらが正しいか分からず、届かない宛先に送ることもあります。メールアドレスは、ハイフンや点が一つ抜けたもの、どこか一語だけが一、二文字違うものを指します。住所は、住所を言う語(住所、本店所在地)の後ろに書いた、同じ町の住所どうしを比べ、番地の数字が入れ替わったもの、一つだけ違うもの、郵便番号だけが違うものを指します。
17
+ en: 'An email address or a company''s address is written more than once: at the top and the bottom, under "Contact" and in the governing-law clause. When one place reads privacy@hibarilab.example for privacy@hibari-lab.example, or 2-1-4 Marunouchi for 2-4-1 Marunouchi, the reader cannot tell which is right and may write to one that never arrives. An email address is reported when it is another with a dot or hyphen dropped, or with one word one or two letters off. Addresses written after an address word (Address, head office) on the same street are compared, and one whose block numbers are swapped or one changed, or whose postcode alone differs, is reported.'
18
+
19
+ message:
20
+ ja: メールアドレス「{written}」は、「{other}」の書き違いかもしれません
21
+ en: "The email address {written} may be a slip for {other}"
22
+
23
+ messages:
24
+ address:
25
+ ja: 住所「{written}」は、「{other}」と番地が違います
26
+ en: "The address {written} has other block numbers than {other}"
27
+ postcode:
28
+ ja: 住所「{written}」は、同じ住所「{other}」と郵便番号が違います
29
+ en: "The address {written} has another postcode than the same address {other}"
30
+
31
+ how_to_fix:
32
+ ja: 正しい宛先を確かめて、もう一方を直してください。
33
+ en: Check which is right and correct the other.
34
+
35
+ levels: { strict: error, normal: warning, relaxed: warning }
36
+
37
+ use_for: [business, technical, blog, legal, docs, academic, literature, speech]
38
+ off_for:
39
+ literature: A story's addresses are made up and need not agree; one may differ on purpose.
40
+ speech: A transcript writes what was said, slips corrected afterwards included.
41
+
42
+ group: facts
43
+ summary:
44
+ ja: 同じ文書で、メールアドレスや住所が一か所だけ違って書かれている所(hibari-lab と hibarilab、4番1号と1番4号)
45
+ en: One email address or postal address written elsewhere with a slip (hibari-lab and hibarilab, 2-4-1 and 2-1-4)
46
+ example:
47
+ ja:
48
+ before: |
49
+ # お問合せ
50
+
51
+ メールアドレス:support@hibari-lab.example
52
+
53
+ 変更の質問は、suport@hibari-lab.example へ送ってください。
54
+ after: |
55
+ # お問合せ
56
+
57
+ メールアドレス:support@hibari-lab.example
58
+
59
+ 変更の質問は、support@hibari-lab.example へ送ってください。
60
+ en:
61
+ before: |
62
+ # Contact
63
+
64
+ Email: support@hibari-lab.example
65
+
66
+ Questions about a change can be sent to suport@hibari-lab.example.
67
+ after: |
68
+ # Contact
69
+
70
+ Email: support@hibari-lab.example
71
+
72
+ Questions about a change can be sent to support@hibari-lab.example.
73
+
74
+ not_flagged:
75
+ ja: 別のメールアドレス(sales@ と support@)、数字だけが違うもの(support1@ と support2@)、5文字より短い語の違い(hr@ と pr@、sale@ と sales@)は指しません。住所は、同じ行で前に「住所」「本店所在地」のような語があるものだけを読みます。持ち主の違う住所(本店と支店)、町の違う住所、同じ名の町でも市や区の違う住所、番地の数の違う住所、二つ以上の番地が違う住所は比べません。都道府県・市・区・郡の無い住所は読みません。
76
+ en: Two different addresses (sales@ and support@), addresses that differ only in a digit (support1@ and support2@) and a difference in a word shorter than five letters (hr@ and pr@, sale@ and sales@) are not reported. Only a postal address with an address word (Address, head office) before it on its line is read. Addresses of different offices (a head office and a branch), on different streets, on a street of the same name in another town, with a different count of block numbers, or with two numbers changed are not compared.
@@ -0,0 +1,55 @@
1
+ id: count-over-capacity
2
+ layer: L3
3
+ status: stable
4
+ how_to_find: count-over-capacity
5
+ severity: warning
6
+
7
+ name:
8
+ ja: 定員より多い申込の人数
9
+ en: More registered than the stated capacity
10
+
11
+ why:
12
+ ja: 「定員:90名」と書いた案内に「95名の方にお申し込みいただいております」とあると、定員と人数のどちらかを書き間違えています。読み手は申し込んでよいのか、当日入れるのかを問い合わせることになります。定員の語(定員、先着)と人数の語(申込、招待者、お申し込み)を付けた人の数だけを比べ、語の無い数は読みません。比べるのは文書に定員が一つだけ書いてあるときです。
13
+ en: 'When an invitation says "Capacity: 90 seats" and later "95 members have registered", one of the two numbers is wrong, and readers have to ask whether they can still register or will get in on the day. Only numbers of people that carry a word of capacity ("capacity", "limited to") or of registration ("have registered", "invited") are compared, and only when the document states one capacity.'
14
+
15
+ message:
16
+ ja: 定員「{capacity}」より、人数「{count}」のほうが多いです
17
+ en: "The capacity ({capacity}) is smaller than the number stated later ({count})"
18
+
19
+ how_to_fix:
20
+ ja: 定員と人数を確かめて、書き間違えたほうを直してください。定員を超えた申込をキャンセル待ちや抽選にするなら、そう書いてください。
21
+ en: Check the capacity and the number, and correct the wrong one. If places past the capacity go to a waiting list or a ballot, say so.
22
+
23
+ levels: { strict: error, normal: warning, relaxed: info }
24
+
25
+ use_for: [business, technical, blog, legal, docs, academic, literature, speech]
26
+ off_for:
27
+ literature: "Length, rhythm, repetition and register are the author's choices in literature, and dialogue mixes styles. Only what one work can hold itself to runs: consistent spacing and commas, and numbering without gaps."
28
+
29
+ group: facts
30
+ summary:
31
+ ja: 「定員90名」の案内に、それより多い申込の人数が書いてある所
32
+ en: A stated capacity smaller than the number registered
33
+ example:
34
+ ja:
35
+ before: |
36
+ 定員:90名(先着順)
37
+
38
+ 11月6日現在、95名の方にお申し込みいただいております。
39
+ after: |
40
+ 定員:120名(先着順)
41
+
42
+ 11月6日現在、95名の方にお申し込みいただいております。
43
+ en:
44
+ before: |
45
+ Capacity: 90 seats, first come, first served
46
+
47
+ As of November 6, 95 members have registered.
48
+ after: |
49
+ Capacity: 120 seats, first come, first served
50
+
51
+ As of November 6, 95 members have registered.
52
+
53
+ not_flagged:
54
+ ja: キャンセル待ちや抽選の語のある文書、一回あたりの定員(各回定員20名)、昨年や前回の人数、数える物の違う数(30組と45名、申込45件)、定員が二つ以上ある文書、語の付いていない数は比べません。
55
+ en: 'A document that mentions a waiting list or a ballot, a capacity per session ("20 per session"), last year''s or a previous event''s numbers, numbers of different things (30 groups and 45 people), a document stating more than one capacity, and numbers without a word of capacity or registration are not compared.'
@@ -10,8 +10,8 @@ name:
10
10
  en: A date outside the stated period
11
11
 
12
12
  why:
13
- ja: 「旅行期間:10月12日〜10月15日」と書いた旅程の中に10月17日の予定があると、期間と日程のどちらが正しいのかを読み手が問い合わせることになります。日付を書き写し間違えたときや、日程を動かして期間を直し忘れたときに起きます。期間は「旅行期間」「会期」のような期間の語で始まる一行から読み、その後ろの同じ節の箇条書き、表の行、見出しの日付と、地の文の年の無い日付を比べます。前泊や事後の予定、申込締切や予約の日、過去の回のように、期間の外に置く語がその行や文、節の見出しにある日付は比べません。年の無い期間(12月28日〜1月4日)は年をまたぐ期間として読みます。「開講期間」のように文書の仕事がその中で済む期間を、文書の頭か概要の節に書いたときは、後ろのどの節でも「提出」「締切」のある項目や文の年のある日付が期間の終わりより後なら指します(課題の提出期限が学期の後)。
14
- en: 'When an itinerary says "Trip dates: Oct 12–15" and then lists something on October 17, the reader has to ask whether the period or the schedule is right. It happens when a date is copied wrong, or when the schedule moves and the period is not updated. The period is read from one line that starts with a period word such as "Trip dates" or "Conference", and the dates after it in the same section are compared, in list items, table rows and headings, and in running text when the date has no year. A date whose item, sentence or section heading marks it as outside the period on purpose (a post-trip meeting, a booking deadline, a past edition) is not compared. A period without a year ("Dec 28 – Jan 4") is read as running into the new year. When the period the document''s work is done in ("Term") is stated at the top or in the overview section, a date with a year after its end in an item or sentence of any later section that says "submit", "due" or "deadline" is reported (an assignment due after the term).'
13
+ ja: 「旅行期間:10月12日〜10月15日」と書いた旅程の中に10月17日の予定があると、期間と日程のどちらが正しいのかを読み手が問い合わせることになります。日付を書き写し間違えたときや、日程を動かして期間を直し忘れたときに起きます。期間は「旅行期間」「会期」のような期間の語で始まる一行から読み、その後ろの同じ節の箇条書き、表の行、見出しの日付と、地の文の年の無い日付を比べます。前泊や事後の予定、申込締切や予約の日、過去の回のように、期間の外に置く語がその行や文、節の見出しにある日付は比べません。年の無い期間(12月28日〜1月4日)は年をまたぐ期間として読みます。「開講期間」のように文書の仕事がその中で済む期間を、文書の頭か概要の節に書いたときは、後ろのどの節でも「提出」「締切」「課題:」のある項目や文の日付が期間の終わりより後なら指します(課題の提出期限が学期の後)。年の無い日付は、期間が一つの年に収まるときだけその年と読みます。
14
+ en: 'When an itinerary says "Trip dates: Oct 12–15" and then lists something on October 17, the reader has to ask whether the period or the schedule is right. It happens when a date is copied wrong, or when the schedule moves and the period is not updated. The period is read from one line that starts with a period word such as "Trip dates" or "Conference", and the dates after it in the same section are compared, in list items, table rows and headings, and in running text when the date has no year. A date whose item, sentence or section heading marks it as outside the period on purpose (a post-trip meeting, a booking deadline, a past edition) is not compared. A period without a year ("Dec 28 – Jan 4") is read as running into the new year. When the period the document''s work is done in ("Term") is stated at the top or in the overview section, a date after its end in an item or sentence of any later section that says "submit", "due", "deadline" or "Assignment:" is reported (an assignment due after the term). A date without a year takes the term''s year only when the term lies within one year.'
15
15
 
16
16
  message:
17
17
  ja: 「{date}」が、書いた期間「{period}」の外です
@@ -60,5 +60,5 @@ example:
60
60
  - May 5: closing session
61
61
 
62
62
  not_flagged:
63
- ja: 期間を書いていない文書、期間の外に置く語(前泊、事後、申込締切、予約、前回)のある日付、年の無い期間が年をまたぐときの年明けの日付は比べません。旅行期間や会期の後の締め切り(精算書の提出)、支払の期限は指しません。
64
- en: 'A document with no stated period, a date marked as outside on purpose ("post-trip", "follow-up", "book by", "deadline", "previous"), and the new-year dates of a period without a year that runs past December 31 are not compared. A deadline after a trip or a conference (an expense report) and a payment deadline are not reported.'
63
+ ja: 期間を書いていない文書、期間の外に置く語(前泊、事後、申込締切、予約、前回)のある日付、年の無い期間が年をまたぐときの年明けの日付は比べません。旅行期間や会期の後の締め切り(精算書の提出)、支払の期限、成績発表や成績照会、再試験のように学期の後に来てよい日付、年をまたぐ開講期間に対する年の無い締め切りは指しません。
64
+ en: 'A document with no stated period, a date marked as outside on purpose ("post-trip", "follow-up", "book by", "deadline", "previous"), and the new-year dates of a period without a year that runs past December 31 are not compared. A deadline after a trip or a conference (an expense report), a payment deadline, work that may come after a term (grades released, grade appeals, resits), and a deadline without a year against a term that runs across two years are not reported.'