1) { $count = 0; $sum = 0; foreach ($words as $word) { if ($word == '') continue; $count++; $sum += sinkov_score($word, $lang, $n); } return $count == 0 ? 0 : $sum/$count; } else { $text = strtolower($text); $text = preg_replace('@[^a-z]+@', '', $text); $score = 0; $count = 0; for ($i=0; $i 1) { $count = 0; $sum = 0; foreach ($words as $word) { if ($word == '') continue; $count++; $sum += markov_score($word, $lang, $n, $multiply); } return $count == 0 ? 0 : $sum/$count; } else { $text = strtolower($text); $text = preg_replace('@[^a-z]+@', '', $text); $score = $multiply ? 1 : 0; $count = 0; for ($i=0; $i