-config=Extract_Links\r
+config=Extract_texts\r
<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
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
}\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
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;
if ($version == 'stable') {
$this->assets = WS_COMPILE_ASSETS . '/_html5prod';
- wsMaintenance::updateHTML5Sources(array(),false);
+ wsMaintenance::updateHTML5Sources(array(), false);
} else {
$this->assets = WS_COMPILE_ASSETS . '/_html5';
}
$this->writeLangs();
$this->writeIndex($numCSS);
$this->writeJs();
+ $this->writeTexts();
$this->writeCache();
}
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);