private function matchChild(&$stdChild1, &$stdChild2) { $score = 0; foreach ($stdChild1 as $label => $values1) { $values2 = @$stdChild2[$label]; if ($label != 'childSurname' && $label != 'childGedcomMatchTitle') { list($s, $class) = CompareForm::scoreMatch($label, $values1, $values2); $score += $s; if ($s) { //wfDebug("COMPARE CHILD label=$label values1=".join(',',$values1)." values2=".join(',',$values2)." score=$s\n"); } } } // already matched if (@$stdChild1['childGedcomMatchTitle'][0] && $stdChild1['childGedcomMatchTitle'][0] == $stdChild2['childTitle'][0] || @$stdChild2['childGedcomMatchTitle'][0] && $stdChild2['childGedcomMatchTitle'][0] == $stdChild1['childTitle'][0]) { $score += 10; } return $score; }
public static function calcMatchScore($d1, $d2) { $score = 0; foreach ($d1 as $label => $stdValues1) { // don't count the following labels -- they're often already counted if ($label != 'ParentFamilyTitle' && $label != 'SpouseFamilyTitle' && $label != 'HusbandGiven' && $label != 'HusbandSurname' && $label != 'WifeGiven' && $label != 'WifeSurname') { $stdValues2 = @$d2[$label]; if (is_array($stdValues2)) { list($s, $class) = CompareForm::scoreMatch($label, $stdValues1, $stdValues2); $score += $s; } } } return $score; }