Skip to content

Commit c2607e0

Browse files
committed
test: update structured render contracts
1 parent 4de9054 commit c2607e0

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

data/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ bun run extract:readings -- --full
2020
```
2121

2222
Files:
23-
- `koktai-sinogram-readings.jsonl` — per-sinogram blocks.
24-
- `koktai-word-readings.jsonl` — word entries with reduced 台語 tokens.
25-
- `extract-stats.json` — corpus counters and coverage.
26-
- `extract-anomalies.jsonl` — preserved parse/round-trip anomaly records.
27-
- `koktai-pron.tei.xml` — TEI pronunciation/usg layer for sinogram blocks.
23+
- koktai-sinogram-readings.jsonl — per-sinogram blocks.
24+
- koktai-word-readings.jsonl — word entries with reduced 台語 tokens.
25+
- extract-stats.json — corpus counters and coverage.
26+
- extract-anomalies.jsonl — preserved parse/round-trip anomaly records.
27+
- koktai-pron.tei.xml — TEI pronunciation/usg layer for sinogram blocks.
2828

29-
Current committed extraction stats: 26 volumes, 31,143 sinogram blocks, 34,382 word records, 45,067 senses, 31,061 parsed reading lines, 480,942 reading values, 0 round-trip failures, 0 anomalies.
29+
Current extraction stats: 26 volumes, 11,810 sinogram blocks, 34,382 word records, 45,067 senses, 31,143 reading lines, 31,061 parsed reading lines, 480,942 reading values, 0 round-trip failures, 0 anomalies.

scripts/extract-readings.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Regenerate:
142142
143143
\`\`\`bash
144144
bun run extract:readings
145+
bun run export:tei
145146
\`\`\`
146147
147148
Optional full token streams (gitignored):
@@ -151,10 +152,13 @@ bun run extract:readings -- --full
151152
\`\`\`
152153
153154
Files:
154-
- \`koktai-sinogram-readings.jsonl\` — per-sinogram blocks
155-
- \`koktai-word-readings.jsonl\` — word entries (reduced taigi)
156-
- \`extract-stats.json\` — corpus counters
157-
- \`extract-anomalies.jsonl\` — parse/roundtrip issues
155+
- koktai-sinogram-readings.jsonl — per-sinogram blocks.
156+
- koktai-word-readings.jsonl — word entries with reduced 台語 tokens.
157+
- extract-stats.json — corpus counters and coverage.
158+
- extract-anomalies.jsonl — preserved parse/round-trip anomaly records.
159+
- koktai-pron.tei.xml — TEI pronunciation/usg layer for sinogram blocks.
160+
161+
Current extraction stats: ${result.stats.volumes} volumes, ${result.stats.sinograms.toLocaleString("en-US")} sinogram blocks, ${result.stats.words.toLocaleString("en-US")} word records, ${result.stats.senses.toLocaleString("en-US")} senses, ${result.stats.readingLines.toLocaleString("en-US")} reading lines, ${result.stats.readingLinesParsed.toLocaleString("en-US")} parsed reading lines, ${result.stats.readings.toLocaleString("en-US")} reading values, ${result.stats.roundtripFailures} round-trip failures, ${result.stats.anomalies} anomalies.
158162
`;
159163

160164
writeFileSync(join(outDir, "README.md"), readme, "utf8");

tests/render-contract.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const indexPageSource = readFileSync("src/pages/index.astro", "utf8");
88

99
describe("dictionary render contracts", () => {
1010
test("volume ranges use wave dash between bopomofo syllables", () => {
11-
expect(volumePageSource).toContain("${sections[0].syllable}~${sections[sections.length - 1].syllable}");
12-
expect(volumePageSource).not.toContain("${sections[0].syllable}—${sections[sections.length - 1].syllable}");
11+
expect(volumePageSource).toContain("${railSections[0]!.syllable}~${railSections[railSections.length - 1]!.syllable}");
12+
expect(volumePageSource).not.toContain("${railSections[0]!.syllable}—${railSections[railSections.length - 1]!.syllable}");
1313
expect(indexPageSource).toContain("{v.first}~{v.last}");
1414
expect(indexPageSource).not.toContain("{v.first}—{v.last}");
1515
});

0 commit comments

Comments
 (0)