-
This commit is contained in:
Nikiroy78 2023-03-08 01:11:24 +03:00 committed by GitHub
parent dc0fdbf73d
commit 5fc1bd155a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,15 +18,11 @@ function detectLang ($text) {
function selectEnIndex ($text) {
$enSymbols = array();
// $textArr = explode(" ", $text);
// $textArr = str_split($text, 1);
$text = iconv("UTF-8", "windows-1251", $text);
$textArr = str_split($text, 1);
$enDict = str_split('qwertyuiopasdfghjklzxcvbnm', 1);
// print_r($textArr);
for ($i=0; $i <= count($textArr); $i++) {
// if (strpos('ййцукенгшщзхъфывапролджэячсмитьбюёё', mb_strtolower($text[$i])) === true) {
if (in_array(mb_strtolower($textArr[$i]), $enDict)) {
$enSymbols[] = $i;
}
@ -57,7 +53,6 @@ function wrong_symbol ($text, $lang) {
if (
$cacheResult === "NO"
) {
// return selectRuIndex($text);
$enSymbols = selectEnIndex($text);
$text = iconv("UTF-8", "windows-1251", $text);
$textArr = str_split($text, 1);