[api] Adding LIBPOSTAL_DEFAULT_OPTIONS to libpostal.h

This commit is contained in:
Al
2015-09-25 01:53:29 -04:00
parent f5bb72c6f5
commit 5a6b47d0fd
2 changed files with 26 additions and 22 deletions

View File

@@ -57,6 +57,30 @@ typedef struct normalize_options {
} normalize_options_t;
static normalize_options_t LIBPOSTAL_DEFAULT_OPTIONS = {
.num_languages = 1,
.languages = NULL,
.address_components = ADDRESS_HOUSE_NUMBER | ADDRESS_STREET | ADDRESS_UNIT,
.latin_ascii = 1,
.transliterate = 1,
.strip_accents = 1,
.decompose = 1,
.lowercase = 1,
.trim_string = 1,
.replace_word_hyphens = 1,
.delete_word_hyphens = 1,
.replace_numeric_hyphens = 0,
.delete_numeric_hyphens = 0,
.split_alpha_from_numeric = 1,
.delete_final_periods = 1,
.delete_acronym_periods = 1,
.drop_english_possessives = 1,
.delete_apostrophes = 1,
.expand_numex = 1,
.roman_numerals = 1
};
char **expand_address(char *input, normalize_options_t options, uint64_t *n);
bool libpostal_setup(void);

View File

@@ -25,28 +25,8 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
normalize_options_t options = {
.num_languages = 1,
.languages = languages,
.address_components = ADDRESS_HOUSE_NUMBER | ADDRESS_STREET | ADDRESS_UNIT,
.latin_ascii = 1,
.transliterate = 1,
.strip_accents = 1,
.decompose = 1,
.lowercase = 1,
.trim_string = 1,
.replace_word_hyphens = 1,
.delete_word_hyphens = 1,
.replace_numeric_hyphens = 0,
.delete_numeric_hyphens = 0,
.split_alpha_from_numeric = 1,
.delete_final_periods = 1,
.delete_acronym_periods = 1,
.drop_english_possessives = 1,
.delete_apostrophes = 1,
.expand_numex = 1,
.roman_numerals = 1
};
normalize_options_t options = LIBPOSTAL_DEFAULT_OPTIONS;
options.languages = languages;
uint64_t num_expansions;