Warning: session_start(): open(/var/lib/php/sessions/sess_akbtad4bpu1ur0q662h0811kt8, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// patterns = e.g. "Zitat, Anfrage, Preis, Kosten, Preise, Geld, wieviel, wie + viel"
// potentially slow (not using levenLimited)
static Int mmo_levenWithSwapsScore(S patterns, S s) {
Int min = null;
if (startsWith(s, "#")) null;
patLoop: for (S pat : tok_splitAtComma(patterns)) {
if (startsWith(pat, "#")) continue; // ignore special commands
int score = 0;
for (S phrase : tok_splitAtPlus(pat)) {
if (endsWith(phrase, "!")) {
if (!find3(phrase, s)) continue patLoop;
} else {
Int score2 = find3_levenWithSwapsDistance(phrase, s);
if (score2 == null) continue patLoop;
score += score2;
}
}
min = min_withNull(min, score);
}
ret min;
}