コード例 #1
0
ファイル: edit_languages.php プロジェクト: hans/lwt
if (isset($_REQUEST['del'])) {
    $anztexts = get_first_value('select count(TxID) as value from texts where TxLgID = ' . $_REQUEST['del']);
    $anzarchtexts = get_first_value('select count(AtID) as value from archivedtexts where AtLgID = ' . $_REQUEST['del']);
    $anzwords = get_first_value('select count(WoID) as value from words where WoLgID = ' . $_REQUEST['del']);
    if ($anztexts > 0 || $anzarchtexts > 0 || $anzwords > 0) {
        $message = 'You must first delete texts, archived texts and words with this language!';
    } else {
        $message = runsql('delete from languages where LgID = ' . $_REQUEST['del'], "Deleted");
        adjust_autoincr('languages', 'LgID');
    }
} elseif (isset($_REQUEST['op'])) {
    // INSERT
    if ($_REQUEST['op'] == 'Save') {
        $message = runsql('insert into languages (LgName, LgDict1URI, LgDict2URI, LgGoogleTranslateURI, LgTextSize, LgCharacterSubstitutions, LgRegexpSplitSentences, LgExceptionsSplitSentences, LgRegexpWordCharacters, LgRemoveSpaces, LgSplitEachChar, LgRightToLeft) values(' . convert_string_to_sqlsyntax($_REQUEST["LgName"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgDict1URI"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgDict2URI"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgGoogleTranslateURI"]) . ', ' . $_REQUEST["LgTextSize"] . ', ' . convert_string_to_sqlsyntax_notrim_nonull($_REQUEST["LgCharacterSubstitutions"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgRegexpSplitSentences"]) . ', ' . convert_string_to_sqlsyntax_notrim_nonull($_REQUEST["LgExceptionsSplitSentences"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgRegexpWordCharacters"]) . ', ' . $_REQUEST["LgRemoveSpaces"] . ', ' . $_REQUEST["LgSplitEachChar"] . ', ' . $_REQUEST["LgRightToLeft"] . ')', 'Saved');
    } elseif ($_REQUEST['op'] == 'Change') {
        $message = runsql('update languages set ' . 'LgName = ' . convert_string_to_sqlsyntax($_REQUEST["LgName"]) . ', ' . 'LgDict1URI = ' . convert_string_to_sqlsyntax($_REQUEST["LgDict1URI"]) . ', ' . 'LgDict2URI = ' . convert_string_to_sqlsyntax($_REQUEST["LgDict2URI"]) . ', ' . 'LgGoogleTranslateURI = ' . convert_string_to_sqlsyntax($_REQUEST["LgGoogleTranslateURI"]) . ', ' . 'LgTextSize = ' . $_REQUEST["LgTextSize"] . ', ' . 'LgCharacterSubstitutions = ' . convert_string_to_sqlsyntax_notrim_nonull($_REQUEST["LgCharacterSubstitutions"]) . ', ' . 'LgRegexpSplitSentences = ' . convert_string_to_sqlsyntax($_REQUEST["LgRegexpSplitSentences"]) . ', ' . 'LgExceptionsSplitSentences = ' . convert_string_to_sqlsyntax_notrim_nonull($_REQUEST["LgExceptionsSplitSentences"]) . ', ' . 'LgRegexpWordCharacters = ' . convert_string_to_sqlsyntax($_REQUEST["LgRegexpWordCharacters"]) . ', ' . 'LgRemoveSpaces = ' . $_REQUEST["LgRemoveSpaces"] . ', ' . 'LgSplitEachChar = ' . $_REQUEST["LgSplitEachChar"] . ', ' . 'LgRightToLeft = ' . $_REQUEST["LgRightToLeft"] . ' where LgID = ' . $_REQUEST["LgID"], 'Updated');
    }
}
// NEW
if (isset($_REQUEST['new'])) {
    ?>

	<h4>New Language <a target="_blank" href="info.htm#howtolang"><img src="icn/question-frame.png" title="Help" alt="Help" /></a> </h4>
	<form class="validate" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
" method="post">
	<table class="tab3" cellspacing="0" cellpadding="5">
	<tr>
	<td class="td1 right">Language:</td>
	<td class="td1"><input type="text" class="notempty setfocus" name="LgName" value="" maxlength="40" size="40" /> <img src="icn/status-busy.png" title="Field must not be empty" alt="Field must not be empty" /></td>
コード例 #2
0
function splitCheckText($text, $lid, $id)
{
    // $id = -1     => Check, return protocol
    // $id = -2     => Only return sentence array
    // $id = TextID => Split: insert sentences/textitems entries in DB
    global $tbpref;
    $r = '';
    $sql = "select * from " . $tbpref . "languages where LgID=" . $lid;
    $res = do_mysql_query($sql);
    $record = mysql_fetch_assoc($res);
    if ($record == FALSE) {
        my_die("Language data not found: {$sql}");
    }
    $removeSpaces = $record['LgRemoveSpaces'];
    $splitEachChar = $record['LgSplitEachChar'];
    $splitSentence = $record['LgRegexpSplitSentences'];
    $noSentenceEnd = $record['LgExceptionsSplitSentences'];
    $termchar = $record['LgRegexpWordCharacters'];
    $replace = explode("|", $record['LgCharacterSubstitutions']);
    $rtlScript = $record['LgRightToLeft'];
    mysql_free_result($res);
    $s = prepare_textdata($text);
    $s = str_replace("\n", " ¶ ", $s);
    $s = str_replace("\t", " ", $s);
    $s = trim($s);
    if ($splitEachChar) {
        $s = preg_replace('/([^\\s])/u', "\$1 ", $s);
    }
    $s = preg_replace('/\\s{2,}/u', ' ', $s);
    if ($id == -1) {
        $r .= "<div style=\"margin-right:50px;\"><h4>Text</h4><p " . ($rtlScript ? 'dir="rtl"' : '') . ">" . str_replace("¶", "<br /><br />", tohtml($s)) . "</p>";
    }
    $s = str_replace('{', '[', $s);
    // because of sent. spc. char
    $s = str_replace('}', ']', $s);
    foreach ($replace as $value) {
        $fromto = explode("=", trim($value));
        if (count($fromto) >= 2) {
            $s = str_replace(trim($fromto[0]), trim($fromto[1]), $s);
        }
    }
    $s = trim($s);
    if ($noSentenceEnd != '') {
        $s = preg_replace('/(' . $noSentenceEnd . ')\\s/u', '$1‧', $s);
    }
    $s = preg_replace('/([' . $splitSentence . '¶])\\s/u', "\$1\n", $s);
    $s = str_replace(" ¶\n", "\n¶\n", $s);
    $s = str_replace('‧', ' ', $s);
    if ($s == '') {
        $textLines = array($s);
    } else {
        $s = explode("\n", $s);
        $l = count($s);
        for ($i = 0; $i < $l; $i++) {
            $s[$i] = trim($s[$i]);
            if ($s[$i] != '') {
                $pos = strpos($splitSentence, $s[$i]);
                while ($pos !== false && $i > 0) {
                    $s[$i - 1] .= " " . $s[$i];
                    for ($j = $i + 1; $j < $l; $j++) {
                        $s[$j - 1] = $s[$j];
                    }
                    array_pop($s);
                    $l = count($s);
                    $pos = strpos($splitSentence, $s[$i]);
                }
            }
        }
        $l = count($s);
        $textLines = array();
        for ($i = 0; $i < $l; $i++) {
            $zz = trim($s[$i]);
            if ($zz != '') {
                $textLines[] = $zz;
            }
        }
    }
    if ($id == -2) {
        ////////////////////////////////////
        // Only return sentence array
        return $textLines;
    }
    $lineWords = array();
    if ($id == -1) {
        ////////////////////////////////////
        // Check, return protocol
        $wordList = array();
        $wordSeps = array();
        $r .= "<h4>Sentences</h4><ol>";
        $sentNumber = 0;
        foreach ($textLines as $value) {
            $r .= "<li " . ($rtlScript ? 'dir="rtl"' : '') . ">" . tohtml(remove_spaces($value, $removeSpaces)) . "</li>";
            $lineWords[$sentNumber] = preg_split('/([^' . $termchar . ']{1,})/u', $value, -1, PREG_SPLIT_DELIM_CAPTURE);
            $l = count($lineWords[$sentNumber]);
            for ($i = 0; $i < $l; $i++) {
                $term = mb_strtolower($lineWords[$sentNumber][$i], 'UTF-8');
                if ($term != '') {
                    if ($i % 2 == 0) {
                        if (array_key_exists($term, $wordList)) {
                            $wordList[$term][0]++;
                            $wordList[$term][1][] = $sentNumber;
                        } else {
                            $wordList[$term] = array(1, array($sentNumber));
                        }
                    } else {
                        $ww = remove_spaces($term, $removeSpaces);
                        if (array_key_exists($ww, $wordSeps)) {
                            $wordSeps[$ww]++;
                        } else {
                            $wordSeps[$ww] = 1;
                        }
                    }
                }
            }
            $sentNumber += 1;
        }
        $r .= "</ol><h4>Word List <span class=\"red2\">(red = already saved)</span></h4><ul>";
        ksort($wordList);
        $anz = 0;
        foreach ($wordList as $key => $value) {
            $trans = get_first_value("select WoTranslation as value from " . $tbpref . "words where WoLgID = " . $lid . " and WoTextLC = " . convert_string_to_sqlsyntax($key));
            if (!isset($trans)) {
                $trans = "";
            }
            if ($trans == "*") {
                $trans = "";
            }
            if ($trans != "") {
                $r .= "<li " . ($rtlScript ? 'dir="rtl"' : '') . "><span class=\"red2\">[" . tohtml($key) . "] — " . $value[0] . " - " . tohtml(repl_tab_nl($trans)) . "</span></li>";
            } else {
                $r .= "<li " . ($rtlScript ? 'dir="rtl"' : '') . ">[" . tohtml($key) . "] — " . $value[0] . "</li>";
            }
            $anz++;
        }
        $r .= "</ul><p>TOTAL: " . $anz . "</p><h4>Non-Word List</h4><ul>";
        if (array_key_exists('', $wordSeps)) {
            unset($wordSeps['']);
        }
        ksort($wordSeps);
        $anz = 0;
        foreach ($wordSeps as $key => $value) {
            $r .= "<li>[" . str_replace(" ", "<span class=\"backgray\">&nbsp;</span>", tohtml($key)) . "] — " . $value . "</li>";
            $anz++;
        }
        $r .= "</ul><p>TOTAL: " . $anz . "</p></div>";
        return $r;
    }
    ////////////////////////////////////
    // Split: insert sentences/textitems entries in DB
    $sentNumber = 0;
    $lfdnr = 0;
    foreach ($textLines as $value) {
        $dummy = runsql('INSERT INTO ' . $tbpref . 'sentences (SeLgID, SeTxID, SeOrder, SeText) VALUES (' . $lid . ',' . $id . ',' . ($sentNumber + 1) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($value . ' ', $removeSpaces)) . ')', ' ');
        $sentid = get_last_key();
        $lineWords[$sentNumber] = preg_split('/([^' . $termchar . ']+)/u', $value . ' ', null, PREG_SPLIT_DELIM_CAPTURE);
        $l = count($lineWords[$sentNumber]);
        $sqltext = 'INSERT INTO ' . $tbpref . 'textitems (TiLgID, TiTxID, TiSeID, TiOrder, TiWordCount, TiText, TiTextLC, TiIsNotWord) VALUES ';
        $lfdnr1 = 0;
        for ($i = 0; $i < $l; $i++) {
            $term = mb_strtolower($lineWords[$sentNumber][$i], 'UTF-8');
            $rest2 = '';
            $rest3 = '';
            $rest4 = '';
            $rest5 = '';
            $rest6 = '';
            $rest7 = '';
            $rest8 = '';
            $rest9 = '';
            $restlc2 = '';
            $restlc3 = '';
            $restlc4 = '';
            $restlc5 = '';
            $restlc6 = '';
            $restlc7 = '';
            $restlc8 = '';
            $restlc9 = '';
            if ($term != '') {
                if ($i % 2 == 0) {
                    $isnotwort = 0;
                    $rest = $lineWords[$sentNumber][$i];
                    $cnt = 0;
                    for ($j = $i + 1; $j < $l; $j++) {
                        if ($lineWords[$sentNumber][$j] != '') {
                            $rest .= $lineWords[$sentNumber][$j];
                            $cnt++;
                            if ($cnt == 2) {
                                $rest2 = $rest;
                                $restlc2 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 4) {
                                $rest3 = $rest;
                                $restlc3 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 6) {
                                $rest4 = $rest;
                                $restlc4 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 8) {
                                $rest5 = $rest;
                                $restlc5 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 10) {
                                $rest6 = $rest;
                                $restlc6 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 12) {
                                $rest7 = $rest;
                                $restlc7 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 14) {
                                $rest8 = $rest;
                                $restlc8 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 16) {
                                $rest9 = $rest;
                                $restlc9 = mb_strtolower($rest, 'UTF-8');
                                break;
                            }
                        }
                    }
                } else {
                    $isnotwort = 1;
                }
                $lfdnr++;
                $lfdnr1++;
                if ($lfdnr1 > 1) {
                    $sqltext .= ',';
                }
                $sqltext .= '(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 1, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($lineWords[$sentNumber][$i], $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($term, $removeSpaces)) . ',' . $isnotwort . ')';
                if ($isnotwort == 0) {
                    if ($rest2 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 2, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest2, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc2, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest3 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 3, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest3, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc3, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest4 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 4, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest4, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc4, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest5 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 5, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest5, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc5, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest6 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 6, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest6, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc6, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest7 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 7, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest7, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc7, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest8 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 8, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest8, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc8, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest9 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 9, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest9, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc9, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                }
            }
        }
        if ($lfdnr > 0) {
            $dummy = runsql($sqltext, '');
        }
        $sentNumber += 1;
    }
}
コード例 #3
0
ファイル: utilities.inc.php プロジェクト: russell359/lwt
function splitText($text, $lid, $id)
{
    $sql = "select * from languages where LgID=" . $lid;
    $res = mysql_query($sql);
    if ($res == FALSE) {
        die("Invalid Query: {$sql}");
    }
    $record = mysql_fetch_assoc($res);
    if ($record == FALSE) {
        die("No results: {$sql}");
    }
    $removeSpaces = $record['LgRemoveSpaces'];
    $splitEachChar = $record['LgSplitEachChar'];
    $splitSentence = $record['LgRegexpSplitSentences'];
    $noSentenceEnd = $record['LgExceptionsSplitSentences'];
    $termchar = $record['LgRegexpWordCharacters'];
    $replace = explode("|", $record['LgCharacterSubstitutions']);
    mysql_free_result($res);
    $s = str_replace("\r\n", "\n", $text);
    $s = str_replace("\n", " ¶ ", $s);
    $s = str_replace("\t", " ", $s);
    $s = trim($s);
    if ($splitEachChar) {
        $s = preg_replace('/([^\\s])/u', "\$1 ", $s);
    }
    $s = preg_replace('/\\s{2,}/u', ' ', $s);
    $s = str_replace('{', '[', $s);
    // because of sent. spc. char
    $s = str_replace('}', ']', $s);
    foreach ($replace as $value) {
        $fromto = explode("=", trim($value));
        if (count($fromto) >= 2) {
            $s = str_replace(trim($fromto[0]), trim($fromto[1]), $s);
        }
    }
    $s = trim($s);
    if ($noSentenceEnd != '') {
        $s = preg_replace('/(' . $noSentenceEnd . ')\\s/u', '$1‧', $s);
    }
    $s = preg_replace('/([' . $splitSentence . '¶])\\s/u', "\$1\n", $s);
    $s = str_replace(" ¶\n", "\n¶\n", $s);
    $s = str_replace('‧', ' ', $s);
    if ($s == '') {
        $textLines = array($s);
    } else {
        $s = explode("\n", $s);
        $l = count($s);
        for ($i = 0; $i < $l; $i++) {
            $s[$i] = trim($s[$i]);
            if ($s[$i] != '') {
                $pos = strpos($splitSentence, $s[$i]);
                while ($pos !== false && $i > 0) {
                    $s[$i - 1] .= " " . $s[$i];
                    for ($j = $i + 1; $j < $l; $j++) {
                        $s[$j - 1] = $s[$j];
                    }
                    array_pop($s);
                    $l = count($s);
                    $pos = strpos($splitSentence, $s[$i]);
                }
            }
        }
        $l = count($s);
        $textLines = array();
        for ($i = 0; $i < $l; $i++) {
            $zz = trim($s[$i]);
            if ($zz != '') {
                $textLines[] = $zz;
            }
        }
    }
    $lineWords = array();
    $wordList = array();
    $wordIndex = array();
    $wordSeps = array();
    $sentNumber = 0;
    $lfdnr = 0;
    foreach ($textLines as $value) {
        $dummy = runsql('INSERT INTO sentences (SeLgID, SeTxID, SeOrder, SeText) VALUES (' . $lid . ',' . $id . ',' . ($sentNumber + 1) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($value . ' ', $removeSpaces)) . ')', ' ');
        $sentid = get_last_key();
        /**** Speichern Sätze Ende ***/
        $lineWords[$sentNumber] = preg_split('/([^' . $termchar . ']+)/u', $value . ' ', null, PREG_SPLIT_DELIM_CAPTURE);
        $l = count($lineWords[$sentNumber]);
        $sqltext = 'INSERT INTO textitems (TiLgID, TiTxID, TiSeID, TiOrder, TiWordCount, TiText, TiTextLC, TiIsNotWord) VALUES ';
        $lfdnr1 = 0;
        for ($i = 0; $i < $l; $i++) {
            $term = mb_strtolower($lineWords[$sentNumber][$i], 'UTF-8');
            $rest2 = '';
            $rest3 = '';
            $rest4 = '';
            $rest5 = '';
            $rest6 = '';
            $rest7 = '';
            $rest8 = '';
            $rest9 = '';
            $restlc2 = '';
            $restlc3 = '';
            $restlc4 = '';
            $restlc5 = '';
            $restlc6 = '';
            $restlc7 = '';
            $restlc8 = '';
            $restlc9 = '';
            if ($term != '') {
                if ($i % 2 == 0) {
                    $isnotwort = 0;
                    $rest = $lineWords[$sentNumber][$i];
                    $cnt = 0;
                    for ($j = $i + 1; $j < $l; $j++) {
                        if ($lineWords[$sentNumber][$j] != '') {
                            $rest .= $lineWords[$sentNumber][$j];
                            $cnt++;
                            if ($cnt == 2) {
                                $rest2 = $rest;
                                $restlc2 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 4) {
                                $rest3 = $rest;
                                $restlc3 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 6) {
                                $rest4 = $rest;
                                $restlc4 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 8) {
                                $rest5 = $rest;
                                $restlc5 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 10) {
                                $rest6 = $rest;
                                $restlc6 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 12) {
                                $rest7 = $rest;
                                $restlc7 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 14) {
                                $rest8 = $rest;
                                $restlc8 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 16) {
                                $rest9 = $rest;
                                $restlc9 = mb_strtolower($rest, 'UTF-8');
                                break;
                            }
                        }
                    }
                } else {
                    $isnotwort = 1;
                }
                $lfdnr++;
                $lfdnr1++;
                if ($lfdnr1 > 1) {
                    $sqltext .= ',';
                }
                $sqltext .= '(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 1, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($lineWords[$sentNumber][$i], $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($term, $removeSpaces)) . ',' . $isnotwort . ')';
                if ($isnotwort == 0) {
                    if ($rest2 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 2, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest2, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc2, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest3 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 3, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest3, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc3, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest4 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 4, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest4, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc4, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest5 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 5, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest5, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc5, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest6 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 6, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest6, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc6, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest7 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 7, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest7, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc7, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest8 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 8, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest8, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc8, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest9 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 9, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest9, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc9, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                }
            }
        }
        if ($lfdnr > 0) {
            $dummy = runsql($sqltext, '');
        }
        $sentNumber += 1;
    }
}