mlx-bun library API
    Preparing search index...

    In-memory variant resolver over a KNOWN-ENTITY set. Indexes each canonical by its normal-form stem, its squeeze key, and its content tokens, then resolves a surface through stem → squeeze → alias → token-subset-fuzzy, minting a new canonical only when every layer misses.

    Construct from a seed list, from a MemoryStore (entities + entity_aliases), or from the curated gold — and compose them (store first, gold to backfill notable brand-only aliases).

    Index
    • Resolve a surface to an EXISTING canonical, or null if every layer misses. Pure: never mutates the index.

      Parameters

      • surface: string

      Returns { matched: MatchKind; name: string } | null

    • Register a canonical and its aliases into every index. Idempotent; adding aliases to an existing canonical merges them. The canonical's own surface is always indexed as an alias of itself.

      Parameters

      • canonical: string
      • aliases: string[] = []

      Returns void

    • Resolve a surface, MINTING a new canonical when nothing matches. The minted canonical is the cleaned surface; it is registered so later variants of the same thing fold onto it. Brand-only nicknames still need a gold/store seed — fuzzy cannot invent a "" ≡ "" link from lexis alone.

      Parameters

      • surface: string
      • OptionalmintName: string

      Returns ResolveResult

    • Register one canonical per stem with its alias surfaces, grouped from a normalized alias → stem map (the read-index's aliasToStem). The stem is the canonical; its surfaces become aliases.

      Parameters

      • aliasToStem: Iterable<readonly [string, string]>

      Returns EntityResolver