?
DictionaryReport
TypeA committed dictionary version: counts, ambiguous names, and names that cannot match.
What a push returns and what dictionary() reads back. Beyond the version and counts, check three fields after every push. ambiguousNames and mostClaimed show names that several ids share (a passage naming one is tagged with every claimant). unmatchable lists names that can never match their own text as written; fix these in the source data. A push result adds unchanged, which is true when the dictionary was already the committed one.
DictionaryReport.ts
interface DictionaryReport { version: number linkerVersion: number entries: number names: number ambiguousNames: number mostClaimed: { key: string; name?: string; ids: number }[] unmatchable: { count: number; examples: string[] } committedAt: string }
Fields
version
number
The committed dictionary version.
linkerVersion
number
The matching rule its names were keyed under.
entries / names
number
How many entries and names it holds.
ambiguousNames
number
Names more than one id claims. A passage naming one is tagged with every claimant.
mostClaimed
{ key, name?, ids }[]
The names the most ids claim, as pushed and as the linker matches them.
unmatchable
{ count, examples }
Names that can never match their own text as written. Fix these in the source data.
unchanged
boolean
On a push result only: true when the dictionary was already the committed one.
Check a push
const r = await Manuals.pushDictionary(entries); if (r.ambiguousNames) console.warn(r.mostClaimed); if (r.unmatchable.count) console.warn(r.unmatchable.examples);