diff --git a/lib/ofac/index.js b/lib/ofac/index.js index 9f8c4ffe..b0e7691d 100644 --- a/lib/ofac/index.js +++ b/lib/ofac/index.js @@ -66,10 +66,10 @@ function match (nameParts, birthDateString, threshold) { const birthDate = {year, month, day, date} const candidate = {parts, fullName, wordValues, wordPhonetics, birthDate} - debug_log(candidate) + // debug_log(candidate) const result = matcher.match(structs, candidate, threshold) - debug_log(result) + // debug_log(result) return result } diff --git a/lib/ofac/matching.js b/lib/ofac/matching.js index e00de128..b2c7f622 100644 --- a/lib/ofac/matching.js +++ b/lib/ofac/matching.js @@ -39,7 +39,6 @@ function match (structs, candidate, threshold) { const aliases = _.flatMap(_.get('aliases'), structs.individuals) const aliasIdsFromFullName = _.flow( _.filter(doesNameMatch), - _.map(_.get('id')) )(aliases) @@ -53,7 +52,7 @@ function match (structs, candidate, threshold) { // Gether aliases whose name-parts match alphabetically. const getStringMatches = value => { - const entryMatches = entry => (jaroWinkler(value, entry.value) >= threshold) + const entryMatches = entry => (stringSimilarity(value, entry.value) >= threshold) return _.filter(entryMatches, structs.wordList) } const getSingleEntries = wordEntry => { @@ -71,7 +70,7 @@ function match (structs, candidate, threshold) { return count >= Math.min(2, alias.words.length) } const aliasIdsFromNamePart = _.flow( - _.uniqWith(_.isEqual), + _.uniqWith((a, b) => a.value === b.value && a.aliasId === b.aliasId), _.map(_.get('aliasId')), _.countBy(_.identity), _.toPairs,