def compare_fingerprints(left, right): result = 0 left_list = ensure_list(left.get('fingerprints')) right_list = ensure_list(right.get('fingerprints')) for (left, right) in itertools.product(left_list, right_list): similarity = jaro(left, right) score = similarity * dampen(3, 20, min(left, right, key=len)) result = max(result, score) return result
def compare_names(left, right): result = 0 left_list = [normalize(n, latinize=True) for n in left.names] right_list = [normalize(n, latinize=True) for n in right.names] for (left, right) in itertools.product(left_list, right_list): similarity = jaro(left, right) score = similarity * dampen(2, 20, shortest(left, right)) result = max(result, score) return result
def compare_names(left, right): result = 0 left_list = list(_normalize_names(left.names)) right_list = list(_normalize_names(right.names)) for (left, right) in itertools.product(left_list, right_list): similarity = jaro(left, right) score = similarity * dampen(2, 20, shortest(left, right)) result = max(result, score) return result
def specificity(self, value): # TODO: insert artificial intelligence here. return dampen(3, 50, value) * .8
def compare(self, left, right): prefix = os.path.commonprefix([left, right]) return dampen(4, 10, prefix)
def specificity(self, value): return dampen(5, self.MAX_LENGTH, value) * .5
def _specificity(self, value): return dampen(4, 10, value)
def _specificity(self, value: str) -> float: # TODO: insert artificial intelligence here. return dampen(7, 11, value)
def _specificity(self, value: str) -> float: return dampen(10, 60, value)
def _specificity(self, value): # TODO: insert artificial intelligence here. return dampen(6, 11, value)
def _specificity(self, value): return dampen(5, 13, value)
def compare(self, left: str, right: str) -> float: prefix = os.path.commonprefix([left, right]) return dampen(4, 10, prefix)
def _specificity(self, value: str) -> float: return dampen(5, 13, value)
def specificity(self, value): return dampen(10, 50, value) * .6