[fix] Adding country_region to address_parser_train
This commit is contained in:
@@ -82,7 +82,8 @@ with the general error-driven averaged perceptron.
|
||||
#define ADDRESS_COMPONENT_STATE_DISTRICT 1 << 11
|
||||
#define ADDRESS_COMPONENT_STATE 1 << 12
|
||||
#define ADDRESS_COMPONENT_POSTAL_CODE 1 << 13
|
||||
#define ADDRESS_COMPONENT_COUNTRY 1 << 14
|
||||
#define ADDRESS_COMPONENT_COUNTRY_REGION 1 << 14
|
||||
#define ADDRESS_COMPONENT_COUNTRY 1 << 15
|
||||
|
||||
typedef enum {
|
||||
ADDRESS_PARSER_HOUSE,
|
||||
|
||||
@@ -34,6 +34,7 @@ static inline bool is_phrase_component(char *label) {
|
||||
string_equals(label, ADDRESS_PARSER_LABEL_ISLAND) ||
|
||||
string_equals(label, ADDRESS_PARSER_LABEL_STATE) ||
|
||||
string_equals(label, ADDRESS_PARSER_LABEL_POSTAL_CODE) ||
|
||||
string_equals(label, ADDRESS_PARSER_LABEL_COUNTRY_REGION) ||
|
||||
string_equals(label, ADDRESS_PARSER_LABEL_COUNTRY));
|
||||
}
|
||||
|
||||
@@ -182,6 +183,9 @@ address_parser_t *address_parser_init(char *filename) {
|
||||
} else if (string_equals(prev_label, ADDRESS_PARSER_LABEL_COUNTRY)) {
|
||||
class_id = ADDRESS_PARSER_COUNTRY;
|
||||
component = ADDRESS_COMPONENT_COUNTRY;
|
||||
} else if (string_equals(prev_label, ADDRESS_PARSER_LABEL_COUNTRY_REGION)) {
|
||||
class_id = ADDRESS_PARSER_COUNTRY_REGION;
|
||||
component = ADDRESS_COMPONENT_COUNTRY;
|
||||
} else if (string_equals(prev_label, ADDRESS_PARSER_LABEL_STATE_DISTRICT)) {
|
||||
class_id = ADDRESS_PARSER_STATE_DISTRICT;
|
||||
component = ADDRESS_COMPONENT_STATE_DISTRICT;
|
||||
|
||||
Reference in New Issue
Block a user