Oh the memories. I remember using this to do entity reconciliation (~deduplication in this case) of multiple data sources based on unstructured textual user input in production some years ago. It was a nightmare but the Levenshtein function (which is available in Postgresql and where I used to pre-filter some of the entities) and other string similarities helped a bunch. Good times :') OP makes a great job of explaining the code behind it, great article!