Sfoglia il codice sorgente

恢复有些sqlite: 标记

visuddhinanda 5 anni fa
parent
commit
4007c6adeb

+ 2 - 3
app/dict/comp_csv.php

@@ -58,9 +58,8 @@ while($word = $redis->hGet("pali://wordindex.hash",$start))
 
         foreach ($arrword as $oneword) {
 			$result = array(); //全局变量,递归程序的输出容器
-			mySplit2($oneword, 0, true, 0.5, 0.9, 0, true, false);
-			mySplit2($oneword, 0, true, 0.5, 0.9, 0, false, false);
-			if(count($result)<5){
+			mySplit2($oneword, 0, false, 0.2, 0.9, 0, true, false);
+			if(count($result)<3){
 				mySplit2($oneword, 0, false, 0.2, 0.8, 0, true, true);
 				if (isset($_POST["debug"])) {
 					echo "正切:" . count($result) . "\n";

+ 1 - 0
app/path.php

@@ -107,6 +107,7 @@ define("_FILE_DB_GROUP_", "sqlite:" . __DIR__ . "/../tmp/user/group.db3");
 define("_FILE_DB_USERINFO_", "sqlite:" . __DIR__ . "/../tmp/user/userinfo.db3");
 define("_FILE_DB_FILEINDEX_", "sqlite:" . __DIR__ . "/../tmp/user/fileindex.db");
 define("_FILE_DB_WBW_", "sqlite:" . __DIR__ . "/../tmp/user/wbw.db3");
+define("_FILE_DB_WBW1_",  __DIR__ . "/../tmp/user/wbw.db3");
 define("_FILE_DB_COURSE_", "sqlite:" . __DIR__ . "/../tmp/user/course.db3");
 define("_FILE_DB_MEDIA_", "sqlite:" . __DIR__ . "/../tmp/user/media.db3");
 define("_FILE_DB_MESSAGE_", "sqlite:" . __DIR__ . "/../tmp/user/message.db");

+ 3 - 3
app/studio/dict_find_auto.php

@@ -40,7 +40,7 @@ global $PDO;
 
 //查询单词表
 $db_file = _DIR_PALICANON_TEMPLET_ . "/p" . $in_book . "_tpl.db3";
-PDO_Connect("$db_file");
+PDO_Connect("sqlite:{$db_file}");
 $query = "SELECT paragraph,wid,real FROM \"main\" WHERE (\"paragraph\" in " . $strQueryPara . " ) and \"real\"<>\"\" and \"type\"<>'.ctl.' ";
 if ($debug) {
     echo "filename:" . $db_file . "<br>";
@@ -73,7 +73,7 @@ $dict_word_spell = array();
 $output = array();
 $db_file_list = array();
 //用户词典
-array_push($db_file_list, array(_FILE_DB_WBW_, " ORDER BY rowid DESC"));
+array_push($db_file_list, array(_FILE_DB_WBW1_, " ORDER BY rowid DESC"));
 
 array_push($db_file_list, array(_DIR_DICT_SYSTEM_ . "/sys_regular.db", " ORDER BY confidence DESC"));
 array_push($db_file_list, array(_DIR_DICT_SYSTEM_ . "/sys_irregular.db", ""));
@@ -104,7 +104,7 @@ for ($i = 0; $i < $lookup_loop; $i++) {
         if ($debug) {
             echo "dict:$db_file<br>";
         }
-        PDO_Connect("{$db_file}");
+        PDO_Connect("sqlite:{$db_file}");
         PDO_Execute("PRAGMA synchronous = OFF");
         PDO_Execute("PRAGMA journal_mode = WAL");
         PDO_Execute("PRAGMA foreign_keys = ON");

+ 2 - 2
app/studio/dict_find_one.php

@@ -64,7 +64,7 @@ $output = array();
 $db_file_list = array();
 //用户词典
 if ($dict_name == "") {
-    array_push($db_file_list, _FILE_DB_WBW_);
+    array_push($db_file_list, _FILE_DB_WBW1_);
 
     array_push($db_file_list, _DIR_DICT_SYSTEM_ . "/sys_regular.db");
     array_push($db_file_list, _DIR_DICT_SYSTEM_ . "/sys_irregular.db");
@@ -86,7 +86,7 @@ if ($dict_name == "") {
 $_dict_db = array();
 foreach ($db_file_list as $db_file) {
     try {
-        $dbh = new PDO("" . $db_file, "", "");
+        $dbh = new PDO("sqlite:" . $db_file, "", "");
         $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
         $_dict_db[] = array("file" => $db_file, "dbh" => $dbh);
 

+ 1 - 1
app/uwbw/create_wbw.php

@@ -67,7 +67,7 @@ if($sum_len>MAX_LETTER){
 PDO_Connect(""._FILE_DB_USER_WBW_);
 
 //模板库
-$db_tpl = ""._DIR_PALICANON_TEMPLET_."/p".$_book."_tpl.db3";
+$db_tpl = "sqlite:"._DIR_PALICANON_TEMPLET_."/p".$_book."_tpl.db3";
 $dbh_tpl = new PDO($db_tpl, "", "");
 $dbh_tpl->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);