def _match_single_pair(self, profile_rm, profile_geni):
     '''
     Internal function to avoid duplication of code, the profiles to be introduced shall be a profile typenot the id
     '''
     score,factor = profile_rm.comparison_score(profile_geni, self.data_language, self.name_convention)
     if (score*factor > self.threshold):
         #We have a match, so we will create the link as a web link
         include_match_profile(profile_rm, profile_geni, self.database_geni.get_db_kind())
         #We always record the match obtained although was done before
         self.matched_profiles[profile_rm.get_id()] = profile_geni.get_id()
     else:
         #This is a conflict, we should have a single match!!!
         self._conflict_storing(profile_rm, [profile_geni.get_id()], self.database_geni)
Пример #2
0
 def add_match_to_prof(self, prof_id, profile_to_match, adding = True):
     '''
     It will add the match to the profile id and also a task to review depending on options, notice that
     we assume that only task will be included in "input" database
     prof_id shall be the profile in input database by ID
     profile_to_match shall be the profile of pyGenealogy.common_profile derived class
     '''
     profile = self.db_input.get_profile_by_ID(prof_id)
     include_match_profile(profile, profile_to_match, self.db_check.get_db_kind(), self.db_check)
     #We also need to introduce the matching of tasks
     if self.event_year_task and adding:
         #We only enter if the data has been introduced
         details = ""
         for event in profile.getEvents():
             #We will only look task, if there is a date, if the date greater than the threshold and if has an accurracy allowing the analysis
             if event.get_year() and (event.get_year() >= self.event_year_task) and (event.get_accuracy() not in ["AFTER", "BEFORE"]):
                 details += PROCESS_TASK_DETAILS + str(event.get_event_type()) + "/n"
         if details != "":
             include_task_no_duplicate(profile, PROCESS_TASK_NAME, 1, details)