]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 9 Jul 2012 09:36:17 +0000 (09:36 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 9 Jul 2012 09:36:17 +0000 (09:36 +0000)
fluidbook/tools/fwstk/nbproject/private/config.properties
fluidbook/tools/fwstk/nbproject/private/private.xml
fluidbook/tools/fwstk/src/cube/util/StringUtil.java
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/html5/class.ws.html5.compiler.php

index 5aa2fea7bf417086c81ccabfe06cb2d78e4134e3..9d6df0f95eac7e0bed4af6b3fca67bc21f4bef06 100644 (file)
@@ -1 +1 @@
-config=Extract_Links\r
+config=Extract_texts\r
index 1ee292a27eb0138a49e80b020b67b84a8cc40aaf..621169c0d57a98f9312db523b8a1f3f6dce415bb 100644 (file)
@@ -3,5 +3,9 @@
     <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>\r
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">\r
         <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/Main.java</file>\r
+        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/TextsThread.java</file>\r
+        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/com/fluidbook/fwstk/CustomStripper.java</file>\r
+        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/src/cube/util/StringUtil.java</file>\r
+        <file>file:/H:/Works/cubeExtranet/fluidbook/tools/fwstk/nbproject/build-impl.xml</file>\r
     </open-files>\r
 </project-private>\r
index f02fb0a6cd4559b89d043f4cadac3fe21918aedb..6438d20ad8252281309014fcb90298a27f27dadb 100644 (file)
@@ -42,9 +42,19 @@ public class StringUtil {
                        ignore = "&&[^" + ig + "]";\r
                }\r
 \r
-               return in.replaceAll(\r
-                               "[\\x21-\\x2f\\x3a-\\x3f\\x5b-\\x5f\\x7b-\\xa0\\xaa-\\xbf’" + ignore + "]",\r
+               String res = in.replaceAll(\r
+                               "[\\u2000-\\u20ff\\x21-\\x2f\\x3a-\\x3f\\x5b-\\x5f\\x7b-\\xa0\\xaa-\\xbf’" + ignore + "]",\r
                                " ");\r
+       \r
+               return res;\r
+       }\r
+       \r
+       public static String normalizeWhite(String in){\r
+               String res = in.replaceAll(\r
+                               "[\\u2000-\\u20ff]",\r
+                               " ");\r
+               \r
+               return res;\r
        }\r
 \r
        public static String removeControl(String in) {\r
index f6a378db560c737f5eabeb38ddb30ede721595ae..d02170c33edec30500bc763d245715dc801c160e 100644 (file)
@@ -765,22 +765,22 @@ class wsDAOBook extends commonDAO {
                        }\r
 \r
                        if (!isset($index[$woa])) {\r
-                               $index[$woa] = array('total' => 0, 'words' => array());\r
+                               $index[$woa] = array('t' => 0, 'w' => array());\r
                        }\r
-                       $index[$woa]['total'] += $total;\r
+                       $index[$woa]['t'] += $total;\r
 \r
                        $words = explode("\t", $wordslist);\r
 \r
                        foreach ($words as $word) {\r
                                list($wordwa, $count) = explode('$', $word, 2);\r
-                               if (!isset($index[$woa]['words'][$wordwa])) {\r
-                                       $index[$woa]['words'][$wordwa] = array('total' => 0, 'pages' => array());\r
+                               if (!isset($index[$woa]['w'][$wordwa])) {\r
+                                       $index[$woa]['w'][$wordwa] = array('t' => 0, 'p' => array());\r
                                }\r
-                               if (!isset($index[$woa]['words'][$wordwa]['pages'][$page])) {\r
-                                       $index[$woa]['words'][$wordwa]['pages'][$page] = 0;\r
+                               if (!isset($index[$woa]['w'][$wordwa]['p'][$page])) {\r
+                                       $index[$woa]['w'][$wordwa]['p'][$page] = 0;\r
                                }\r
-                               $index[$woa]['words'][$wordwa]['total'] += $count;\r
-                               $index[$woa]['words'][$wordwa]['pages'][$page] += $count;\r
+                               $index[$woa]['w'][$wordwa]['t'] += $count;\r
+                               $index[$woa]['w'][$wordwa]['p'][$page] += $count;\r
                        }\r
                }\r
        }\r
index 7b4b2cbd49d3c4f23fa2152071600323bc0a0174..6ef0672d834847cd2b889458316f4d4556611150 100644 (file)
@@ -54,12 +54,22 @@ class wsHTML5Compiler {
        protected $fontDocs = array();
        protected $dir;
        protected $vdir;
+
+       /**
+        *
+        * @var wsBook
+        */
        protected $book;
        protected $pages;
        protected $theme;
        protected $version;
        protected $book_id;
        protected $themeRoot;
+
+       /**
+        *
+        * @var wsDAOBook
+        */
        protected $daoBook;
        protected $needToRecompileContents = true;
        protected $needToRecompileSettings = true;
@@ -86,7 +96,7 @@ class wsHTML5Compiler {
 
                if ($version == 'stable') {
                        $this->assets = WS_COMPILE_ASSETS . '/_html5prod';
-                       wsMaintenance::updateHTML5Sources(array(),false);
+                       wsMaintenance::updateHTML5Sources(array(), false);
                } else {
                        $this->assets = WS_COMPILE_ASSETS . '/_html5';
                }
@@ -192,6 +202,7 @@ class wsHTML5Compiler {
                $this->writeLangs();
                $this->writeIndex($numCSS);
                $this->writeJs();
+               $this->writeTexts();
                $this->writeCache();
        }
 
@@ -454,6 +465,14 @@ class wsHTML5Compiler {
                file_put_contents($this->vdir . '/data/datas.js', $config);
        }
 
+       public function writeTexts() {
+               $this->daoBook->makeTextsIndexes($this->book, $this->pages, $index, $textes);
+               $js = 'var INDEX=' . $index . ';' . "\r";
+               $js .= 'var TEXTS=' . $textes . ';' . "\r";
+
+               file_put_contents($this->vdir . '/data/search.js', $js);
+       }
+
        protected function writeConfig() {
 
                $this->config->numerotation = explode(',', $this->book->numerotation);