Fixed issue with one word matching multiple
This commit is contained in:
parent
3e80cb745b
commit
3722ab2af3
2 changed files with 19 additions and 3 deletions
|
|
@ -55,7 +55,10 @@ function match (nameParts, birthDateString, threshold) {
|
|||
const words = nameUtils.makeWords(fullName)
|
||||
|
||||
const wordValues = _.map(_.get('value'), words)
|
||||
const wordPhonetics = _.flatMap(_.get('phonetics'), words)
|
||||
const wordPhonetics = _.flatMap(word => {
|
||||
const {phonetics} = word
|
||||
return _.map(phonetic => ({word: word.value, phonetic}), phonetics)
|
||||
}, words)
|
||||
|
||||
// birthDateString is in YYYYMMDD format
|
||||
const birthDate = _.cond([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue