navit
0.5.3-trunk
|
Go to the source code of this file.
Macros | |
#define | LINGUISTICS_WORD_SEPARATORS_ASCII " -/()'`" |
Enumerations | |
enum | linguistics_cmp_mode { linguistics_cmp_expand =1 , linguistics_cmp_partial =2 , linguistics_cmp_words =4 } |
Functions | |
char * | linguistics_expand_special (const char *str, int mode) |
Replace special characters in string (e.g. umlauts) with plain letters. This is useful e.g. to canonicalize a string for comparison. More... | |
char * | linguistics_next_word (char *str) |
void | linguistics_init (void) |
void | linguistics_free (void) |
char * | linguistics_casefold (const char *in) |
int | linguistics_search (const char *str) |
int | linguistics_compare (const char *s1, const char *s2, enum linguistics_cmp_mode mode) |
Compare two strings, trying to replace special characters (e.g. umlauts) in first string with plain letters. More... | |
#define LINGUISTICS_WORD_SEPARATORS_ASCII " -/()'`" |
enum linguistics_cmp_mode |
char* linguistics_casefold | ( | const char * | in | ) |
References casefold_hash, dbg, startup::dest, and lvl_error.
Referenced by binmap_search_new(), country_search_new(), gui_internal_get_match_quality(), item_bin_sort_compare(), linguistics_compare(), navigation_cmd_get_exit_announce(), and removecase().
int linguistics_compare | ( | const char * | s1, |
const char * | s2, | ||
enum linguistics_cmp_mode | mode | ||
) |
Compare two strings, trying to replace special characters (e.g. umlauts) in first string with plain letters.
s1 | First string to process, for example, an item name from the map. Will be linguistics_casefold()ed before comparison. |
s2 | Second string to process, usually user supplied search string. Should be linguistics_casefold()ed before calling this function. |
mode | set to composition of linguistics_cmp_mode flags to have s1 linguistics_expand_special()ed, allow matches shorter than whole s1, or |
let | matches start from any word boundary within s1 |
References linguistics_casefold(), linguistics_cmp_expand, linguistics_cmp_partial, linguistics_cmp_words, linguistics_expand_special(), linguistics_next_word(), and s1.
Referenced by binmap_search_get_item(), map_parse_country_binfile(), and match().
char* linguistics_expand_special | ( | const char * | str, |
int | mode | ||
) |
Replace special characters in string (e.g. umlauts) with plain letters. This is useful e.g. to canonicalize a string for comparison.
str | string to process |
mode | Replacement mode. 0=do nothing, 1=replace with single UTF character, 2=replace with multiple letters if the commonly used replacement has multitple letter (e.g. a-umlaut -> ae) |
References dbg, linguistics_get_special(), lvl_debug, match(), and next.
Referenced by gui_internal_cmd_pois_item_selected(), gui_internal_find_next_possible_key(), gui_internal_get_match_quality(), item_bin_write_match(), and linguistics_compare().
void linguistics_free | ( | void | ) |
References casefold_hash, and special_hash.
Referenced by main_real().
void linguistics_init | ( | void | ) |
References casefold_hash, linguistics_dup_utf8_char(), s1, special, special_hash, and upperlower.
Referenced by main(), and main_real().
char* linguistics_next_word | ( | char * | str | ) |
References LINGUISTICS_WORD_SEPARATORS_ASCII.
Referenced by item_bin_write_match(), and linguistics_compare().
int linguistics_search | ( | const char * | str | ) |
Referenced by item_bin_write_match().