Skip to content

Commit 2bc63bd

Browse files
committed
Merge branch 'master' of https://github.com/Program-O/Program-O
2 parents d1a05b0 + 4025d74 commit 2bc63bd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

chatbot/core/aiml/find_aiml.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,18 +322,17 @@ function score_matches($convoArr, $bot_parent_id, $allrows, $lookingfor, $curren
322322
$allrows[$all]['score'] += $that_pattern_match_general;
323323
$allrows[$all]['track_score'] .= "g";
324324
}
325-
} elseif ($aiml_pattern == "*") {
325+
} elseif (($aiml_pattern == "*")&&($aiml_thatpattern!="")) {
326326

327-
if (($aiml_thatpattern == $current_thatpattern) && ($aiml_thatpattern != '')) {
328-
$allrows[$all]['score'] += $that_pattern_match;
329-
$allrows[$all]['track_score'][] = "h";
330327

331-
} elseif (($aiml_thatpattern_wildcards != '') && ($aiml_thatpattern != '') && (preg_match($aiml_thatpattern_wildcards, $current_thatpattern, $m))) {
328+
if (($aiml_thatpattern_wildcards != '') && (preg_match($aiml_thatpattern_wildcards, $current_thatpattern, $m))) {
332329
$allrows[$all]['score'] += $that_pattern_match;
333-
$allrows[$all]['track_score'][] = "i";
330+
$allrows[$all]['track_score'][] = "general aiml that pattern match";
334331
}
335332

336333
}
334+
335+
337336
//if stored result == default pattern increase score
338337
$aiml_pattern = (IS_MB_ENABLED) ? mb_strtolower($aiml_pattern) : strtolower($aiml_pattern);
339338
$default_pattern = (IS_MB_ENABLED) ? mb_strtolower($default_pattern) : strtolower($default_pattern);

0 commit comments

Comments
 (0)