Skip to content

Commit

Permalink
[fix] in root expansions, removing phrases that are invalid for the g…
Browse files Browse the repository at this point in the history
…iven components if there are other ignorable components
  • Loading branch information
albarrentine committed Jan 2, 2018
1 parent d8a0a34 commit 071aee0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/expand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@ string_tree_t *add_string_alternatives_phrase_option(char *str, libpostal_normal
if (delete_phrases) {
bool is_ignorable = address_expansion_is_ignorable_for_components(expansion, options.address_components);
bool is_canonical = expansion.canonical_index == NULL_CANONICAL_INDEX;
bool is_valid_for_components = address_expansion_is_valid_for_components(expansion, options.address_components);

log_debug("is_ignorable = %d, is_canonical = %d, is_ambiguous = %d, current_phrase_have_ambiguous = %d, current_phrase_have_unambiguous = %d, have_strictly_ignorable = %d, current_phrase_have_ignorable=%d, current_phrase_have_possible_root=%d\n", is_ignorable, is_canonical, is_ambiguous, current_phrase_have_ambiguous, current_phrase_have_unambiguous, have_strictly_ignorable, current_phrase_have_ignorable, current_phrase_have_possible_root);

Expand Down Expand Up @@ -1141,6 +1142,10 @@ string_tree_t *add_string_alternatives_phrase_option(char *str, libpostal_normal

log_debug("current_phrase_have_ambiguous && have_non_phrase_tokens\n");
log_debug("current_phrase_ignorable = %d\n", current_phrase_ignorable);
} else if (!is_valid_for_components) {
log_debug("!is_valid_for_components\n");
current_phrase_ignorable = current_phrase_have_ignorable;
log_debug("current_phrase_ignorable = %d\n", current_phrase_ignorable);
} else {
log_debug("none of the above\n");
}
Expand Down

1 comment on commit 071aee0

@Maurice-Betzel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was running a JavaCPP build this morning on the master branch and it was failing on linking. You just committed this branch and now the build is functional again.

Please sign in to comment.