See also soundex(), similar_text(), and metaphone().
The user-supplied function approach offers the possibility to take into account the relevance of and/or difference between certain symbols (characters) or even the context those symbols appear in to determine the cost of insert, replace and delete operations, but at the cost of loosing all optimizations done regarding cpu register utilization and cache misses that have been worked into the other two variants.