Added more description and MIN_NAME_MATCHING_PERCENTAGE parameter

This commit is contained in:
2023-07-28 01:58:51 +02:00
parent 5af1314fb0
commit 864a531363
2 changed files with 16 additions and 4 deletions

View File

@@ -19,6 +19,7 @@
* $ php ./IServ_Elternimport_Divis.php iserv-user-export.csv divis-parents-export.csv > Parents_Import.csv
*/
define ("MIN_NAME_MATCHING_PERCENTAGE", 85);
define ("WRITE_TO_CONSOLE", true);
define ("IS_CLI", (php_sapi_name() == "cli"));
@@ -71,7 +72,10 @@ function find_parent_by_student ($firstname, $lastname) {
// If match is bigger or equal to 85% and this match is higher
// ranked than the last, make this the current best match
if ($perc >= 85 && $best_match["match_perc"] < $perc) {
if (
$perc >= MIN_NAME_MATCHING_PERCENTAGE &&
$best_match["match_perc"] < $perc
) {
console_write ("INFO: New best match '{$hash}' at {$perc}%");
$best_match = [
"match_perc" => $perc,