-
-
Notifications
You must be signed in to change notification settings - Fork 292
Fuzzy Match
According to wikipedia fuzzy matching is a technique used in computer-assisted translation as a special case of record linkage. It works with matches that may be less than 100% perfect when finding correspondences between segments of a text and entries in a database of previous translations.
TNTSearch provides helper functions to achieve this functionality. If you're familiar with Sublime Text editor you probably love the search feature that implements a similar algorithm.
The fuzzyMatch and fuzzyMatchFromFile functions first check if there is a common subsequence between two strings and if so, it converts the strings to vectors and calculates the angle between them. If the angle is 0, it's a 100% match because the strings are equal, otherwise, it returns how similar those two strings are.
fuzzyMatch('search', ['search', 'research', 'something']);
returns an array of strings with a score that match the search query