2
0
Эх сурвалжийг харах

wordbook define table name

visuddhinanda 4 жил өмнө
parent
commit
737e861ee5

+ 1 - 1
app/install/db_insert_bookword_from_csv.php

@@ -64,7 +64,7 @@ if (($fpoutput = fopen(_DIR_CSV_PALI_CANON_WORD_ . "/{$from}_words.csv", "r")) !
 
 // 开始一个事务,关闭自动提交
 $dbh_word_index->beginTransaction();
-$query = "INSERT INTO bookword ('book','wordindex','count') VALUES ( ? , ? , ?  )";
+$query = "INSERT INTO "._TABLE_BOOK_WORD_." ('book','wordindex','count') VALUES ( ? , ? , ?  )";
 $stmt = $dbh_word_index->prepare($query);
 
 foreach ($bookword as $key => $value) {

+ 5 - 0
app/path.php

@@ -30,13 +30,17 @@ define("_FILE_DB_RESRES_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicano
 define("_FILE_DB_PALITEXT_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_text.db3");
 define("_FILE_DB_STATISTICS_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/word_statistics.db3");
 define("_FILE_DB_PALI_SENTENCE_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_sent1.db3");
+//相似句
 define("_FILE_DB_PALI_SENTENCE_SIM_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_sim.db3");
 define("_FILE_DB_PALI_TOC_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_toc.db3");
 define("_FILE_DB_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/index.db3");
 define("_FILE_DB_WORD_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/wordindex.db3");
 define("_FILE_DB_PALI_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/paliindex.db3");
 define("_FILE_DB_PAGE_INDEX_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pagemap.db3");
+//以书为单位的单词汇总表
 define("_FILE_DB_BOOK_WORD_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/bookword.db3");
+define("_TABLE_BOOK_WORD_", "bookword");
+
 define("_FILE_DB_BOLD_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/bold.db3");
 
 //语料库
@@ -122,3 +126,4 @@ define("_FILE_DB_USER_ACTIVE_", "sqlite:" . __DIR__ . "/../tmp/user/user_active.
 define("_FILE_DB_USER_ACTIVE_LOG_", "sqlite:" . __DIR__ . "/../tmp/user/user_active_log.db3");
 define("_FILE_DB_USER_SHARE_", "sqlite:" . __DIR__ . "/../tmp/user/share.db3");
 define("_FILE_DB_USER_CUSTOM_BOOK_", "sqlite:" . __DIR__ . "/../tmp/user/custom_book.db3");
+define("_TABLE_USER_CUSTOM_BOOK_", "sqlite:" . __DIR__ . "/../tmp/user/custom_book.db3");

+ 2 - 2
app/search/dict_find3.php

@@ -141,7 +141,7 @@ switch ($op) {
 
         //查找这些词出现在哪些书中
         PDO_Connect(_FILE_DB_BOOK_WORD_);
-        $query = "SELECT book,sum(count) as co FROM bookword WHERE \"wordindex\" IN $strQueryWordId  GROUP BY book LIMIT 0,217";
+        $query = "SELECT book,sum(count) as co FROM "._TABLE_BOOK_WORD_." WHERE \"wordindex\" IN $strQueryWordId  GROUP BY book LIMIT 0,217";
         $Fetch = PDO_FetchAll($query);
         $iFetch = count($Fetch);
         if ($iFetch > 0) {
@@ -238,7 +238,7 @@ switch ($op) {
                 }
 
                 //查找这些词出现在哪些书中
-                $query = "select book,sum(count) as co from bookword where \"wordindex\" in $wordlist group by book order by co DESC";
+                $query = "SELECT book,sum(count) as co from "._TABLE_BOOK_WORD_." where \"wordindex\" in $wordlist group by book order by co DESC";
                 $Fetch = PDO_FetchAll($query);
                 $iFetch = count($Fetch);
                 if ($iFetch > 0) {

+ 1 - 1
app/search/search.php

@@ -35,7 +35,7 @@ function render_book_list($strWordlist, $booklist = null)
             $aInputBook["{$oneBook}"] = 1;
         }
     }
-    $query = "select book,sum(count) as co from bookword where \"wordindex\" in $strWordlist group by book order by co DESC";
+    $query = "SELECT book,sum(count) as co from "._TABLE_BOOK_WORD_." where \"wordindex\" in $strWordlist group by book order by co DESC";
     $Fetch = PDO_FetchAll($query);
     $iFetch = count($Fetch);
     $newBookList = array();

+ 3 - 3
app/search/word_function.php

@@ -16,7 +16,7 @@ function get_new_book_list($strWordlist, $booklist = null)
             $aInputBook["{$oneBook}"] = 1;
         }
     }
-    $query = "select book,sum(count) as co from bookword where \"wordindex\" in $strWordlist group by book order by co DESC";
+    $query = "SELECT book,sum(count) as co from "._TABLE_BOOK_WORD_." where \"wordindex\" in $strWordlist group by book order by co DESC";
     $Fetch = PDO_FetchAll($query);
     $iFetch = count($Fetch);
     $newBookList = array();
@@ -69,7 +69,7 @@ function get_book_tag($strWordlist, $booklist = null)
             $aInputBook["{$oneBook}"] = 1;
         }
     }
-    $query = "select book,sum(count) as co from bookword where \"wordindex\" in $strWordlist group by book order by co DESC";
+    $query = "SELECT book,sum(count) as co from "._TABLE_BOOK_WORD_." where \"wordindex\" in $strWordlist group by book order by co DESC";
     $Fetch = PDO_FetchAll($query);
     $iFetch = count($Fetch);
     $newBookList = array();
@@ -129,7 +129,7 @@ function render_book_list($strWordlist, $booklist = null)
             $aInputBook["{$oneBook}"] = 1;
         }
     }
-    $query = "select book,sum(count) as co from bookword where \"wordindex\" in $strWordlist group by book order by co DESC";
+    $query = "SELECT book,sum(count) as co from "._TABLE_BOOK_WORD_." where \"wordindex\" in $strWordlist group by book order by co DESC";
     $Fetch = PDO_FetchAll($query);
     $iFetch = count($Fetch);
     $newBookList = array();

+ 1 - 1
app/search/word_list.php

@@ -79,7 +79,7 @@ if (isset($booklist)) {
         $aInputBook["{$oneBook}"] = 1;
     }
 }
-$query = "select book, wordindex,count from bookword where \"wordindex\" in $strQueryWordId ";
+$query = "SELECT book, wordindex,count from "._TABLE_BOOK_WORD_." where \"wordindex\" in $strQueryWordId ";
 $Fetch = PDO_FetchAll($query);
 $iFetch = count($Fetch);
 $newBookList = array();

+ 1 - 1
app/search/word_statistics.php

@@ -85,7 +85,7 @@ if (isset($booklist)) {
         $aInputBook["{$oneBook}"] = 1;
     }
 }
-$query = "select book,sum(count) as co from bookword where \"wordindex\" in $strQueryWordId group by book order by co DESC";
+$query = "SELECT book,sum(count) as co from "._TABLE_BOOK_WORD_." where \"wordindex\" in $strQueryWordId group by book order by co DESC";
 $Fetch = PDO_FetchAll($query);
 $iFetch = count($Fetch);
 $newBookList = array();