[api] Default options accessible through getters, not static structs

This commit is contained in:
Al
2016-02-15 17:16:21 -05:00
parent f5ae95eb70
commit cf2a79bef1
6 changed files with 52 additions and 39 deletions

View File

@@ -62,29 +62,7 @@ typedef struct normalize_options {
} normalize_options_t;
static normalize_options_t LIBPOSTAL_DEFAULT_OPTIONS = {
NULL, // languages
0, // num_languages
ADDRESS_NAME | ADDRESS_HOUSE_NUMBER | ADDRESS_STREET | ADDRESS_UNIT, // address_components
1, // latin_ascii
1, // transliterate
1, // strip_accents
1, // decompose
1, // lowercase
1, // trim_string
1, // drop_parentheticals
0, // replace_numeric_hyphens
0, // delete_numeric_hyphens
1, // split_alpha_from_numeric
1, // replace_word_hyphens
1, // delete_word_hyphens
1, // delete_final_periods
1, // delete_acronym_periods
1, // drop_english_possessives
1, // delete_apostrophes
1, // expand_numex
1 // roman_numerals
};
normalize_options_t get_libpostal_default_options(void);
char **expand_address(char *input, normalize_options_t options, size_t *n);
@@ -103,17 +81,12 @@ typedef struct address_parser_options {
char *country;
} address_parser_options_t;
static address_parser_options_t LIBPOSTAL_ADDRESS_PARSER_DEFAULT_OPTIONS = {
NULL, // language
NULL // country
};
void address_parser_response_destroy(address_parser_response_t *self);
address_parser_options_t get_libpostal_address_parser_default_options(void);
address_parser_response_t *parse_address(char *address, address_parser_options_t options);
// Setup/teardown methods