[expansion] Adding search_address_dictionaries_prefix/suffix for concatenated prefixes/suffixes e.g. in Germanic languages. Adding a flag to the address_expansion struct and trie value to denote separability, adding prefix/suffix keys during dictionary creation
This commit is contained in:
@@ -29,8 +29,9 @@ typedef union expansion_value {
|
||||
uint32_t value;
|
||||
struct {
|
||||
uint32_t components:16;
|
||||
uint32_t count:15;
|
||||
uint32_t count:14;
|
||||
uint32_t canonical:1;
|
||||
uint32_t separable:1;
|
||||
};
|
||||
} expansion_value_t;
|
||||
|
||||
@@ -40,6 +41,7 @@ typedef struct address_expansion {
|
||||
uint32_t num_dictionaries;
|
||||
uint16_t dictionary_ids[MAX_DICTIONARY_TYPES];
|
||||
uint16_t address_components;
|
||||
bool separable;
|
||||
} address_expansion_t;
|
||||
|
||||
VECTOR_INIT(address_expansion_array, address_expansion_t)
|
||||
@@ -59,11 +61,14 @@ bool address_dictionary_init(void);
|
||||
phrase_array *search_address_dictionaries(char *str, char *lang);
|
||||
phrase_array *search_address_dictionaries_tokens(char *str, token_array *tokens, char *lang);
|
||||
|
||||
phrase_t search_address_dictionaries_prefix(char *str, size_t len, char *lang);
|
||||
phrase_t search_address_dictionaries_suffix(char *str, size_t len, char *lang);
|
||||
|
||||
address_expansion_array *address_dictionary_get_expansions(char *key);
|
||||
char *address_dictionary_get_canonical(uint32_t index);
|
||||
int32_t address_dictionary_next_canonical_index(void);
|
||||
bool address_dictionary_add_canonical(char *canonical);
|
||||
bool address_dictionary_add_expansion(char *key, address_expansion_t expansion);
|
||||
bool address_dictionary_add_expansion(char *key, char *language, address_expansion_t expansion);
|
||||
|
||||
void address_dictionary_destroy(address_dictionary_t *self);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user