Last active
March 16, 2019 23:17
-
-
Save talfco/6d64fffc9c981b33d32b79f7404ca153 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_combinations_to_directory(self, comb_tuples, person_id): | |
for comb in comb_tuples: | |
concat_name = self.generate_normalized_name(comb) | |
metaphone_tuple = doublemetaphone(concat_name) | |
if metaphone_tuple[0] in self.__lookup_dict[0]: | |
if not person_id in self.__lookup_dict[0][metaphone_tuple[0]]: | |
self.__lookup_dict[0][metaphone_tuple[0]].append(person_id) | |
else: | |
self.__lookup_dict[0][metaphone_tuple[0]] = [person_id] | |
if metaphone_tuple[1] in self.__lookup_dict[1]: | |
if not person_id in self.__lookup_dict[1][metaphone_tuple[1]]: | |
self.__lookup_dict[1][metaphone_tuple[1]].append(person_id) | |
else: | |
self.__lookup_dict[1][metaphone_tuple[1]] = [person_id] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment