Skip to content

Commit

Permalink
Normalize -> parse
Browse files Browse the repository at this point in the history
  • Loading branch information
kvh committed Mar 25, 2017
1 parent e12493c commit 342d164
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions match/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ def score_similarity(self, s1, s2):
def score_type_match(self, s):
return 0

# https://github.com/carltonnorthern/nickname-and-diminutive-names-lookup
# class FullNameType(StringDataType):
# super_types = [StringDataType]


# Address
# https://github.com/openvenues/libpostal, https://github.com/openvenues/pypostal


@memoize
def closest_common_type(t1, t2):
if t1 == t2:
Expand Down Expand Up @@ -120,7 +125,7 @@ def score_type_match(self, s):
return int(email_regex.match(s) is not None)

def score_similarity(self, s1, s2):
return int(self.normalize(s1) == self.normalize(s2))
return int(self.parse(s1) == self.parse(s2))


"""
Expand Down Expand Up @@ -151,7 +156,7 @@ def parse_to_object(self, s):
# return int(email_regex.match(s) is not None)

def score_similarity(self, s1, s2):
return int(self.normalize(s1) == self.normalize(s2))
return int(self.parse(s1) == self.parse(s2))


datatype_lookup = {
Expand Down

0 comments on commit 342d164

Please sign in to comment.