Fuzzy-matching a nickname in chat
💬 General•Updated 2 days ago•0 views
Use Levenshtein distance - it returns how many edits turn one string into another. Keep a nickname list, lowercase the input, find the closest match and accept …
How to detect when someone says my name with different spelling/pronunciation
Use Levenshtein distance - it returns how many edits turn one string into another. Keep a nickname list, lowercase the input, find the closest match and accept it if distance < threshold (e.g. 2). There's a ready implementation in lazy-lua's string.lua.