|
|
|
@ -94,7 +94,8 @@ function checkForDealBreakers(req, hit) {
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (check.assigned(req.clean.parsed_text.state) && hit.parent.region_a && req.clean.parsed_text.state !== hit.parent.region_a[0]) { |
|
|
|
|
if (check.assigned(req.clean.parsed_text.state) && check.assigned(hit.parent) && |
|
|
|
|
hit.parent.region_a && req.clean.parsed_text.state !== hit.parent.region_a[0]) { |
|
|
|
|
logger.debug('[confidence][deal-breaker]: state !== region_a'); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
@ -220,8 +221,8 @@ function checkAddress(text, hit) {
|
|
|
|
|
res += propMatch(text.number, (hit.address_parts ? hit.address_parts.number : null), false); |
|
|
|
|
res += propMatch(text.street, (hit.address_parts ? hit.address_parts.street : null), false); |
|
|
|
|
res += propMatch(text.postalcode, (hit.address_parts ? hit.address_parts.zip: null), true); |
|
|
|
|
res += propMatch(text.state, (hit.parent.region_a ? hit.parent.region_a[0] : null), true); |
|
|
|
|
res += propMatch(text.country, (hit.parent.country_a ? hit.parent.country_a[0] :null), true); |
|
|
|
|
res += propMatch(text.state, ((hit.parent && hit.parent.region_a) ? hit.parent.region_a[0] : null), true); |
|
|
|
|
res += propMatch(text.country, ((hit.parent && hit.parent.country_a) ? hit.parent.country_a[0] :null), true); |
|
|
|
|
|
|
|
|
|
res /= checkCount; |
|
|
|
|
} |
|
|
|
|