Created
September 15, 2012 15:30
-
-
Save ssrihari/3728472 to your computer and use it in GitHub Desktop.
Fuzzy search method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static gboolean | |
fuzzy_search ( gchar *string, | |
gchar *key) | |
{ | |
gchar *remaining_string = string; | |
if ( strlen(key) == 0 ) | |
return TRUE; | |
if ( (remaining_string = strchr(string, key[0])) != NULL ) | |
return fuzzy_search( remaining_string+1, key+1 ); | |
else | |
return FALSE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment