[api] Using bools instead of bit fields in the public API
This commit is contained in:
@@ -37,27 +37,27 @@ static normalize_options_t LIBPOSTAL_DEFAULT_OPTIONS = {
|
|||||||
.languages = NULL,
|
.languages = NULL,
|
||||||
.num_languages = 0,
|
.num_languages = 0,
|
||||||
.address_components = ADDRESS_NAME | ADDRESS_HOUSE_NUMBER | ADDRESS_STREET | ADDRESS_UNIT,
|
.address_components = ADDRESS_NAME | ADDRESS_HOUSE_NUMBER | ADDRESS_STREET | ADDRESS_UNIT,
|
||||||
.latin_ascii = 1,
|
.latin_ascii = true,
|
||||||
.transliterate = 1,
|
.transliterate = true,
|
||||||
.strip_accents = 1,
|
.strip_accents = true,
|
||||||
.decompose = 1,
|
.decompose = true,
|
||||||
.lowercase = 1,
|
.lowercase = true,
|
||||||
.trim_string = 1,
|
.trim_string = true,
|
||||||
.drop_parentheticals = 1,
|
.drop_parentheticals = true,
|
||||||
.replace_numeric_hyphens = 0,
|
.replace_numeric_hyphens = false,
|
||||||
.delete_numeric_hyphens = 0,
|
.delete_numeric_hyphens = false,
|
||||||
.split_alpha_from_numeric = 1,
|
.split_alpha_from_numeric = true,
|
||||||
.replace_word_hyphens = 1,
|
.replace_word_hyphens = true,
|
||||||
.delete_word_hyphens = 1,
|
.delete_word_hyphens = true,
|
||||||
.delete_final_periods = 1,
|
.delete_final_periods = true,
|
||||||
.delete_acronym_periods = 1,
|
.delete_acronym_periods = true,
|
||||||
.drop_english_possessives = 1,
|
.drop_english_possessives = true,
|
||||||
.delete_apostrophes = 1,
|
.delete_apostrophes = true,
|
||||||
.expand_numex = 1,
|
.expand_numex = true,
|
||||||
.roman_numerals = 1
|
.roman_numerals = true
|
||||||
};
|
};
|
||||||
|
|
||||||
inline normalize_options_t get_libpostal_default_options(void) {
|
normalize_options_t get_libpostal_default_options(void) {
|
||||||
return LIBPOSTAL_DEFAULT_OPTIONS;
|
return LIBPOSTAL_DEFAULT_OPTIONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,24 +41,24 @@ typedef struct normalize_options {
|
|||||||
uint16_t address_components;
|
uint16_t address_components;
|
||||||
|
|
||||||
// String options
|
// String options
|
||||||
uint64_t latin_ascii:1;
|
bool latin_ascii;
|
||||||
uint64_t transliterate:1;
|
bool transliterate;
|
||||||
uint64_t strip_accents:1;
|
bool strip_accents;
|
||||||
uint64_t decompose:1;
|
bool decompose;
|
||||||
uint64_t lowercase:1;
|
bool lowercase;
|
||||||
uint64_t trim_string:1;
|
bool trim_string;
|
||||||
uint64_t drop_parentheticals:1;
|
bool drop_parentheticals;
|
||||||
uint64_t replace_numeric_hyphens:1;
|
bool replace_numeric_hyphens;
|
||||||
uint64_t delete_numeric_hyphens:1;
|
bool delete_numeric_hyphens;
|
||||||
uint64_t split_alpha_from_numeric:1;
|
bool split_alpha_from_numeric;
|
||||||
uint64_t replace_word_hyphens:1;
|
bool replace_word_hyphens;
|
||||||
uint64_t delete_word_hyphens:1;
|
bool delete_word_hyphens;
|
||||||
uint64_t delete_final_periods:1;
|
bool delete_final_periods;
|
||||||
uint64_t delete_acronym_periods:1;
|
bool delete_acronym_periods;
|
||||||
uint64_t drop_english_possessives:1;
|
bool drop_english_possessives;
|
||||||
uint64_t delete_apostrophes:1;
|
bool delete_apostrophes;
|
||||||
uint64_t expand_numex:1;
|
bool expand_numex;
|
||||||
uint64_t roman_numerals:1;
|
bool roman_numerals;
|
||||||
|
|
||||||
} normalize_options_t;
|
} normalize_options_t;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user