/** * How much of each course has a gloss, per interface language. * * pnpm run glosses:coverage * * Counted against what the course actually shows (`glossable`), so a word * added without its gloss lowers the number here the same day. */ import { COURSES } from "../lib/course/registry.ts"; import { coverageOf, glossable } from "../lib/domain/meaning/coverage.ts"; import { PACK_ITEMS } from "../lib/domain/practice/published.ts"; import { SITUATIONS } from "../lib/situations/active.ts"; import { VARIETY } from "../lib/variety/active.ts"; import { glossLocales, loadGlosses } from "../lib/variety/packs/glosses/index.ts"; const expected = glossable(VARIETY, SITUATIONS, PACK_ITEMS); for (const course of COURSES) { for (const locale of glossLocales(course.id)) { const set = (await loadGlosses(course.id, locale))!; const review = set.provenance.reviewed ? "reviewed" : "not reviewed"; console.log(`${course.id} · ${locale} · ${set.provenance.by}, ${review}, ${set.provenance.date}`); for (const { section, glossed, total } of coverageOf(set, expected)) { const share = total === 0 ? "—" : `${Math.round((glossed / total) * 100)}%`; console.log(` ${section.padEnd(10)} ${String(glossed).padStart(4)} / ${String(total).padEnd(4)} ${share}`); } } }