[expand] adding improvements to root expansions (using possible phrase roots even if they're abbreviated e.g. "E Ctr St", adding special valid components check for root expansions beyond what's stored in the build address dictionaries), removing spaces before checking unique strings, only splitting numeric from alpha in the case of non-ordinals, using cstring_array internally and char ** in the public API

This commit is contained in:
Al
2017-12-25 01:37:29 -05:00
parent b4ce042f80
commit 152761fcbc
3 changed files with 121 additions and 57 deletions

View File

@@ -48,9 +48,9 @@ typedef enum {
DELETE_PHRASES
} expansion_phrase_option_t;
char **expand_address(char *input, libpostal_normalize_options_t options, size_t *n);
char **expand_address_phrase_option(char *input, libpostal_normalize_options_t options, size_t *n, expansion_phrase_option_t phrase_option);
char **expand_address_root(char *input, libpostal_normalize_options_t options, size_t *n);
cstring_array *expand_address(char *input, libpostal_normalize_options_t options, size_t *n);
cstring_array *expand_address_phrase_option(char *input, libpostal_normalize_options_t options, size_t *n, expansion_phrase_option_t phrase_option);
cstring_array *expand_address_root(char *input, libpostal_normalize_options_t options, size_t *n);
void expansion_array_destroy(char **expansions, size_t n);
#endif