Files
Claude c4ab97b75e Customer search: bundled nickname data and sound-alike matching
- Nicknames now come from the carltonnorthern/nicknames data set
  (Apache 2.0, ~2,800 pairs, bundled in data/nicknames with its license),
  plus a few extra groups in EXTRA_NICKNAME_GROUPS. Names match if
  directly linked, or if both are short for the same longer name, so
  Bill/William and Bill/Will match but William/Robert don't (the data
  lists "bill" for both)
- Double Metaphone (text gem) matches names that sound alike but are
  spelled differently: Jon/John, Smyth/Smith, Cathy/Kathy,
  Steven/Stephen, Jeffrey/Geoffrey
- Faster ranking: per-search word-pair scores are cached, whole-name
  comparison only runs when it can succeed, and prepared search data is
  kept in process memory until a customer changes (~40 ms per search at
  5,000 customers)

Adds gem 'text', '~> 1.3' to the Gemfile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-28 22:22:00 -04:00
..

Nickname data

names.csv is from the nicknames project by Carlton Northern and contributors (commit ed160b3), used under the Apache License 2.0 (see LICENSE.txt). It is unmodified.

Each row is name1,has_nickname,name2. CustomerSearchService uses it so that a search for "Bill Smith" finds "William Smith". To update it, replace names.csv with a newer copy from the project; extra name groups can also be added in CustomerSearchService::EXTRA_NICKNAME_GROUPS.