Module guih.lib.fuzzy_find
Functions for sorting and comparing strings in an "average" match way instead of fully comparing and providing similarity values
Functions
fuzzy_match (str, pattern) | compares 2 strings and returns the percentage of similarity |
sort_strings (tbl, pattern) | sorts table by its keys depending on similiariry of the key to the pattern |
Functions
- fuzzy_match (str, pattern)
-
compares 2 strings and returns the percentage of similarity
Parameters:
- str string the string to compare with the pattern
- pattern string the pattern to compare the string with. pretty much just another string
Returns:
-
number
percentage of similarity
- sort_strings (tbl, pattern)
-
sorts table by its keys depending on similiariry of the key to the pattern
Parameters:
Returns:
-
table
sorted table