This commit is contained in:
Josh Harvey 2018-05-01 19:35:54 +03:00
parent f7561acf3c
commit 80e851fb59
9 changed files with 131 additions and 76 deletions

View file

@ -1,7 +1,7 @@
const jaro = require('talisman/metrics/distance/jaro')
const _ = require('lodash/fp')
const debug_log = require('../pp')(__filename) // KOSTIS TODO: remove
const debugLog = require('../pp')(__filename) // KOSTIS TODO: remove
const stringSimilarity = _.curry(jaro)
@ -44,7 +44,6 @@ function match (structs, candidate, options) {
_.map(_.get('id'))
)(aliases)
const phoneticWeight = ratio
const stringWeight = 1 - phoneticWeight
@ -90,8 +89,8 @@ function match (structs, candidate, options) {
_.map(_.first)
)(matches)
debug && debug_log(aliasIdsFromFullName)
debug && debug_log(aliasIdsFromNamePart)
debug && debugLog(aliasIdsFromFullName)
debug && debugLog(aliasIdsFromNamePart)
// Get the full record for each matched id
const getIndividual = aliasId => {