chaffjs 0.21.0 → 0.22.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 (214) hide show
  1. package/README.md +2 -1
  2. package/dist/cli-text.d.ts.map +1 -1
  3. package/dist/cli-text.js +4 -0
  4. package/dist/cli-text.js.map +1 -1
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +4 -11
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/init-command.d.ts +4 -0
  9. package/dist/commands/init-command.d.ts.map +1 -0
  10. package/dist/commands/init-command.js +15 -0
  11. package/dist/commands/init-command.js.map +1 -0
  12. package/dist/commands/plugin-init.d.ts +20 -0
  13. package/dist/commands/plugin-init.d.ts.map +1 -0
  14. package/dist/commands/plugin-init.js +129 -0
  15. package/dist/commands/plugin-init.js.map +1 -0
  16. package/dist/commands/plugin-test.d.ts +11 -0
  17. package/dist/commands/plugin-test.d.ts.map +1 -0
  18. package/dist/commands/plugin-test.js +81 -0
  19. package/dist/commands/plugin-test.js.map +1 -0
  20. package/dist/custom/problems.d.ts.map +1 -1
  21. package/dist/custom/problems.js +1 -2
  22. package/dist/custom/problems.js.map +1 -1
  23. package/dist/detectors/amount-for-count.d.ts +21 -0
  24. package/dist/detectors/amount-for-count.d.ts.map +1 -0
  25. package/dist/detectors/amount-for-count.js +55 -0
  26. package/dist/detectors/amount-for-count.js.map +1 -0
  27. package/dist/detectors/currency-notation.d.ts +29 -0
  28. package/dist/detectors/currency-notation.d.ts.map +1 -0
  29. package/dist/detectors/currency-notation.js +58 -0
  30. package/dist/detectors/currency-notation.js.map +1 -0
  31. package/dist/detectors/dangling-opener.d.ts +14 -0
  32. package/dist/detectors/dangling-opener.d.ts.map +1 -0
  33. package/dist/detectors/dangling-opener.js +55 -0
  34. package/dist/detectors/dangling-opener.js.map +1 -0
  35. package/dist/detectors/footnote-mismatch.d.ts +11 -0
  36. package/dist/detectors/footnote-mismatch.d.ts.map +1 -0
  37. package/dist/detectors/footnote-mismatch.js +55 -0
  38. package/dist/detectors/footnote-mismatch.js.map +1 -0
  39. package/dist/detectors/form-minority.d.ts +13 -0
  40. package/dist/detectors/form-minority.d.ts.map +1 -0
  41. package/dist/detectors/form-minority.js +19 -0
  42. package/dist/detectors/form-minority.js.map +1 -0
  43. package/dist/detectors/heading-end-mark.d.ts +10 -0
  44. package/dist/detectors/heading-end-mark.d.ts.map +1 -0
  45. package/dist/detectors/heading-end-mark.js +59 -0
  46. package/dist/detectors/heading-end-mark.js.map +1 -0
  47. package/dist/detectors/list-marker.d.ts +7 -0
  48. package/dist/detectors/list-marker.d.ts.map +1 -0
  49. package/dist/detectors/list-marker.js +50 -0
  50. package/dist/detectors/list-marker.js.map +1 -0
  51. package/dist/detectors/markdown-slip.d.ts +19 -0
  52. package/dist/detectors/markdown-slip.d.ts.map +1 -0
  53. package/dist/detectors/markdown-slip.js +122 -0
  54. package/dist/detectors/markdown-slip.js.map +1 -0
  55. package/dist/detectors/numeral-opener.d.ts +10 -0
  56. package/dist/detectors/numeral-opener.d.ts.map +1 -0
  57. package/dist/detectors/numeral-opener.js +65 -0
  58. package/dist/detectors/numeral-opener.js.map +1 -0
  59. package/dist/detectors/ordinal-suffix.d.ts +12 -0
  60. package/dist/detectors/ordinal-suffix.d.ts.map +1 -0
  61. package/dist/detectors/ordinal-suffix.js +33 -0
  62. package/dist/detectors/ordinal-suffix.js.map +1 -0
  63. package/dist/detectors/range-notation.d.ts +15 -0
  64. package/dist/detectors/range-notation.d.ts.map +1 -0
  65. package/dist/detectors/range-notation.js +58 -0
  66. package/dist/detectors/range-notation.js.map +1 -0
  67. package/dist/detectors/registry/amount-for-count.d.ts +3 -0
  68. package/dist/detectors/registry/amount-for-count.d.ts.map +1 -0
  69. package/dist/detectors/registry/amount-for-count.js +3 -0
  70. package/dist/detectors/registry/amount-for-count.js.map +1 -0
  71. package/dist/detectors/registry/currency-notation.d.ts +3 -0
  72. package/dist/detectors/registry/currency-notation.d.ts.map +1 -0
  73. package/dist/detectors/registry/currency-notation.js +3 -0
  74. package/dist/detectors/registry/currency-notation.js.map +1 -0
  75. package/dist/detectors/registry/dangling-opener.d.ts +3 -0
  76. package/dist/detectors/registry/dangling-opener.d.ts.map +1 -0
  77. package/dist/detectors/registry/dangling-opener.js +3 -0
  78. package/dist/detectors/registry/dangling-opener.js.map +1 -0
  79. package/dist/detectors/registry/footnote-mismatch.d.ts +3 -0
  80. package/dist/detectors/registry/footnote-mismatch.d.ts.map +1 -0
  81. package/dist/detectors/registry/footnote-mismatch.js +3 -0
  82. package/dist/detectors/registry/footnote-mismatch.js.map +1 -0
  83. package/dist/detectors/registry/heading-end-punctuation.d.ts +3 -0
  84. package/dist/detectors/registry/heading-end-punctuation.d.ts.map +1 -0
  85. package/dist/detectors/registry/heading-end-punctuation.js +3 -0
  86. package/dist/detectors/registry/heading-end-punctuation.js.map +1 -0
  87. package/dist/detectors/registry/list-marker.d.ts +3 -0
  88. package/dist/detectors/registry/list-marker.d.ts.map +1 -0
  89. package/dist/detectors/registry/list-marker.js +3 -0
  90. package/dist/detectors/registry/list-marker.js.map +1 -0
  91. package/dist/detectors/registry/numeral-opener.d.ts +3 -0
  92. package/dist/detectors/registry/numeral-opener.d.ts.map +1 -0
  93. package/dist/detectors/registry/numeral-opener.js +3 -0
  94. package/dist/detectors/registry/numeral-opener.js.map +1 -0
  95. package/dist/detectors/registry/ordinal-suffix.d.ts +3 -0
  96. package/dist/detectors/registry/ordinal-suffix.d.ts.map +1 -0
  97. package/dist/detectors/registry/ordinal-suffix.js +3 -0
  98. package/dist/detectors/registry/ordinal-suffix.js.map +1 -0
  99. package/dist/detectors/registry/range-notation.d.ts +3 -0
  100. package/dist/detectors/registry/range-notation.d.ts.map +1 -0
  101. package/dist/detectors/registry/range-notation.js +3 -0
  102. package/dist/detectors/registry/range-notation.js.map +1 -0
  103. package/dist/detectors/registry/relative-pronoun-mix.d.ts +3 -0
  104. package/dist/detectors/registry/relative-pronoun-mix.d.ts.map +1 -0
  105. package/dist/detectors/registry/relative-pronoun-mix.js +3 -0
  106. package/dist/detectors/registry/relative-pronoun-mix.js.map +1 -0
  107. package/dist/detectors/registry/share-over-hundred.d.ts +3 -0
  108. package/dist/detectors/registry/share-over-hundred.d.ts.map +1 -0
  109. package/dist/detectors/registry/share-over-hundred.js +3 -0
  110. package/dist/detectors/registry/share-over-hundred.js.map +1 -0
  111. package/dist/detectors/registry/step-reference.d.ts +3 -0
  112. package/dist/detectors/registry/step-reference.d.ts.map +1 -0
  113. package/dist/detectors/registry/step-reference.js +3 -0
  114. package/dist/detectors/registry/step-reference.js.map +1 -0
  115. package/dist/detectors/registry/table-row-overflow.d.ts +3 -0
  116. package/dist/detectors/registry/table-row-overflow.d.ts.map +1 -0
  117. package/dist/detectors/registry/table-row-overflow.js +3 -0
  118. package/dist/detectors/registry/table-row-overflow.js.map +1 -0
  119. package/dist/detectors/registry/toc-heading.d.ts +3 -0
  120. package/dist/detectors/registry/toc-heading.d.ts.map +1 -0
  121. package/dist/detectors/registry/toc-heading.js +3 -0
  122. package/dist/detectors/registry/toc-heading.js.map +1 -0
  123. package/dist/detectors/registry/unclosed-code-fence.d.ts +3 -0
  124. package/dist/detectors/registry/unclosed-code-fence.d.ts.map +1 -0
  125. package/dist/detectors/registry/unclosed-code-fence.js +3 -0
  126. package/dist/detectors/registry/unclosed-code-fence.js.map +1 -0
  127. package/dist/detectors/registry/unrendered-emphasis.d.ts +3 -0
  128. package/dist/detectors/registry/unrendered-emphasis.d.ts.map +1 -0
  129. package/dist/detectors/registry/unrendered-emphasis.js +3 -0
  130. package/dist/detectors/registry/unrendered-emphasis.js.map +1 -0
  131. package/dist/detectors/relative-pronoun-mix.d.ts +19 -0
  132. package/dist/detectors/relative-pronoun-mix.d.ts.map +1 -0
  133. package/dist/detectors/relative-pronoun-mix.js +60 -0
  134. package/dist/detectors/relative-pronoun-mix.js.map +1 -0
  135. package/dist/detectors/share-over-hundred.d.ts +20 -0
  136. package/dist/detectors/share-over-hundred.d.ts.map +1 -0
  137. package/dist/detectors/share-over-hundred.js +55 -0
  138. package/dist/detectors/share-over-hundred.js.map +1 -0
  139. package/dist/detectors/step-reference.d.ts +20 -0
  140. package/dist/detectors/step-reference.d.ts.map +1 -0
  141. package/dist/detectors/step-reference.js +57 -0
  142. package/dist/detectors/step-reference.js.map +1 -0
  143. package/dist/detectors/toc-heading.d.ts +10 -0
  144. package/dist/detectors/toc-heading.d.ts.map +1 -0
  145. package/dist/detectors/toc-heading.js +99 -0
  146. package/dist/detectors/toc-heading.js.map +1 -0
  147. package/dist/list-marks.d.ts +21 -0
  148. package/dist/list-marks.d.ts.map +1 -0
  149. package/dist/list-marks.js +82 -0
  150. package/dist/list-marks.js.map +1 -0
  151. package/dist/rule-fields.d.ts +5 -0
  152. package/dist/rule-fields.d.ts.map +1 -1
  153. package/dist/rule-fields.js +21 -0
  154. package/dist/rule-fields.js.map +1 -1
  155. package/package.json +3 -3
  156. package/rules/cliche.yaml +67 -0
  157. package/rules/currency-notation-consistency.yaml +77 -0
  158. package/rules/dangling-participle.yaml +58 -0
  159. package/rules/footnote-mismatch.yaml +91 -0
  160. package/rules/heading-end-punctuation-mix.yaml +158 -0
  161. package/rules/less-for-fewer.yaml +59 -0
  162. package/rules/list-marker-mix.yaml +111 -0
  163. package/rules/nonstandard-word.yaml +80 -0
  164. package/rules/numeral-sentence-start.yaml +56 -0
  165. package/rules/ordinal-suffix-mismatch.yaml +65 -0
  166. package/rules/range-notation-consistency.yaml +73 -0
  167. package/rules/share-over-hundred.yaml +65 -0
  168. package/rules/step-reference-missing.yaml +85 -0
  169. package/rules/table-row-overflow.yaml +90 -0
  170. package/rules/toc-heading-mismatch.yaml +136 -0
  171. package/rules/unclosed-code-fence.yaml +107 -0
  172. package/rules/uncomparable-graded.yaml +65 -0
  173. package/rules/unrendered-emphasis.yaml +73 -0
  174. package/rules/which-that-consistency.yaml +64 -0
  175. package/skills/chaff/SKILL.md +7 -7
  176. package/src/cli-text.ts +4 -0
  177. package/src/cli.ts +5 -9
  178. package/src/commands/init-command.ts +13 -0
  179. package/src/commands/plugin-init.ts +150 -0
  180. package/src/commands/plugin-test.ts +111 -0
  181. package/src/custom/problems.ts +1 -3
  182. package/src/detectors/amount-for-count.ts +90 -0
  183. package/src/detectors/currency-notation.ts +90 -0
  184. package/src/detectors/dangling-opener.ts +74 -0
  185. package/src/detectors/footnote-mismatch.ts +72 -0
  186. package/src/detectors/form-minority.ts +21 -0
  187. package/src/detectors/heading-end-mark.ts +82 -0
  188. package/src/detectors/list-marker.ts +60 -0
  189. package/src/detectors/markdown-slip.ts +140 -0
  190. package/src/detectors/numeral-opener.ts +72 -0
  191. package/src/detectors/ordinal-suffix.ts +40 -0
  192. package/src/detectors/range-notation.ts +76 -0
  193. package/src/detectors/registry/amount-for-count.ts +4 -0
  194. package/src/detectors/registry/currency-notation.ts +4 -0
  195. package/src/detectors/registry/dangling-opener.ts +4 -0
  196. package/src/detectors/registry/footnote-mismatch.ts +4 -0
  197. package/src/detectors/registry/heading-end-punctuation.ts +4 -0
  198. package/src/detectors/registry/list-marker.ts +4 -0
  199. package/src/detectors/registry/numeral-opener.ts +4 -0
  200. package/src/detectors/registry/ordinal-suffix.ts +4 -0
  201. package/src/detectors/registry/range-notation.ts +4 -0
  202. package/src/detectors/registry/relative-pronoun-mix.ts +4 -0
  203. package/src/detectors/registry/share-over-hundred.ts +4 -0
  204. package/src/detectors/registry/step-reference.ts +4 -0
  205. package/src/detectors/registry/table-row-overflow.ts +4 -0
  206. package/src/detectors/registry/toc-heading.ts +4 -0
  207. package/src/detectors/registry/unclosed-code-fence.ts +4 -0
  208. package/src/detectors/registry/unrendered-emphasis.ts +4 -0
  209. package/src/detectors/relative-pronoun-mix.ts +79 -0
  210. package/src/detectors/share-over-hundred.ts +75 -0
  211. package/src/detectors/step-reference.ts +83 -0
  212. package/src/detectors/toc-heading.ts +125 -0
  213. package/src/list-marks.ts +106 -0
  214. package/src/rule-fields.ts +28 -0
@@ -0,0 +1,122 @@
1
+ import { readMarkdown } from "../markdown-read.js";
2
+ import { spanOf } from "../markdown-node.js";
3
+ import { findingAt, markupOf } from "./markup-finding.js";
4
+ /** Quotations are someone else's text, and their markup is theirs. */
5
+ const QUOTED = "blockquote";
6
+ /** Nodes of one type outside quotations, in source order. Walks with its own stack: Markdown nests without limit. */
7
+ const nodesOf = (root, type) => {
8
+ const found = [];
9
+ const pending = [root];
10
+ for (let node = pending.pop(); node !== undefined; node = pending.pop()) {
11
+ if (node.type === QUOTED)
12
+ continue;
13
+ if (node.type === type)
14
+ found.push(node);
15
+ (node.children ?? []).toReversed().forEach((child) => pending.push(child));
16
+ }
17
+ return found;
18
+ };
19
+ const markdownRoot = (doc) => (markupOf(doc) === undefined ? undefined : readMarkdown(doc.source).root);
20
+ /** An HTML comment: a cell holding only one shows the reader nothing, and losing it loses nothing. */
21
+ const COMMENT = /<!--[\s\S]*?-->/gu;
22
+ /** Whether a cell shows the reader anything: its source without the bars, comments and spaces. */
23
+ const cellShows = (source, cell) => {
24
+ const span = spanOf(cell);
25
+ return span !== undefined && source.slice(span.start, span.end).replaceAll("|", "").replace(COMMENT, "").trim() !== "";
26
+ };
27
+ /**
28
+ * A body row with more cells than the header: GFM shows only as many cells as the header has, and drops the rest. Extra cells
29
+ * that are empty or hold only a comment lose nothing and are not reported.
30
+ */
31
+ export const tableRowOverflow = (doc) => {
32
+ const root = markdownRoot(doc);
33
+ if (root === undefined)
34
+ return [];
35
+ return nodesOf(root, "table").flatMap((table) => {
36
+ const [header, ...body] = table.children ?? [];
37
+ const columns = header?.children?.length ?? 0;
38
+ return body.flatMap((row) => {
39
+ const cells = row.children ?? [];
40
+ const span = spanOf(row);
41
+ const lost = cells.slice(columns).some((cell) => cellShows(doc.source, cell));
42
+ return lost && span !== undefined ? [findingAt(doc, span, { cells: cells.length, columns })] : [];
43
+ });
44
+ });
45
+ };
46
+ /** A fence opening a code block: three or more backticks or tildes, after up to three spaces. */
47
+ const FENCE_OPEN = /^ {0,3}(`{3,}|~{3,})/u;
48
+ /** A closing fence may sit at most this many columns further in than the container's text; four in, it is code. */
49
+ const MAX_FENCE_INDENT = 3;
50
+ const TAB_WIDTH = 4;
51
+ const indentOf = (line) => Array.from(line.slice(0, line.length - line.trimStart().length)).reduce((width, char) => width + (char === "\t" ? TAB_WIDTH : 1), 0);
52
+ /** Whether a line closes a fence: not indented past the limit, the same character, at least as many, and nothing after but spaces. */
53
+ const closes = (line, fence, maxIndent) => {
54
+ const trimmed = line.trim();
55
+ const mark = fence.charAt(0);
56
+ return indentOf(line) <= maxIndent && trimmed.length >= fence.length && [...trimmed].every((char) => char === mark);
57
+ };
58
+ /** The opening fence of a code block that is never closed; undefined for a closed or an indented block. */
59
+ const unclosedFenceOf = (source, span) => {
60
+ const lines = source.slice(span.start, span.end).split("\n");
61
+ const first = lines[0] ?? "";
62
+ const fence = FENCE_OPEN.exec(first)?.[1];
63
+ if (fence === undefined)
64
+ return undefined;
65
+ const column = span.start - (source.lastIndexOf("\n", span.start - 1) + 1);
66
+ const last = lines.length > 1 ? (lines.at(-1) ?? "") : "";
67
+ return closes(last, fence, column + MAX_FENCE_INDENT) ? undefined : { start: span.start, end: span.start + first.trimEnd().length };
68
+ };
69
+ /**
70
+ * A fenced code block with no closing fence. Markdown runs it to the end of the document (or of the list item it is in), so
71
+ * everything after the opening fence shows as code. Reported at the opening fence.
72
+ */
73
+ export const unclosedCodeFence = (doc) => {
74
+ const root = markdownRoot(doc);
75
+ if (root === undefined)
76
+ return [];
77
+ return nodesOf(root, "code").flatMap((code) => {
78
+ const span = spanOf(code);
79
+ const open = span === undefined ? undefined : unclosedFenceOf(doc.source, span);
80
+ return open === undefined ? [] : [findingAt(doc, open, { fence: doc.source.slice(open.start, open.end).trim() })];
81
+ });
82
+ };
83
+ /** `**` or `__` left in text: Markdown would have made it strong emphasis if it could pair it. Longer runs are rules or blanks to fill. */
84
+ const STRONG_RUN = /(?<![*_])(?:\*\*|__)(?![*_])/gu;
85
+ /** A run with Latin letters or digits on both sides (`2**10`, `snake__case`) is part of the word. Japanese has no spaces, so 「は**金」 is a mark. */
86
+ const WORD_CHAR = /[A-Za-z0-9]/u;
87
+ const isSpace = (char) => char === "" || /\s/u.test(char);
88
+ /** Python's dunder names (`__init__`) written outside code. */
89
+ const DUNDER = /__\w+__/u;
90
+ const dunderAround = (text, run) => {
91
+ const start = text.lastIndexOf(" ", run.start) + 1;
92
+ const end = text.indexOf(" ", run.end);
93
+ return DUNDER.test(text.slice(start, end === -1 ? text.length : end));
94
+ };
95
+ /** The strong-emphasis runs in one text node that Markdown left as text. */
96
+ export const strayStrongRuns = (text) => [...text.matchAll(STRONG_RUN)].flatMap((match) => {
97
+ const run = { start: match.index, end: match.index + match[0].length };
98
+ const before = text.charAt(run.start - 1);
99
+ const after = text.charAt(run.end);
100
+ if (before === "\\" || (WORD_CHAR.test(before) && WORD_CHAR.test(after)))
101
+ return [];
102
+ if (isSpace(before) && isSpace(after))
103
+ return [];
104
+ return dunderAround(text, run) ? [] : [run];
105
+ });
106
+ /**
107
+ * `**` or `__` that Markdown shows as it is: strong emphasis left open (`**bold`), or one CommonMark cannot close because a
108
+ * bracket or a quotation mark touches the mark from inside while a letter touches it from outside (`**「重要」**です`).
109
+ */
110
+ export const unrenderedEmphasis = (doc) => {
111
+ const root = markdownRoot(doc);
112
+ if (root === undefined)
113
+ return [];
114
+ return nodesOf(root, "text").flatMap((node) => {
115
+ const span = spanOf(node);
116
+ if (span === undefined)
117
+ return [];
118
+ const written = doc.source.slice(span.start, span.end);
119
+ return strayStrongRuns(written).map((run) => findingAt(doc, { start: span.start + run.start, end: span.start + run.end }, { mark: written.slice(run.start, run.end) }));
120
+ });
121
+ };
122
+ //# sourceMappingURL=markdown-slip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-slip.js","sourceRoot":"","sources":["../../src/detectors/markdown-slip.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB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CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAC1C,SAAS,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAC1H,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Detector } from "../plugin.ts";
2
+ /** 文の頭の数字。年、数字の後ろが小文字の語でないもの、言い終えていない行(見出しのような)は無い。 */
3
+ export declare const openingNumeral: (text: string) => string | undefined;
4
+ /**
5
+ * offset の前で、文がほんとうに終わっているか。文書か見出しの直後か、前の文が二字以上の語か数で言い終えているときだけ。
6
+ * 番号に付ける略した語(vol. 28、H.R. 5376)や、句点の無い行(Lane\n\n2 contains、HTML から移したリンクの切れ目)の後ろの数は文の頭ではない。
7
+ */
8
+ export declare const followsSentenceEnd: (source: string, offset: number, labels: ReadonlySet<string>) => boolean;
9
+ export declare const numeralOpener: Detector;
10
+ //# sourceMappingURL=numeral-opener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeral-opener.d.ts","sourceRoot":"","sources":["../../src/detectors/numeral-opener.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA2B,MAAM,cAAc,CAAC;AAoBtE,uDAAuD;AACvD,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,MAAM,GAAG,SAMtD,CAAC;AAkBF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,EAAE,QAAQ,WAAW,CAAC,MAAM,CAAC,KAAG,OAOhG,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,QAS3B,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * 数字で始まる文(20 people came.)。読み手は文の頭を大文字で探すので、数字の頭は文の切れ目を見えにくくする。
3
+ * 数字の後ろが小文字の語のときだけ読む: 「1 Introduction」のような番号の付いた題や「9:00 Opening」のような時刻の行は文ではない。
4
+ * 年(2026 was a good year.)は綴れないので読まない。
5
+ */
6
+ const OPENING_NUMERAL = /^(?<numeral>\d{1,3}(?:,\d{3})+|\d+)(?:\.\d+)?%?(?=\s+\p{Ll})/u;
7
+ const SENTENCE_END = /[.!?]["'”’)]*$/u;
8
+ const YEAR = /^[12]\d{3}$/u;
9
+ const HEADING_LINE = /(?:^|\n)#{1,6}\s[^\n]*$/u;
10
+ const CLOSERS = new Set(['"', "'", "”", "’", ")"]);
11
+ const STOP = /[.!?]$/u;
12
+ const WORD_CHAR = /[\p{L}\p{N}.]/u;
13
+ const DIGITS = /^\d+$/u;
14
+ /** 前の文の終わりを探す字数。見出しの行と、終わりの語が入れば足りる。 */
15
+ const LOOKBACK = 300;
16
+ const PLAIN_WORD = /^\p{L}{2,}$/u;
17
+ /** 文の頭の数字。年、数字の後ろが小文字の語でないもの、言い終えていない行(見出しのような)は無い。 */
18
+ export const openingNumeral = (text) => {
19
+ const trimmed = text.trim();
20
+ const match = OPENING_NUMERAL.exec(trimmed);
21
+ const numeral = match?.groups?.["numeral"];
22
+ if (match === null || numeral === undefined || YEAR.test(numeral) || !SENTENCE_END.test(trimmed))
23
+ return undefined;
24
+ return match[0];
25
+ };
26
+ /** text の終わりに続く、belongs を満たす字の並びの始まり(UTF-16 の位置)。 */
27
+ const tailStart = (text, belongs) => text.split("").reduceRight((at, char, index) => (at === index + 1 && belongs(char) ? index : at), text.length);
28
+ /** 終わりの印(. ! ?)の前の語。点を含めて読む(H.R. は「H.R」)。印で終わっていなければ undefined。 */
29
+ const lastWordBeforeStop = (text) => {
30
+ const closed = text.slice(0, tailStart(text, (char) => CLOSERS.has(char)));
31
+ if (!STOP.test(closed))
32
+ return undefined;
33
+ const body = closed.slice(0, -1);
34
+ const start = tailStart(body, (char) => WORD_CHAR.test(char));
35
+ return start === body.length ? undefined : body.slice(start);
36
+ };
37
+ /**
38
+ * offset の前で、文がほんとうに終わっているか。文書か見出しの直後か、前の文が二字以上の語か数で言い終えているときだけ。
39
+ * 番号に付ける略した語(vol. 28、H.R. 5376)や、句点の無い行(Lane\n\n2 contains、HTML から移したリンクの切れ目)の後ろの数は文の頭ではない。
40
+ */
41
+ export const followsSentenceEnd = (source, offset, labels) => {
42
+ const from = Math.max(0, offset - LOOKBACK);
43
+ const ended = source.slice(from, offset).trimEnd();
44
+ if ((ended === "" && from === 0) || HEADING_LINE.test(ended))
45
+ return true;
46
+ const word = lastWordBeforeStop(ended);
47
+ if (word === undefined)
48
+ return false;
49
+ return DIGITS.test(word) || (PLAIN_WORD.test(word) && !labels.has(word.toLowerCase()));
50
+ };
51
+ const inside = (spans, offset) => spans.some((span) => span.start <= offset && offset < span.end);
52
+ const leadingSpace = (sentence) => sentence.text.length - sentence.text.trimStart().length;
53
+ export const numeralOpener = (doc) => {
54
+ const labels = new Set((doc.lexicons["numeral-reference-label"] ?? []).map((entry) => entry.pattern.toLowerCase()));
55
+ return doc.sentences.flatMap((sentence) => {
56
+ const offset = sentence.span.start + leadingSpace(sentence);
57
+ if (sentence.embeddedLanguage !== undefined || inside(doc.listSpans, offset))
58
+ return [];
59
+ const numeral = openingNumeral(sentence.text);
60
+ if (numeral === undefined || !followsSentenceEnd(doc.source, offset, labels))
61
+ return [];
62
+ return [{ rule: "", severity: "warning", line: 0, column: 0, quote: sentence.text.trim(), values: { numeral, offset } }];
63
+ });
64
+ };
65
+ //# sourceMappingURL=numeral-opener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeral-opener.js","sourceRoot":"","sources":["../../src/detectors/numeral-opener.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,MAAM,eAAe,GAAG,+DAA+D,CAAC;AACxF,MAAM,YAAY,G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GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;YAAE,OAAO,EAAE,CAAC;QACxF,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IAC3H,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Detector, Lexicon } from "../plugin.ts";
2
+ /** 合わない序数 1 つ。expected はその数に付く字(一つとは限らない)。 */
3
+ export type OrdinalSlip = {
4
+ readonly offset: number;
5
+ readonly written: string;
6
+ readonly number: string;
7
+ readonly expected: readonly string[];
8
+ };
9
+ /** 文字列の中の、数と字の合わない序数。語や番号の一部(v1th、0x2nd、1-2th)は読まない。 */
10
+ export declare const ordinalSlips: (text: string, suffixes: Lexicon) => OrdinalSlip[];
11
+ export declare const ordinalSuffix: Detector;
12
+ //# sourceMappingURL=ordinal-suffix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ordinal-suffix.d.ts","sourceRoot":"","sources":["../../src/detectors/ordinal-suffix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,OAAO,EAAE,MAAM,cAAc,CAAC;AAM/D,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAW/I,wDAAwD;AACxD,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,UAAU,OAAO,KAAG,WAAW,EAQzE,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAU3B,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { escapeRegExp } from "../orthography.js";
2
+ import { quoteAround } from "./quote-around.js";
3
+ /** 数の終わりのうち、語彙表の組にある最も長いものに付く字。 */
4
+ const suffixesFor = (digits, suffixes) => {
5
+ const ending = suffixes
6
+ .map((entry) => entry.group ?? "")
7
+ .filter((group) => digits.endsWith(group))
8
+ .reduce((longest, group) => (group.length > longest.length ? group : longest), "");
9
+ return suffixes.filter((entry) => (entry.group ?? "") === ending).map((entry) => entry.pattern);
10
+ };
11
+ /** 文字列の中の、数と字の合わない序数。語や番号の一部(v1th、0x2nd、1-2th)は読まない。 */
12
+ export const ordinalSlips = (text, suffixes) => {
13
+ const written = [...new Set(suffixes.map((entry) => entry.pattern))];
14
+ if (written.length === 0)
15
+ return [];
16
+ const pattern = new RegExp(`(?<![\\p{L}\\p{N}_.,\\-])(?<n>\\d+(?:,\\d{3})*)(?<suffix>${written.map(escapeRegExp).join("|")})(?![\\p{L}\\p{N}_])`, "gu");
17
+ return [...text.matchAll(pattern)].flatMap((match) => {
18
+ const expected = suffixesFor((match.groups?.["n"] ?? "").replaceAll(",", ""), suffixes);
19
+ return expected.includes(match.groups?.["suffix"] ?? "") ? [] : [{ offset: match.index, written: match[0], number: match.groups?.["n"] ?? "", expected }];
20
+ });
21
+ };
22
+ export const ordinalSuffix = (doc) => {
23
+ const text = doc.prose ?? doc.source;
24
+ return ordinalSlips(text, doc.lexicons["ordinal-suffix"] ?? []).map((slip) => ({
25
+ rule: "",
26
+ severity: "warning",
27
+ line: 0,
28
+ column: 0,
29
+ quote: quoteAround(text, slip.offset, slip.offset + slip.written.length),
30
+ values: { written: slip.written, expected: `${slip.number}${slip.expected[0] ?? ""}`, offset: slip.offset },
31
+ }));
32
+ };
33
+ //# sourceMappingURL=ordinal-suffix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ordinal-suffix.js","sourceRoot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,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;KAC5G,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Detector } from "../plugin.ts";
2
+ /** 数の範囲 1 つ。form は二つの数のあいだの記号。 */
3
+ export type WrittenRange = {
4
+ readonly offset: number;
5
+ readonly written: string;
6
+ readonly form: string;
7
+ };
8
+ /**
9
+ * 文字列の中の数の範囲。前後にさらに数が続く並び(日付 2026-10-02、電話番号、時刻 10:00、版 1.2-3)は範囲ではない。
10
+ * 終わりが始まりより小さいもの(郵便番号 100-0001、試合の 3-2)も範囲ではない。ambiguous の記号は、後ろに単位や語が続き、
11
+ * 前が番号の札(図 2-1、Section 1-2、NSF 13-542)でないときだけ。
12
+ */
13
+ export declare const rangesIn: (text: string, marks: readonly string[], ambiguous?: readonly string[], labels?: readonly string[]) => WrittenRange[];
14
+ export declare const rangeNotation: Detector;
15
+ //# sourceMappingURL=range-notation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range-notation.d.ts","sourceRoot":"","sources":["../../src/detectors/range-notation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,cAAc,CAAC;AAQtD,kCAAkC;AAClC,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAoBxG;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,EAAE,YAAW,SAAS,MAAM,EAAO,EAAE,SAAQ,SAAS,MAAM,EAAO,KAAG,YAAY,EAoBhJ,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAmB3B,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { escapeRegExp } from "../orthography.js";
2
+ import { formMinority } from "./form-minority.js";
3
+ import { quoteAround } from "./quote-around.js";
4
+ const FULLWIDTH_OFFSET = 0xfee0;
5
+ const NUMBER = "[0-90-9]+(?:[..][0-90-9]+)?";
6
+ /** 範囲のすぐ後ろ(空白一つまで)の単位や語。番号にも使う記号(ハイフン)は、これが続くときだけ範囲と読む。 */
7
+ const UNIT_AFTER = /^\s?[\p{L}%%]/u;
8
+ /** 行の頭(見出しや箇条書きの印の後ろ)の「1-2」は節の番号、閉じ括弧のすぐ後ろの「(703) 292-7827」は電話番号。 */
9
+ const LABEL_BEFORE = /(?:^\s*[#>*+|-][\s#>*+|-]*|\)\s?)$/u;
10
+ /** 番号の前の札。語彙表の札の語(図、Section)か、頭が大文字の英語の語(NSF)。 */
11
+ const isNumberLabel = (lineBefore, labels) => {
12
+ const trimmed = lineBefore.trimEnd();
13
+ if (labels.some((label) => trimmed.endsWith(label)))
14
+ return true;
15
+ return /^\p{Lu}/u.test(trimmed.split(/\s/u).at(-1) ?? "");
16
+ };
17
+ const halfWidth = (text) => text.replace(/[0-9.]/gu, (char) => String.fromCharCode(char.charCodeAt(0) - FULLWIDTH_OFFSET));
18
+ /**
19
+ * 文字列の中の数の範囲。前後にさらに数が続く並び(日付 2026-10-02、電話番号、時刻 10:00、版 1.2-3)は範囲ではない。
20
+ * 終わりが始まりより小さいもの(郵便番号 100-0001、試合の 3-2)も範囲ではない。ambiguous の記号は、後ろに単位や語が続き、
21
+ * 前が番号の札(図 2-1、Section 1-2、NSF 13-542)でないときだけ。
22
+ */
23
+ export const rangesIn = (text, marks, ambiguous = [], labels = []) => {
24
+ if (marks.length === 0)
25
+ return [];
26
+ const joiner = marks
27
+ .toSorted((left, right) => right.length - left.length)
28
+ .map(escapeRegExp)
29
+ .join("|");
30
+ const pattern = new RegExp(`(?<![\\w0-9..,::/\\--–〜~~])(?<from>${NUMBER})\\s?(?<mark>${joiner})\\s?(?<to>${NUMBER})(?![\\w0-9]|[..,::/\\--–〜~~][0-90-9])`, "gu");
31
+ return [...text.matchAll(pattern)].flatMap((match) => {
32
+ const from = Number(halfWidth(match.groups?.["from"] ?? ""));
33
+ const to = Number(halfWidth(match.groups?.["to"] ?? ""));
34
+ const mark = match.groups?.["mark"] ?? "";
35
+ const unitFollows = UNIT_AFTER.test(text.slice(match.index + match[0].length));
36
+ const lineBefore = text.slice(text.lastIndexOf("\n", match.index - 1) + 1, match.index);
37
+ return to > from && !LABEL_BEFORE.test(lineBefore) && (!ambiguous.includes(mark) || (unitFollows && !isNumberLabel(lineBefore, labels)))
38
+ ? [{ offset: match.index, written: match[0], form: mark }]
39
+ : [];
40
+ });
41
+ };
42
+ export const rangeNotation = (doc, options) => {
43
+ const text = doc.prose ?? doc.source;
44
+ const entries = doc.lexicons["range-notation"] ?? [];
45
+ const ranges = rangesIn(text, entries.map((entry) => entry.pattern), entries.filter((entry) => entry.group === "ambiguous").map((entry) => entry.pattern), ["figure-label", "numbered-division", "numbered-label"].flatMap((id) => (doc.lexicons[id] ?? []).map((entry) => entry.pattern)));
46
+ const minority = formMinority(ranges, options.limit);
47
+ if (minority === undefined)
48
+ return [];
49
+ return minority.odd.map((range) => ({
50
+ rule: "",
51
+ severity: "info",
52
+ line: 0,
53
+ column: 0,
54
+ quote: quoteAround(text, range.offset, range.offset + range.written.length),
55
+ values: { written: range.written, mark: range.form, usual: minority.usual.written, count: minority.odd.length, of: ranges.length, offset: range.offset },
56
+ }));
57
+ };
58
+ //# sourceMappingURL=range-notation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range-notation.js","sourceRoot":"","sources":["../../src/detectors/range-notation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,M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AAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAC3E,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE;KACzJ,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=amount-for-count.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amount-for-count.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/amount-for-count.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { amountForCount } from "../amount-for-count.js";
2
+ export const detector = amountForCount;
3
+ //# sourceMappingURL=amount-for-count.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amount-for-count.js","sourceRoot":"","sources":["../../../src/detectors/registry/amount-for-count.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAa,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=currency-notation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency-notation.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/currency-notation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAA2B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { currencyNotation } from "../currency-notation.js";
2
+ export const detector = currencyNotation;
3
+ //# sourceMappingURL=currency-notation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency-notation.js","sourceRoot":"","sources":["../../../src/detectors/registry/currency-notation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,CAAC,MAAM,QAAQ,GAAa,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=dangling-opener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dangling-opener.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/dangling-opener.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { danglingOpener } from "../dangling-opener.js";
2
+ export const detector = danglingOpener;
3
+ //# sourceMappingURL=dangling-opener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dangling-opener.js","sourceRoot":"","sources":["../../../src/detectors/registry/dangling-opener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,CAAC,MAAM,QAAQ,GAAa,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=footnote-mismatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footnote-mismatch.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/footnote-mismatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAA2B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { footnoteMismatch } from "../footnote-mismatch.js";
2
+ export const detector = footnoteMismatch;
3
+ //# sourceMappingURL=footnote-mismatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footnote-mismatch.js","sourceRoot":"","sources":["../../../src/detectors/registry/footnote-mismatch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,CAAC,MAAM,QAAQ,GAAa,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=heading-end-punctuation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heading-end-punctuation.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/heading-end-punctuation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { headingEndMark } from "../heading-end-mark.js";
2
+ export const detector = headingEndMark;
3
+ //# sourceMappingURL=heading-end-punctuation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heading-end-punctuation.js","sourceRoot":"","sources":["../../../src/detectors/registry/heading-end-punctuation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAa,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=list-marker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-marker.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/list-marker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { listMarkerMix } from "../list-marker.js";
2
+ export const detector = listMarkerMix;
3
+ //# sourceMappingURL=list-marker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-marker.js","sourceRoot":"","sources":["../../../src/detectors/registry/list-marker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,CAAC,MAAM,QAAQ,GAAa,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=numeral-opener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeral-opener.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/numeral-opener.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { numeralOpener } from "../numeral-opener.js";
2
+ export const detector = numeralOpener;
3
+ //# sourceMappingURL=numeral-opener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeral-opener.js","sourceRoot":"","sources":["../../../src/detectors/registry/numeral-opener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAa,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=ordinal-suffix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ordinal-suffix.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/ordinal-suffix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ordinalSuffix } from "../ordinal-suffix.js";
2
+ export const detector = ordinalSuffix;
3
+ //# sourceMappingURL=ordinal-suffix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ordinal-suffix.js","sourceRoot":"","sources":["../../../src/detectors/registry/ordinal-suffix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAa,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=range-notation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range-notation.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/range-notation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { rangeNotation } from "../range-notation.js";
2
+ export const detector = rangeNotation;
3
+ //# sourceMappingURL=range-notation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range-notation.js","sourceRoot":"","sources":["../../../src/detectors/registry/range-notation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAa,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=relative-pronoun-mix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relative-pronoun-mix.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/relative-pronoun-mix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { relativePronounMix } from "../relative-pronoun-mix.js";
2
+ export const detector = relativePronounMix;
3
+ //# sourceMappingURL=relative-pronoun-mix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relative-pronoun-mix.js","sourceRoot":"","sources":["../../../src/detectors/registry/relative-pronoun-mix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,CAAC,MAAM,QAAQ,GAAa,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=share-over-hundred.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-over-hundred.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/share-over-hundred.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAA2B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { shareOverHundred } from "../share-over-hundred.js";
2
+ export const detector = shareOverHundred;
3
+ //# sourceMappingURL=share-over-hundred.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-over-hundred.js","sourceRoot":"","sources":["../../../src/detectors/registry/share-over-hundred.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,CAAC,MAAM,QAAQ,GAAa,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Detector } from "../../plugin.ts";
2
+ export declare const detector: Detector;
3
+ //# sourceMappingURL=step-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-reference.d.ts","sourceRoot":"","sources":["../../../src/detectors/registry/step-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ,EAAE,QAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { stepReference } from "../step-reference.js";
2
+ export const detector = stepReference;
3
+ //# sourceMappingURL=step-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-reference.js","sourceRoot":"","sources":["../../../src/detectors/registry/step-reference.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAa,aAAa,CAAC"}