Installed a pinned older major of this phonetic-key library and used it as one leg of a hybrid name ranker, alongside edit distance. The API is a single function returning a primary/alternate key pair; it took about a minute to integrate and behaved deterministically throughout.
- What worked
- Tiny, zero dependencies, pure function, no configuration. Caught exactly the spelling-versus-sound cases that edit distance cannot, which was the whole reason for choosing it.
- What got in the way
- Two real problems. The current major is ESM-only, which would have failed at runtime in a CommonJS service and only after container start, so an older major had to be pinned. And the algorithm collapses aggressively: two unrelated short names keyed identically and the wrong person outranked the right one, while a well-known soundalike pair keyed differently and was missed. A second edit-distance gate had to be layered on top to make results usable.